forked from DevOps/deploy.stack
feat(memos): add pgsql sidecar and unify db port
- Add PostgreSQL container to local and prod stacks with healthcheck - Change external DB port from 5432 to 15432 in all env configs - Rename env-lkc.cnf to db-lkc.cnf for consistency - Add db-local.cnf for local PostgreSQL deployment
This commit is contained in:
+35
-5
@@ -1,7 +1,9 @@
|
||||
# path:: mkdir -pv /data/volumes/memos/data
|
||||
# run-61:: docker compose -p memos --env-file ./memos/env.cfg --env-file ./memos/db-61.cnf -f ./memos/prod.stack.yml up -d
|
||||
# pull:: docker compose -p memos --env-file ./memos/env.cfg -f ./memos/prod.stack.yml pull
|
||||
# run-61:: docker compose -p memos --env-file ./memos/env.cfg --env-file ./memos/db-61.cnf -f ./memos/prod.stack.yml up -d
|
||||
# run-184:: docker compose -p memos --env-file ./memos/env.cfg --env-file ./memos/db-184.cnf -f ./memos/prod.stack.yml up -d
|
||||
# run-lkc:: docker compose -p memos --env-file ./memos/env.cfg --env-file ./memos/env-lkc.cnf -f ./memos/prod.stack.yml up -d
|
||||
# run-local:: docker compose -p memos --env-file ./memos/env.cfg --env-file ./memos/db-local.cnf -f ./memos/prod.stack.yml up -d
|
||||
|
||||
services:
|
||||
memos:
|
||||
@@ -11,8 +13,8 @@ services:
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- '5230:5230'
|
||||
container_name: memos
|
||||
- "5230:5230"
|
||||
container_name: memos_app
|
||||
restart: always
|
||||
environment:
|
||||
- MEMOS_DRIVER=${DB_DRIVER}
|
||||
@@ -21,5 +23,33 @@ services:
|
||||
#- MEMOS_DRIVER=mysql
|
||||
#- MEMOS_DSN=root:password@tcp(localhost)/memos_prod
|
||||
- TZ=Asia/Shanghai
|
||||
#volumes:
|
||||
# data:
|
||||
|
||||
pgsql:
|
||||
image: ${PGSQL_IMAGE_TAG:-postgres:18.4}
|
||||
container_name: memos_pgsql
|
||||
restart: always
|
||||
shm_size: 256mb
|
||||
environment:
|
||||
- POSTGRES_USER=${DB_USER:-postgres}
|
||||
- POSTGRES_PASSWORD=${DB_PASSWORD}
|
||||
- POSTGRES_DB=${DB_DATANAME:-memos-db}
|
||||
- POSTGRES_HOST_AUTH_METHOD=scram-sha-256
|
||||
- TZ=Asia/Shanghai
|
||||
volumes:
|
||||
- pgsql_data:/var/lib/postgresql/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "${DB_POST:-15432}:5432"
|
||||
healthcheck:
|
||||
test:
|
||||
[
|
||||
"CMD-SHELL",
|
||||
"pg_isready -U ${DB_USER:-postgres} -d ${DB_DATANAME:-memos-db}",
|
||||
]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
volumes:
|
||||
pgsql_data:
|
||||
|
||||
Reference in New Issue
Block a user