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:
vithobaa 2026-06-29 18:51:57 +05:30
parent b16c7c4a35
commit a7ae12d297
2 changed files with 14 additions and 5 deletions

View File

@ -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:

View File

@ -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;