Files
coop/docker-compose.yml
T
hobokenchicken 175c368cfd 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.
2026-04-21 13:30:59 -04:00

103 lines
2.7 KiB
YAML

services:
postgres:
image: postgres:16-alpine
container_name: coop-postgres
environment:
POSTGRES_USER: coop
POSTGRES_PASSWORD: coop_password
POSTGRES_DB: coop_credits
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U coop -d coop_credits"]
interval: 5s
timeout: 5s
retries: 5
networks:
- coop-network
redis:
image: redis:7-alpine
container_name: coop-redis
volumes:
- redis_data:/data
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
networks:
- coop-network
backend:
build:
context: .
dockerfile: backend/Dockerfile
container_name: coop-backend
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:3002/health || exit 1"]
interval: 5s
timeout: 5s
retries: 5
environment:
- NODE_ENV=production
- DATABASE_URL=postgresql://coop:coop_password@postgres:5432/coop_credits?schema=public
- REDIS_URL=redis://redis:6379
- PORT=3002
- JWT_SECRET=${JWT_SECRET}
- SOLANA_RPC_URL=${SOLANA_RPC_URL:-https://api.devnet.solana.com}
- SOLANA_PROGRAM_ID=${SOLANA_PROGRAM_ID}
- SOLANA_MINT_AUTHORITY_KEYPAIR=${SOLANA_MINT_AUTHORITY_KEYPAIR}
- PLEX_CLIENT_ID=${PLEX_CLIENT_ID}
- PLEX_CLIENT_SECRET=${PLEX_CLIENT_SECRET}
- PLEX_REDIRECT_URI=${PLEX_REDIRECT_URI}
- TAUTULLI_URL=${TAUTULLI_URL}
- TAUTULLI_API_KEY=${TAUTULLI_API_KEY}
- OVERSEER_URL=${OVERSEER_URL}
- OVERSEER_API_KEY=${OVERSEER_API_KEY}
- ENCRYPTION_KEY=${ENCRYPTION_KEY}
ports:
- "3002:3002" # Exposed on all interfaces
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- coop-network
restart: unless-stopped
frontend:
build:
context: .
dockerfile: frontend/Dockerfile
args:
- NEXT_PUBLIC_API_URL=${API_URL:-http://localhost:3002}
- NEXT_PUBLIC_SOLANA_NETWORK=devnet
- NEXT_PUBLIC_SOLANA_RPC_URL=https://api.devnet.solana.com
container_name: coop-frontend
environment:
- NODE_ENV=production
- NEXT_PUBLIC_API_URL=${API_URL:-http://localhost:3002}
- NEXT_PUBLIC_SOLANA_NETWORK=devnet
- NEXT_PUBLIC_SOLANA_RPC_URL=https://api.devnet.solana.com
ports:
- "3000:3000" # Exposed on all interfaces
depends_on:
- backend
networks:
- coop-network
restart: unless-stopped
volumes:
postgres_data:
redis_data:
networks:
coop-network:
driver: bridge