Files
cultivation-world-simulator/docker-compose.yml
2026-02-06 23:48:22 +08:00

57 lines
1.3 KiB
YAML

services:
# 后端服务
backend:
build:
context: .
dockerfile: deploy/Dockerfile.backend
container_name: cultivation-backend
ports:
- "8002:8002"
environment:
- PYTHONUNBUFFERED=1
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8002/api/state"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
volumes:
- ./assets/saves:/app/assets/saves
- ./logs:/app/logs
# 前端服务
frontend:
build:
context: .
dockerfile: deploy/Dockerfile.frontend
container_name: cultivation-frontend
ports:
- "8123:80"
depends_on:
- backend
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:80/"]
interval: 30s
timeout: 10s
retries: 3
# 全栈服务
all:
build:
context: .
dockerfile: deploy/Dockerfile.all
container_name: cultivation-all
ports:
- "8002:8002"
- "8123:80"
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8002/api/state"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
volumes:
- ./data/saves:/app/assets/saves
- ./data/logs:/app/logs