From d421e218649425c95f2b1425586751ac1e0427c1 Mon Sep 17 00:00:00 2001 From: admin <572701190@qq.com> Date: Sat, 9 May 2026 18:12:29 +0800 Subject: [PATCH] add nas docker compose config --- docker_compose_Nas.yaml | 68 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 docker_compose_Nas.yaml diff --git a/docker_compose_Nas.yaml b/docker_compose_Nas.yaml new file mode 100644 index 0000000..d983732 --- /dev/null +++ b/docker_compose_Nas.yaml @@ -0,0 +1,68 @@ +services: + gemini-drawpicture: + # NAS deployment file. + # + # Recommended NAS path: + # /share/Container/Gemini_Draw + # + # If your project is in a different folder, update `build.context` below + # or run compose from the project folder and change it to `.`. + # + # First-time setup on NAS: + # cd /share/Container/Gemini_Draw + # cp .env.example .env.local + # vi .env.local + # + # Required values in .env.local: + # GEMINI_API_KEY="your_gemini_api_key" + # API_AUTH_TOKEN="a_long_random_api_access_token" + # API_AUTH_DISABLED="false" + # APP_PASSWORD="your_web_login_password" + # APP_URL="http://192.168.31.5:4001" + # + # Build and start: + # cd /share/Container/Gemini_Draw + # sudo docker compose -f docker_compose_Nas.yaml up -d --build + # + # Rebuild from scratch: + # sudo docker compose -f docker_compose_Nas.yaml build --no-cache + # sudo docker compose -f docker_compose_Nas.yaml up -d --force-recreate + # + # View logs: + # sudo docker logs -f gemini-drawpicture + # + # Access: + # UI: http://192.168.31.5:4001/ + # API: http://192.168.31.5:4002/api/health + build: + context: /share/Container/Gemini_Draw + dockerfile: Dockerfile + container_name: gemini-drawpicture + init: true + restart: unless-stopped + env_file: + - .env.local + environment: + # Keep API auth enabled on NAS. Use API_AUTH_TOKEN from .env.local. + API_AUTH_DISABLED: "false" + API_PORT: "3002" + + # Optional proxy settings. Keep them if NAS needs OpenClash/proxy + # to reach Google/Gemini; otherwise comment these lines out. + HTTP_PROXY: "http://192.168.31.7:7893" + HTTPS_PROXY: "http://192.168.31.7:7893" + http_proxy: "http://192.168.31.7:7893" + https_proxy: "http://192.168.31.7:7893" + NO_PROXY: "localhost,127.0.0.1,192.168.31.0/24" + no_proxy: "localhost,127.0.0.1,192.168.31.0/24" + ports: + # Host port 4001 -> frontend port 3000 in container. + - "4001:3000" + # Host port 4002 -> API port 3002 in container. + - "4002:3002" + healthcheck: + test: ["CMD-SHELL", "node -e \"fetch('http://127.0.0.1:3002/api/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))\""] + interval: 30s + timeout: 10s + retries: 3 + start_period: 20s