Add remote development support with Docker Nginx configuration

- Introduce a new `nginx-remote-dev` service in `docker-compose.yaml` for remote development environments, allowing Nginx to proxy requests to the host machine's frontend and backend services.
- Create a new Nginx configuration file `ai-video.remote-dev.conf` tailored for remote setups, ensuring proper handling of WebSocket and API requests.
- Update `README.md` to include detailed instructions for setting up remote development with Nginx, including certificate generation and service initialization.
- Enhance the `setup-certs.sh` script to support additional hostnames for certificate signing, improving flexibility for remote access.
- Revise documentation to clarify the development paths and requirements for local and remote environments.
This commit is contained in:
Xin Wang
2026-07-09 22:21:18 +08:00
parent 35d24acf40
commit ada22773c1
4 changed files with 248 additions and 8 deletions

View File

@@ -153,6 +153,22 @@ services:
- ui
networks: [app-network]
# ---- 可选(profile: remote-dev):远程开发机 Docker nginx + 宿主机 npm/uvicorn ----
# 宿主机单独启动:
# frontend: NEXT_PUBLIC_API_BASE_URL=https://<host> npm run dev -- --hostname 0.0.0.0
# backend: uvicorn app:app --host 0.0.0.0 --port 8000 --reload
nginx-remote-dev:
image: nginx:alpine
profiles: ["remote-dev"]
ports:
- "80:80"
- "443:443"
volumes:
- ./deploy/nginx/ai-video.remote-dev.conf:/etc/nginx/nginx.conf:ro
- ./deploy/certs:/etc/nginx/certs:ro
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
postgres_data:
redis_data: