Files
baiyue-firstleg/docker-compose-infra.yml
T

74 lines
1.8 KiB
YAML
Raw Normal View History

2026-07-30 18:01:36 +08:00
name: baiyue-infra
services:
nacos:
image: nacos/nacos-server:v2.3.2
container_name: baiyue-nacos
environment:
MODE: standalone
PREFER_HOST_MODE: hostname
NACOS_AUTH_ENABLE: "false"
JVM_XMS: 256m
JVM_XMX: 512m
JVM_XMN: 128m
ports:
- "8848:8848"
- "9848:9848"
- "9849:9849"
healthcheck:
test: ["CMD", "curl", "-fsS", "http://localhost:8848/nacos/v1/console/health/readiness"]
interval: 10s
timeout: 5s
retries: 20
start_period: 30s
restart: unless-stopped
networks: [baiyue]
mysql:
image: mysql:8.0.39
container_name: baiyue-mysql
profiles: [database]
environment:
TZ: Asia/Shanghai
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-change-me-before-use}
MYSQL_DATABASE: ${MYSQL_DATABASE:-baiyue}
MYSQL_USER: ${MYSQL_USER:-baiyue}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-change-me-before-use}
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_0900_ai_ci
- --default-time-zone=+08:00
ports: ["3306:3306"]
volumes: [baiyue-mysql-data:/var/lib/mysql]
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -u root -p$$MYSQL_ROOT_PASSWORD --silent"]
interval: 10s
timeout: 5s
retries: 20
start_period: 30s
restart: unless-stopped
networks: [baiyue]
redis:
image: redis:7.2.5-alpine
container_name: baiyue-redis
profiles: [cache]
command: ["redis-server", "--appendonly", "yes"]
ports: ["6379:6379"]
volumes: [baiyue-redis-data:/data]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 10
restart: unless-stopped
networks: [baiyue]
volumes:
baiyue-mysql-data:
baiyue-redis-data:
networks:
baiyue:
name: baiyue-network