up(dbSer): mysql && postgres

This commit is contained in:
cnphpbb
2025-01-26 04:02:30 +08:00
parent 9f14c7b797
commit d2fd111edf
3 changed files with 10 additions and 7 deletions

View File

@@ -3,19 +3,20 @@
services:
mysql:
image: mysql:8.3.0
image: ${IMAGE_TAG_LTS}
container_name: prod-mysql
restart: always
environment:
- MYSQL_ROOT_PASSWORD=Kevin%0412%Mysql
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- TZ=Asia/Shanghai
volumes:
- mysql_data:/var/lib/mysql
- mysql_logs:/var/log/mysql
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "3306:3306"
command: --default-authentication-plugin=mysql_native_password
command:
#command: --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci --default-authentication-plugin=mysql_native_password
volumes:
mysql_data:
mysql_logs:

View File

@@ -7,14 +7,15 @@ services:
image: ${IMAGE_TAG}
container_name: prod-postgre
restart: always
shm_size: 256mb
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_HOST_AUTH_METHOD=${POSTGRES_HOST_AUTH_METHOD}
- POSTGRES_INITDB_ARGS=--auth-host=${POSTGRES_HOST_AUTH_METHOD}
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- TZ=Asia/Shanghai
volumes:
- /data/volumes/postgres/data:/var/lib/postgresql/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "5432:5432"

View File

@@ -7,6 +7,7 @@ services:
image: ${IMAGE_TAG}
container_name: prod-postgre
restart: always
shm_size: 128mb
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_HOST_AUTH_METHOD=${POSTGRES_HOST_AUTH_METHOD}