up(dbSer): mysql && postgres

This commit is contained in:
cnphpbb 2025-01-26 04:02:30 +08:00
parent ae13fec097
commit d860760bfc
5 changed files with 17 additions and 9 deletions

View File

@ -1 +1,5 @@
IMAGE_TAG=mysql:8.3.0
IMAGE_TAG=mysql:8.4.4
IMAGE_TAG_V9=mysql:9.2.0
IMAGE_TAG_V8=mysql:8.0.41
IMAGE_TAG_LTS=mysql:8.4.4
MYSQL_ROOT_PASSWORD=Kevin%0412%Mysql

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

@ -1,5 +1,6 @@
#IMAGE_TAG=postgres:14.11-bookworm
#IMAGE_TAG=postgres:15.6-bookworm
IMAGE_TAG=postgres:16.2-bookworm
IMAGE_TAG=postgres:16.6
IMAGE_TAG_V17=postgres:17.2
POSTGRES_PASSWORD=Kevin0412PgSql
POSTGRES_HOST_AUTH_METHOD=scram-sha-256

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}