fix: reorganize network definitions for services in compose.yaml
All checks were successful
Auto-Deploy Changed Stacks / deploy (push) Successful in 13s

This commit is contained in:
Nathan 2026-06-21 16:59:24 -04:00
parent a2310c7f55
commit bf3b54baa9

View File

@ -6,8 +6,6 @@ services:
POSTGRES_DB: jobsquatch POSTGRES_DB: jobsquatch
POSTGRES_USER: postgres POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD must be set} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD must be set}
networks:
- jobsquatch-internal
volumes: volumes:
- postgres_data:/var/lib/postgresql/data - postgres_data:/var/lib/postgresql/data
healthcheck: healthcheck:
@ -15,15 +13,17 @@ services:
interval: 5s interval: 5s
timeout: 5s timeout: 5s
retries: 10 retries: 10
networks:
- jobsquatch-internal
redis: redis:
image: redis:7-alpine image: redis:7-alpine
restart: unless-stopped restart: unless-stopped
networks:
- jobsquatch-internal
volumes: volumes:
- redis_data:/data - redis_data:/data
command: redis-server --appendonly yes command: redis-server --appendonly yes
networks:
- jobsquatch-internal
app: app:
image: ghcr.io/teamcastaldi/jobsquatch-backend:${IMAGE_TAG:-latest} image: ghcr.io/teamcastaldi/jobsquatch-backend:${IMAGE_TAG:-latest}
@ -33,8 +33,6 @@ services:
condition: service_healthy condition: service_healthy
redis: redis:
condition: service_started condition: service_started
networks:
- jobsquatch-internal
environment: environment:
APP_ENV: production APP_ENV: production
DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD:?POSTGRES_PASSWORD must be set}@db:5432/jobsquatch DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD:?POSTGRES_PASSWORD must be set}@db:5432/jobsquatch
@ -60,18 +58,24 @@ services:
timeout: 5s timeout: 5s
retries: 5 retries: 5
start_period: 30s start_period: 30s
networks:
- jobsquatch-internal
frontend: frontend:
image: ghcr.io/teamcastaldi/jobsquatch-frontend:${IMAGE_TAG:-latest} image: ghcr.io/teamcastaldi/jobsquatch-frontend:${IMAGE_TAG:-latest}
restart: unless-stopped restart: unless-stopped
ports: ports:
- "6080:80" - "80:80"
networks:
- jobsquatch-internal
- proxy-net
depends_on: depends_on:
app: app:
condition: service_healthy condition: service_healthy
labels:
# When a container is on multiple networks, Traefik picks one arbitrarily.
# Pin it to proxy-net so Traefik never tries to route via jobsquatch-internal.
traefik.docker.network: proxy-net
networks:
- jobsquatch-internal
- proxy-net
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.routers.jobsquatch.rule=Host(`jobsquatch-alpha.castaldifamily.com`)" - "traefik.http.routers.jobsquatch.rule=Host(`jobsquatch-alpha.castaldifamily.com`)"
@ -86,7 +90,13 @@ volumes:
redis_data: redis_data:
networks: networks:
# Internal bridge for service-to-service communication (db, redis, app, frontend).
# Named explicitly so the full Docker network name is <project>_jobsquatch-internal,
# where <project> is the Compose project name (COMPOSE_PROJECT_NAME or directory name).
# On heimdall this is jobsquatch-alpha_jobsquatch-internal.
jobsquatch-internal: jobsquatch-internal:
internal: true driver: bridge
# External network managed by Traefik on heimdall. The frontend must be on this
# network so Traefik can route inbound HTTPS traffic to it.
proxy-net: proxy-net:
external: true external: true