feat: mysql 自定义初始化

This commit is contained in:
Tim
2025-09-29 19:26:02 +08:00
parent 0cf8113691
commit 35c503eb6c
6 changed files with 140 additions and 94 deletions

View File

@@ -11,6 +11,10 @@ services:
volumes:
- mysql-data:/var/lib/mysql
- ../backend/src/main/resources/db/init:/docker-entrypoint-initdb.d
command: >
--character-set-server=utf8mb4
--collation-server=utf8mb4_0900_ai_ci
--default-time-zone=+80:00
networks:
- openisle-network
healthcheck:
@@ -236,37 +240,50 @@ services:
image: alpine/socat
container_name: loopback-8080
# 监听“frontend_dev 容器自身的” 127.0.0.1:8080 → 转发到 springboot:8080
command: ["-d","-d","-ly","TCP4-LISTEN:8080,bind=127.0.0.1,reuseaddr,fork","TCP4:springboot:8080"]
command:
[
"-d",
"-d",
"-ly",
"TCP4-LISTEN:8080,bind=127.0.0.1,reuseaddr,fork",
"TCP4:springboot:8080",
]
depends_on:
springboot:
condition: service_started
network_mode: "service:frontend_dev"
profiles: ["dev"]
healthcheck:
test: ["CMD","sh","-c","nc -z 127.0.0.1 8080"]
test: ["CMD", "sh", "-c", "nc -z 127.0.0.1 8080"]
interval: 5s
timeout: 3s
retries: 20
start_period: 10s
loopback_8082:
image: alpine/socat
container_name: loopback-8082
# 监听 127.0.0.1:8082 → 转发到 websocket-service:8082WS 纯 TCP 可直接过)
command: ["-d","-d","-ly","TCP4-LISTEN:8082,bind=127.0.0.1,reuseaddr,fork","TCP4:websocket-service:8082"]
command:
[
"-d",
"-d",
"-ly",
"TCP4-LISTEN:8082,bind=127.0.0.1,reuseaddr,fork",
"TCP4:websocket-service:8082",
]
depends_on:
websocket-service:
condition: service_started
network_mode: "service:frontend_dev"
profiles: ["dev"]
healthcheck:
test: ["CMD","sh","-c","nc -z 127.0.0.1 8082"]
test: ["CMD", "sh", "-c", "nc -z 127.0.0.1 8082"]
interval: 5s
timeout: 3s
retries: 20
start_period: 10s
networks:
openisle-network:
driver: bridge