hyapp-server/docker-compose.yml
2026-04-25 01:18:30 +08:00

133 lines
3.2 KiB
YAML

services:
gateway-service:
build:
context: .
dockerfile: services/gateway-service/Dockerfile
container_name: gateway-service
ports:
- "13000:13000"
depends_on:
room-service:
condition: service_started
healthcheck:
test: ["CMD-SHELL", "wget -q -O - http://127.0.0.1:13000/healthz/ready >/dev/null"]
interval: 5s
timeout: 3s
retries: 20
start_period: 10s
room-service:
build:
context: .
dockerfile: services/room-service/Dockerfile
container_name: room-service
ports:
- "13001:13001"
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
wallet-service:
condition: service_started
im-service:
condition: service_started
healthcheck:
test: ["CMD-SHELL", "/app/grpc-health-probe -addr=127.0.0.1:13001 -service=room-service"]
interval: 5s
timeout: 3s
retries: 20
start_period: 10s
im-service:
build:
context: .
dockerfile: services/im-service/Dockerfile
container_name: im-service
stop_signal: SIGTERM
stop_grace_period: 45s
ports:
- "13002:13002"
- "13003:13003"
healthcheck:
test: ["CMD-SHELL", "wget -q -O - http://127.0.0.1:13002/healthz/ready >/dev/null"]
interval: 5s
timeout: 3s
retries: 20
start_period: 10s
wallet-service:
build:
context: .
dockerfile: services/wallet-service/Dockerfile
container_name: wallet-service
ports:
- "13004:13004"
healthcheck:
test: ["CMD-SHELL", "/app/grpc-health-probe -addr=127.0.0.1:13004 -service=wallet-service"]
interval: 5s
timeout: 3s
retries: 20
start_period: 10s
user-service:
build:
context: .
dockerfile: services/user-service/Dockerfile
container_name: user-service
ports:
- "13005:13005"
healthcheck:
test: ["CMD-SHELL", "/app/grpc-health-probe -addr=127.0.0.1:13005 -service=user-service"]
interval: 5s
timeout: 3s
retries: 20
start_period: 10s
activity-service:
build:
context: .
dockerfile: services/activity-service/Dockerfile
container_name: activity-service
ports:
- "13006:13006"
healthcheck:
test: ["CMD-SHELL", "/app/grpc-health-probe -addr=127.0.0.1:13006 -service=activity-service"]
interval: 5s
timeout: 3s
retries: 20
start_period: 10s
mysql:
image: mysql:8.4
container_name: hyapp-mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: hyapp_room
MYSQL_USER: hyapp
MYSQL_PASSWORD: hyapp
ports:
- "13306:3306"
volumes:
- mysql-data:/var/lib/mysql
- ./services/room-service/deploy/mysql/initdb:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -uroot -proot --silent"]
interval: 5s
timeout: 3s
retries: 30
redis:
image: redis:7.4-alpine
container_name: hyapp-redis
ports:
- "13379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 30
volumes:
mysql-data: