From 7ddca88ef3fe988704c7e603bc92506bc0ed8cac Mon Sep 17 00:00:00 2001 From: GengY Date: Tue, 5 Mar 2024 10:22:33 +0800 Subject: [PATCH] modify(dbs-postgres): modify posrgres stack --- dev-dbs/postgres/prod.stack.yml | 20 ++++++++++++++++++++ dev-dbs/postgres/stack.yml | 20 -------------------- dev-dbs/postgres/test.stack.yml | 23 +++++++++++++++++++++++ 3 files changed, 43 insertions(+), 20 deletions(-) create mode 100644 dev-dbs/postgres/prod.stack.yml delete mode 100644 dev-dbs/postgres/stack.yml create mode 100644 dev-dbs/postgres/test.stack.yml diff --git a/dev-dbs/postgres/prod.stack.yml b/dev-dbs/postgres/prod.stack.yml new file mode 100644 index 0000000..389733c --- /dev/null +++ b/dev-dbs/postgres/prod.stack.yml @@ -0,0 +1,20 @@ +#mkdir -pv /data/volumes/postgres/data +#pull:: docker compose --env-file ./dev-dbs/postgres/env.cfg -f ./dev-dbs/postgres/prod.stack.yml pull +#run:: docker compose -p prod-dbs --env-file ./dev-dbs/postgres/env.cfg -f ./dev-dbs/postgres/prod.stack.yml up -d +services: + + postgres: + image: ${IMAGE_TAG} + container_name: prod-postgre + restart: always + 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 + ports: + - "5432:5432" \ No newline at end of file diff --git a/dev-dbs/postgres/stack.yml b/dev-dbs/postgres/stack.yml deleted file mode 100644 index b0d63b3..0000000 --- a/dev-dbs/postgres/stack.yml +++ /dev/null @@ -1,20 +0,0 @@ -#pull:: docker compose --env-file ./dev-dbs/postgres/env.cfg -f ./dev-dbs/postgres/stack.yml pull -#run:: docker compose -p dev-dbs --env-file ./dev-dbs/postgres/env.cfg -f ./dev-dbs/postgres/stack.yml up -d -services: - - postgres: - image: ${IMAGE_TAG} - container_name: Dev-postgre - restart: always - environment: - - POSTGRES_PASSWORD=Kevin0412PgSql - - POSTGRES_HOST_AUTH_METHOD=scram-sha-256 - - POSTGRES_INITDB_ARGS=--auth-host=scram-sha-256 - - TZ=Asia/Shanghai - volumes: - - postgresql_data:/var/lib/postgresql/data - ports: - - "5432:5432" - -volumes: - postgresql_data: \ No newline at end of file diff --git a/dev-dbs/postgres/test.stack.yml b/dev-dbs/postgres/test.stack.yml new file mode 100644 index 0000000..a481bc1 --- /dev/null +++ b/dev-dbs/postgres/test.stack.yml @@ -0,0 +1,23 @@ +#pull:: docker compose --env-file ./dev-dbs/postgres/env.cfg -f ./dev-dbs/postgres/test.stack.yml pull +#run:: docker compose -p test-dbs --env-file ./dev-dbs/postgres/env.cfg -f ./dev-dbs/postgres/test.stack.yml up -d + +services: + + postgres: + image: ${IMAGE_TAG} + container_name: prod-postgre + restart: always + 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:/var/lib/postgresql/data + ports: + - "5432:5432" + +volumes: + data: \ No newline at end of file