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:
+38
-9
@@ -1,18 +1,47 @@
|
||||
# run:: docker compose -p memos -f ./memos/local.stack.yml up -d
|
||||
# run:: docker compose -p memos --env-file ./memos/env.cfg --env-file ./memos/db-local.cnf -f ./memos/local.stack.yml up -d
|
||||
|
||||
services:
|
||||
memos:
|
||||
image: neosmemo/memos:0.20.0
|
||||
#command: '--driver mysql --dsn root:Kevin%0412%Mysql@tcp(10.10.13.233:3306)/memos-db'
|
||||
image: ${IMAGE_TAG}
|
||||
volumes:
|
||||
- data:/var/opt/memos
|
||||
- ${Volumes_Path}/data:/var/opt/memos
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- '8230:5230'
|
||||
container_name: memos
|
||||
- "8230:5230"
|
||||
container_name: memos_local
|
||||
restart: always
|
||||
environment:
|
||||
- MEMOS_DRIVER=postgres
|
||||
- MEMOS_DSN=postgresql://postgres:Kevin0412PgSql@192.168.100.184:5432/memos-db?sslmode=disable
|
||||
- MEMOS_DRIVER=${DB_DRIVER}
|
||||
- MEMOS_DSN=user=${DB_USER} password=${DB_PASSWORD} dbname=${DB_DATANAME} host=${DB_HOST} port=${DB_POST} sslmode=disable
|
||||
- TZ=Asia/Shanghai
|
||||
|
||||
pgsql:
|
||||
image: ${PGSQL_IMAGE_TAG:-postgres:18.4}
|
||||
container_name: memos_local_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:
|
||||
- "${PGSQL_PORT:-15432}:5432"
|
||||
healthcheck:
|
||||
test:
|
||||
[
|
||||
"CMD-SHELL",
|
||||
"pg_isready -U ${DB_USER:-postgres} -d ${DB_DATANAME:-memos-db}",
|
||||
]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
volumes:
|
||||
data:
|
||||
pgsql_data:
|
||||
|
||||
Reference in New Issue
Block a user