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: services:
mysql: mysql:
image: mysql:8.3.0 image: ${IMAGE_TAG_LTS}
container_name: prod-mysql container_name: prod-mysql
restart: always restart: always
environment: environment:
- MYSQL_ROOT_PASSWORD=Kevin%0412%Mysql - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- TZ=Asia/Shanghai - TZ=Asia/Shanghai
volumes: volumes:
- mysql_data:/var/lib/mysql - mysql_data:/var/lib/mysql
- mysql_logs:/var/log/mysql - /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports: ports:
- "3306:3306" - "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: volumes:
mysql_data: mysql_data:
mysql_logs:

View File

@ -1,5 +1,6 @@
#IMAGE_TAG=postgres:14.11-bookworm #IMAGE_TAG=postgres:14.11-bookworm
#IMAGE_TAG=postgres:15.6-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_PASSWORD=Kevin0412PgSql
POSTGRES_HOST_AUTH_METHOD=scram-sha-256 POSTGRES_HOST_AUTH_METHOD=scram-sha-256

View File

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

View File

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