From c06984a268e803b60bf68af2db1fa485b28a0431 Mon Sep 17 00:00:00 2001 From: cnphpbb Date: Fri, 19 Jun 2026 16:40:45 +0800 Subject: [PATCH] fix(memos): correct postgres volume and env setup --- memos/env.cfg.example | 2 +- memos/local.stack.yml | 3 ++- memos/prod.stack.yml | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/memos/env.cfg.example b/memos/env.cfg.example index ebd525a..507b9e9 100644 --- a/memos/env.cfg.example +++ b/memos/env.cfg.example @@ -17,5 +17,5 @@ PGSQL_IMAGE_TAG=postgres:18.4 # ---------- 数据卷 ---------- # 宿主机持久化目录,会挂载到容器 /var/opt/memos -# 部署前手动创建:mkdir -pv /data/volumes/memos/data +# 部署前手动创建:mkdir -pv /data/volumes/memos/{data,pgsql_data} Volumes_Path=/data/volumes/memos diff --git a/memos/local.stack.yml b/memos/local.stack.yml index f850ec9..69aedcc 100644 --- a/memos/local.stack.yml +++ b/memos/local.stack.yml @@ -28,11 +28,12 @@ services: - POSTGRES_HOST_AUTH_METHOD=scram-sha-256 - TZ=Asia/Shanghai volumes: + # Postgres 数据持久化(具名卷 pgsql_data) - pgsql_data:/var/lib/postgresql/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro ports: - - "${PGSQL_PORT:-15432}:5432" + - "${DB_POST:-15432}:5432" healthcheck: test: [ diff --git a/memos/prod.stack.yml b/memos/prod.stack.yml index 7005d5f..71c1970 100644 --- a/memos/prod.stack.yml +++ b/memos/prod.stack.yml @@ -2,7 +2,7 @@ # 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-lkc:: docker compose -p memos --env-file ./memos/env.cfg --env-file ./memos/db-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: @@ -36,7 +36,7 @@ services: - POSTGRES_HOST_AUTH_METHOD=scram-sha-256 - TZ=Asia/Shanghai volumes: - - pgsql_data:/var/lib/postgresql/data + - ${Volumes_Path}/pgsql_data:/var/lib/postgresql/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro ports: