server-master/docker-compose.yml

68 lines
1.6 KiB
YAML

services:
postgres:
image: postgres:13
container_name: wingsemu-postgres
restart: unless-stopped
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB:-game}
POSTGRES_USER: ${POSTGRES_USER:-postgres}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
interval: 10s
timeout: 5s
retries: 10
redis:
image: redis:7-alpine
container_name: wingsemu-redis
restart: unless-stopped
command: ["redis-server", "--notify-keyspace-events", "Kx", "--appendonly", "yes"]
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 10
mongodb:
image: mongo:6
container_name: wingsemu-mongodb
restart: unless-stopped
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD}
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
healthcheck:
test: ["CMD", "mongosh", "--quiet", "--eval", "db.runCommand({ ping: 1 }).ok"]
interval: 15s
timeout: 10s
retries: 10
mqtt:
image: emqx/emqx:latest
container_name: wingsemu-mqtt
restart: unless-stopped
ports:
- "1883:1883"
- "18083:18083"
healthcheck:
test: ["CMD-SHELL", "emqx ctl status | grep -q 'is started'"]
interval: 15s
timeout: 10s
retries: 10
volumes:
postgres_data:
redis_data:
mongodb_data: