feat(docker-compose): 添加 mysql9 服务并更新卷配置

This commit is contained in:
严浩
2025-09-23 12:41:28 +08:00
parent dbf346cef3
commit 6b7b6a2f16
2 changed files with 20 additions and 3 deletions

1
.env
View File

@@ -1 +1,2 @@
TZ=Asia/Shanghai TZ=Asia/Shanghai
LANG=C.UTF-8

View File

@@ -1,7 +1,23 @@
volumes: volumes:
tmp: tmp-postgres17:
external: false
tmp-mysql9:
external: false external: false
services: services:
mysql9:
restart: unless-stopped
container_name: mysql9
environment:
MYSQL_ROOT_PASSWORD: mysqlrootpass
volumes:
- ./backups:/backups
- tmp-mysql9:/var/lib/mysql
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h', 'localhost']
interval: 5s
timeout: 10s
retries: 5
image: mysql:9
postgres17: postgres17:
container_name: postgres17 container_name: postgres17
restart: unless-stopped restart: unless-stopped
@@ -11,7 +27,7 @@ services:
- POSTGRES_DB=_ - POSTGRES_DB=_
volumes: volumes:
- ./backups:/backups:rw - ./backups:/backups:rw
- tmp:/var/lib/postgresql/data - tmp-postgres17:/var/lib/postgresql/data
image: postgres:17 image: postgres:17
healthcheck: healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]