rps-royale/docker-compose.yml
Ubuntu 419ed6eef0 fix(web): correct Phaser rendering and Socket.io API URL for Docker
- Rewrite /play page to use direct dynamic import inside useEffect
  instead of next/dynamic (fixes BAILOUT_TO_CLIENT_SIDE_RENDERING)
- Fix Phaser 3.86 particle API: use direct property assignment
  instead of setFrequency/setLifespan
- Add AI match detection and skip blockchain calls for AI opponents
- Pass NEXT_PUBLIC_* build args via Dockerfile/docker-compose
  so the built client points to the correct API endpoint
- Remove obsolete PlayClient.tsx

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 04:40:39 +00:00

102 lines
2.7 KiB
YAML

services:
rps-db:
image: postgres:17-alpine
container_name: rps-db
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-rpsuser}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-rpspass}
POSTGRES_DB: ${POSTGRES_DB:-rpsdb}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-rpsuser} -d ${POSTGRES_DB:-rpsdb}"]
interval: 5s
timeout: 5s
retries: 30
volumes:
- rps-db-data:/var/lib/postgresql/data
ports:
- "127.0.0.1:3052:5432"
networks:
- npm_default
rps-redis:
image: redis:7-alpine
container_name: rps-redis
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 30
ports:
- "127.0.0.1:3053:6379"
networks:
- npm_default
hardhat-node:
build:
context: .
dockerfile: apps/contracts/Dockerfile.node
container_name: hardhat-node
restart: unless-stopped
ports:
- "127.0.0.1:3054:8545"
networks:
- npm_default
rps-server:
build:
context: .
dockerfile: apps/server/Dockerfile
container_name: rps-server
restart: unless-stopped
environment:
NODE_ENV: ${NODE_ENV:-development}
DATABASE_URL: ${DATABASE_URL}
REDIS_URL: ${REDIS_URL}
SERVER_PORT: 3001
CORS_ORIGIN: ${CORS_ORIGIN:-https://jeu.cosmolan.fr}
CONTRACT_ADDRESS: ${CONTRACT_ADDRESS}
HARDHAT_RPC_URL: ${HARDHAT_RPC_URL}
SEPOLIA_RPC_URL: ${SEPOLIA_RPC_URL}
PRIVATE_KEY: ${PRIVATE_KEY}
ports:
- "127.0.0.1:3051:3001"
depends_on:
rps-db:
condition: service_healthy
rps-redis:
condition: service_healthy
networks:
- npm_default
rps-web:
build:
context: .
dockerfile: apps/web/Dockerfile
args:
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-https://api.jeu.cosmolan.fr}
NEXT_PUBLIC_CONTRACT_ADDRESS: ${NEXT_PUBLIC_CONTRACT_ADDRESS}
NEXT_PUBLIC_CHAIN_ID: ${NEXT_PUBLIC_CHAIN_ID:-31337}
NEXT_PUBLIC_HARDHAT_RPC_URL: ${NEXT_PUBLIC_HARDHAT_RPC_URL}
container_name: rps-web
restart: unless-stopped
environment:
NODE_ENV: ${NODE_ENV:-production}
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-https://api.jeu.cosmolan.fr}
NEXT_PUBLIC_CONTRACT_ADDRESS: ${NEXT_PUBLIC_CONTRACT_ADDRESS}
NEXT_PUBLIC_CHAIN_ID: ${NEXT_PUBLIC_CHAIN_ID:-31337}
NEXT_PUBLIC_HARDHAT_RPC_URL: ${NEXT_PUBLIC_HARDHAT_RPC_URL}
ports:
- "127.0.0.1:3050:3000"
depends_on:
- rps-server
networks:
- npm_default
volumes:
rps-db-data:
networks:
npm_default:
external: true