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:3001/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=3001 - 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} - 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: - "3001:3001" 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=http://localhost:3001 - NEXT_PUBLIC_SOLANA_NETWORK=devnet - NEXT_PUBLIC_SOLANA_RPC_URL=https://api.devnet.solana.com container_name: coop-frontend environment: - NEXT_PUBLIC_API_URL=http://localhost:3001 - NEXT_PUBLIC_SOLANA_NETWORK=devnet - NEXT_PUBLIC_SOLANA_RPC_URL=https://api.devnet.solana.com ports: - "3000:3000" depends_on: - backend networks: - coop-network restart: unless-stopped nginx: image: nginx:alpine container_name: coop-nginx ports: - "80:80" - "443:443" volumes: - ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf:ro - ./docker/nginx/ssl:/etc/nginx/ssl:ro depends_on: frontend: condition: service_started backend: condition: service_healthy networks: - coop-network restart: unless-stopped volumes: postgres_data: redis_data: networks: coop-network: driver: bridge