fix(docker): update nginx configuration and simplify docker script (#903)

This commit is contained in:
JeffJiang
2026-02-25 22:16:43 +08:00
committed by GitHub
parent d24a66ffd3
commit 3a7251c95e
3 changed files with 6 additions and 10 deletions

View File

@@ -66,7 +66,7 @@ services:
ports:
- "2026:2026"
volumes:
- ./nginx/${NGINX_CONF:-nginx.local.conf}:/etc/nginx/nginx.conf:ro
- ./nginx/${NGINX_CONF:-nginx.conf}:/etc/nginx/nginx.conf:ro
depends_on:
- frontend
- gateway

View File

@@ -30,10 +30,6 @@ http {
server frontend:3000;
}
upstream provisioner {
server provisioner:8002;
}
# ── Main server (path-based routing) ─────────────────────────────────
server {
listen 2026 default_server;
@@ -189,8 +185,11 @@ http {
}
# ── Provisioner API (sandbox management) ────────────────────────
# Use a variable so nginx resolves provisioner at request time (not startup).
# This allows nginx to start even when provisioner container is not running.
location /api/sandboxes {
proxy_pass http://provisioner;
set $provisioner_upstream provisioner:8002;
proxy_pass http://$provisioner_upstream;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;

View File

@@ -95,7 +95,6 @@ init() {
# Start Docker development environment
start() {
local sandbox_mode
local nginx_conf
local services
echo "=========================================="
@@ -106,10 +105,8 @@ start() {
sandbox_mode="$(detect_sandbox_mode)"
if [ "$sandbox_mode" = "provisioner" ]; then
nginx_conf="nginx.conf"
services="frontend gateway langgraph provisioner nginx"
else
nginx_conf="nginx.local.conf"
services="frontend gateway langgraph nginx"
fi
@@ -129,7 +126,7 @@ start() {
fi
echo "Building and starting containers..."
cd "$DOCKER_DIR" && NGINX_CONF="$nginx_conf" $COMPOSE_CMD up --build -d --remove-orphans $services
cd "$DOCKER_DIR" && $COMPOSE_CMD up --build -d --remove-orphans $services
echo ""
echo "=========================================="
echo " DeerFlow Docker is starting!"