services: director: build: context: . dockerfile: Dockerfile image: jakousa/mmo-server:latest container_name: mmo-director command: ["mmo-director"] networks: - mmo-net ports: - "50051:50051" restart: unless-stopped node-1: image: jakousa/mmo-server:latest container_name: mmo-node-1 command: ["mmo-village-node"] environment: NODE_ID: "1" LISTEN_ADDR: "0.0.0.0:50052" DIRECTOR_ADDR: "http://director:50051" GATEWAY_GRPC_ADDR: "http://gateway:50050" DATABASE_URL: ${DATABASE_URL:-sqlite://mmo.db} REDIS_URL: ${REDIS_URL:-redis://redis:6379} networks: - mmo-net depends_on: - director restart: unless-stopped node-2: image: jakousa/mmo-server:latest container_name: mmo-node-2 command: ["mmo-node"] environment: NODE_ID: "2" LISTEN_ADDR: "0.0.0.0:50053" DIRECTOR_ADDR: "http://director:50051" GATEWAY_GRPC_ADDR: "http://gateway:50050" DATABASE_URL: ${DATABASE_URL:-sqlite://mmo.db} REDIS_URL: ${REDIS_URL:-redis://redis:6379} networks: - mmo-net depends_on: - director restart: unless-stopped gateway: image: jakousa/mmo-server:latest container_name: mmo-gateway command: ["mmo-gateway"] environment: LISTEN_ADDR: "0.0.0.0:8080" DIRECTOR_ADDR: "http://director:50051" DEFAULT_NODE_ADDR: "node-1:50052" REDIS_URL: ${REDIS_URL:-redis://redis:6379} networks: - mmo-net ports: - "8080:8080" - "4433:4433/udp" - "9091:9091" depends_on: - node-1 - node-2 restart: unless-stopped web: build: context: ./web dockerfile: Dockerfile image: jakousa/mmo-web:latest container_name: mmo-web ports: - "3000:80" networks: - mmo-net depends_on: - gateway restart: unless-stopped loadtest: image: jakousa/mmo-server:latest container_name: mmo-loadtest command: ["mmo-loadtest", "--gateway-addr", "gateway:8080", "--bots", "100", "--duration-secs", "5"] environment: GATEWAY_ADDR: "gateway:8080" BOT_COUNT: "100" DURATION_SECS: "5" networks: - mmo-net depends_on: - gateway profiles: - loadtest postgres: image: postgres:16-alpine container_name: mmo-postgres environment: POSTGRES_USER: mmo POSTGRES_PASSWORD: mmo_password POSTGRES_DB: mmo_db ports: - "5432:5432" volumes: - postgres-data:/var/lib/postgresql/data networks: - mmo-net healthcheck: test: ["CMD-SHELL", "pg_isready -U mmo -d mmo_db"] interval: 5s timeout: 5s retries: 5 profiles: - storage - full redis: image: redis:7-alpine container_name: mmo-redis ports: - "6379:6379" volumes: - redis-data:/data networks: - mmo-net healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 5s retries: 5 profiles: - storage - full networks: mmo-net: driver: bridge volumes: postgres-data: redis-data: