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
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
networks:
|
||||||
|
- autopilot-net
|
||||||
|
|
||||||
# ─── AutoPilot Master (Cloud Coordinator Backend) ─────────────────────────
|
# ─── AutoPilot Master (Cloud Coordinator Backend) ─────────────────────────
|
||||||
master:
|
master:
|
||||||
|
|
@ -42,6 +44,8 @@ services:
|
||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- autopilot-net
|
||||||
|
|
||||||
# ─── AutoPilot UI (React Frontend via Nginx) ───────────────────────────────
|
# ─── AutoPilot UI (React Frontend via Nginx) ───────────────────────────────
|
||||||
ui:
|
ui:
|
||||||
|
|
@ -56,6 +60,8 @@ services:
|
||||||
depends_on:
|
depends_on:
|
||||||
- master
|
- master
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- autopilot-net
|
||||||
|
|
||||||
# ─── AutoPilot Worker (Execution Engine) ──────────────────────────────────
|
# ─── AutoPilot Worker (Execution Engine) ──────────────────────────────────
|
||||||
# NOTE: The worker needs access to a real browser (Chrome/Firefox).
|
# NOTE: The worker needs access to a real browser (Chrome/Firefox).
|
||||||
|
|
@ -74,6 +80,13 @@ services:
|
||||||
# depends_on:
|
# depends_on:
|
||||||
# - master
|
# - master
|
||||||
# restart: unless-stopped
|
# restart: unless-stopped
|
||||||
|
# networks:
|
||||||
|
# - autopilot-net
|
||||||
|
|
||||||
|
networks:
|
||||||
|
autopilot-net:
|
||||||
|
driver: bridge
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres_data:
|
postgres_data:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,6 @@ server {
|
||||||
# Allow large request bodies (screenshots are base64 encoded)
|
# Allow large request bodies (screenshots are base64 encoded)
|
||||||
client_max_body_size 50M;
|
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
|
# Serve static files from the React build
|
||||||
location / {
|
location / {
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
|
|
@ -18,7 +14,7 @@ server {
|
||||||
|
|
||||||
# Reverse proxy API requests to the Master backend container
|
# Reverse proxy API requests to the Master backend container
|
||||||
location /api/ {
|
location /api/ {
|
||||||
proxy_pass $backend;
|
proxy_pass http://autopilot-master:9090;
|
||||||
|
|
||||||
# Standard proxy headers
|
# Standard proxy headers
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue