fix(docker): align backend port with Caddy reverse proxy

Caddy routes /api/* to port 3002 but docker-compose exposed
backend on 3001. Changed backend port, healthcheck, and
frontend fallback to 3002 for consistency.
This commit is contained in:
2026-04-21 13:30:59 -04:00
parent 18e9f58c1a
commit 175c368cfd
+5 -5
View File
@@ -39,7 +39,7 @@ services:
dockerfile: backend/Dockerfile dockerfile: backend/Dockerfile
container_name: coop-backend container_name: coop-backend
healthcheck: healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:3001/health || exit 1"] test: ["CMD-SHELL", "wget -qO- http://localhost:3002/health || exit 1"]
interval: 5s interval: 5s
timeout: 5s timeout: 5s
retries: 5 retries: 5
@@ -47,7 +47,7 @@ services:
- NODE_ENV=production - NODE_ENV=production
- DATABASE_URL=postgresql://coop:coop_password@postgres:5432/coop_credits?schema=public - DATABASE_URL=postgresql://coop:coop_password@postgres:5432/coop_credits?schema=public
- REDIS_URL=redis://redis:6379 - REDIS_URL=redis://redis:6379
- PORT=3001 - PORT=3002
- JWT_SECRET=${JWT_SECRET} - JWT_SECRET=${JWT_SECRET}
- SOLANA_RPC_URL=${SOLANA_RPC_URL:-https://api.devnet.solana.com} - SOLANA_RPC_URL=${SOLANA_RPC_URL:-https://api.devnet.solana.com}
- SOLANA_PROGRAM_ID=${SOLANA_PROGRAM_ID} - SOLANA_PROGRAM_ID=${SOLANA_PROGRAM_ID}
@@ -61,7 +61,7 @@ services:
- OVERSEER_API_KEY=${OVERSEER_API_KEY} - OVERSEER_API_KEY=${OVERSEER_API_KEY}
- ENCRYPTION_KEY=${ENCRYPTION_KEY} - ENCRYPTION_KEY=${ENCRYPTION_KEY}
ports: ports:
- "3001:3001" # Exposed on all interfaces - "3002:3002" # Exposed on all interfaces
depends_on: depends_on:
postgres: postgres:
condition: service_healthy condition: service_healthy
@@ -76,13 +76,13 @@ services:
context: . context: .
dockerfile: frontend/Dockerfile dockerfile: frontend/Dockerfile
args: args:
- NEXT_PUBLIC_API_URL=${API_URL:-http://localhost:3001} - NEXT_PUBLIC_API_URL=${API_URL:-http://localhost:3002}
- NEXT_PUBLIC_SOLANA_NETWORK=devnet - NEXT_PUBLIC_SOLANA_NETWORK=devnet
- NEXT_PUBLIC_SOLANA_RPC_URL=https://api.devnet.solana.com - NEXT_PUBLIC_SOLANA_RPC_URL=https://api.devnet.solana.com
container_name: coop-frontend container_name: coop-frontend
environment: environment:
- NODE_ENV=production - NODE_ENV=production
- NEXT_PUBLIC_API_URL=${API_URL:-http://localhost:3001} - NEXT_PUBLIC_API_URL=${API_URL:-http://localhost:3002}
- NEXT_PUBLIC_SOLANA_NETWORK=devnet - NEXT_PUBLIC_SOLANA_NETWORK=devnet
- NEXT_PUBLIC_SOLANA_RPC_URL=https://api.devnet.solana.com - NEXT_PUBLIC_SOLANA_RPC_URL=https://api.devnet.solana.com
ports: ports: