Files
coop/docker-compose.yml
T
hobokenchicken a20927913f fix(docker): use host network mode for backend
Backend couldn't reach Tautulli (172.20.1.255) or Overseer
(172.20.1.225) from Docker bridge network. Switched to host
network mode so backend can access local network services.
Updated DATABASE_URL and REDIS_URL to use localhost.
2026-04-21 15:08:36 -04:00

100 lines
2.6 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@localhost:5432/coop_credits?schema=public
- REDIS_URL=redis://localhost: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}
network_mode: host
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
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