fix: explicit docker network for rock solid DNS resolution
Completely removes the Nginx resolver hack. By assigning all services
to a dedicated custom bridge network ('autopilot-net') and relying on
docker-compose 'depends_on', Docker's internal DNS is guaranteed to
resolve the 'autopilot-master' hostname cleanly at Nginx startup without
SERVFAILs.
This commit is contained in:
parent
b16c7c4a35
commit
a7ae12d297
|
|
@ -18,6 +18,8 @@ services:
|
|||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- autopilot-net
|
||||
|
||||
# ─── AutoPilot Master (Cloud Coordinator Backend) ─────────────────────────
|
||||
master:
|
||||
|
|
@ -42,6 +44,8 @@ services:
|
|||
postgres:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- autopilot-net
|
||||
|
||||
# ─── AutoPilot UI (React Frontend via Nginx) ───────────────────────────────
|
||||
ui:
|
||||
|
|
@ -56,6 +60,8 @@ services:
|
|||
depends_on:
|
||||
- master
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- autopilot-net
|
||||
|
||||
# ─── AutoPilot Worker (Execution Engine) ──────────────────────────────────
|
||||
# NOTE: The worker needs access to a real browser (Chrome/Firefox).
|
||||
|
|
@ -74,6 +80,13 @@ services:
|
|||
# depends_on:
|
||||
# - master
|
||||
# restart: unless-stopped
|
||||
# networks:
|
||||
# - autopilot-net
|
||||
|
||||
networks:
|
||||
autopilot-net:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
|
||||
|
|
|
|||
|
|
@ -5,10 +5,6 @@ server {
|
|||
# Allow large request bodies (screenshots are base64 encoded)
|
||||
client_max_body_size 50M;
|
||||
|
||||
# Use Docker's internal DNS resolver (disable IPv6 to prevent SERVFAIL)
|
||||
resolver 127.0.0.11 ipv6=off valid=30s;
|
||||
set $backend http://master:9090;
|
||||
|
||||
# Serve static files from the React build
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
|
|
@ -18,7 +14,7 @@ server {
|
|||
|
||||
# Reverse proxy API requests to the Master backend container
|
||||
location /api/ {
|
||||
proxy_pass $backend;
|
||||
proxy_pass http://autopilot-master:9090;
|
||||
|
||||
# Standard proxy headers
|
||||
proxy_set_header Host $host;
|
||||
|
|
|
|||
Loading…
Reference in New Issue