lawless/docker-compose.wsl.yml

83 行
1.9 KiB
YAML

name: honghuang
# 《洪荒大陆》WSL 部署配置
# 使用 WSL 上已有的 Docker 镜像
#
# 用法:
# docker compose -f docker-compose.wsl.yml -p lawless up -d
services:
# PostgreSQL 16使用已有基础镜像构建
postgres:
container_name: honghuang-postgres
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: nakama
volumes:
- postgres_data:/var/lib/postgresql/data
- ./database/migrations:/docker-entrypoint-initdb.d:ro
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d nakama"]
interval: 5s
timeout: 5s
retries: 10
networks:
- honghuang-net
# Redis使用已有镜像,兼容 Valkey
valkey:
container_name: honghuang-valkey
image: redis:7.4-alpine
restart: unless-stopped
volumes:
- valkey_data:/data
ports:
- "16380:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
networks:
- honghuang-net
# Nacos 2.x 配置中心
nacos:
container_name: honghuang-nacos
image: nacos/nacos-server:v2.4.3
restart: unless-stopped
environment:
MODE: standalone
SPRING_DATASOURCE_PLATFORM: ""
NACOS_AUTH_ENABLE: "false"
NACOS_CORE_AUTH_ENABLED: "false"
MYSQL_SERVICE_HOST: ""
MYSQL_SERVICE_DB_NAME: ""
MYSQL_SERVICE_USER: ""
MYSQL_SERVICE_PASSWORD: ""
volumes:
- nacos_data:/home/nacos/data
ports:
- "8848:8848"
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:8848/nacos/v1/console/health/readiness || exit 1"]
interval: 5s
timeout: 5s
retries: 30
networks:
- honghuang-net
volumes:
postgres_data:
valkey_data:
nacos_data:
networks:
honghuang-net:
driver: bridge