emanuelegori 修订了这个 Gist . 转到此修订
没有任何变更
emanuelegori 修订了这个 Gist . 转到此修订
1 file changed, 1 insertion, 1 deletion
docker-compose.yml
@@ -21,7 +21,7 @@ services: | |||
21 | 21 | container_name: memos | |
22 | 22 | hostname: memos | |
23 | 23 | ports: | |
24 | - | - "5240:5230" | |
24 | + | - "5230:5230" | |
25 | 25 | environment: | |
26 | 26 | MEMOS_DRIVER: postgres | |
27 | 27 | MEMOS_DSN: "postgresql://memosuser:memospass@memos-db:5432/memos?sslmode=disable" |
emanuelegori 修订了这个 Gist . 转到此修订
没有任何变更
emanuelegori 修订了这个 Gist . 转到此修订
1 file changed, 38 insertions
docker-compose.yml(文件已创建)
@@ -0,0 +1,38 @@ | |||
1 | + | services: | |
2 | + | db: | |
3 | + | image: postgres:16 | |
4 | + | container_name: memos-db | |
5 | + | hostname: memos-db | |
6 | + | environment: | |
7 | + | POSTGRES_DB: memos | |
8 | + | POSTGRES_USER: memosuser | |
9 | + | POSTGRES_PASSWORD: memospass | |
10 | + | volumes: | |
11 | + | - ./postgres_data:/var/lib/postgresql/data:rw | |
12 | + | healthcheck: | |
13 | + | test: ["CMD", "pg_isready", "-d", "memos", "-U", "memosuser"] | |
14 | + | interval: 10s | |
15 | + | timeout: 5s | |
16 | + | retries: 5 | |
17 | + | restart: on-failure:3 | |
18 | + | ||
19 | + | memos: | |
20 | + | image: ghcr.io/usememos/memos:latest | |
21 | + | container_name: memos | |
22 | + | hostname: memos | |
23 | + | ports: | |
24 | + | - "5240:5230" | |
25 | + | environment: | |
26 | + | MEMOS_DRIVER: postgres | |
27 | + | MEMOS_DSN: "postgresql://memosuser:memospass@memos-db:5432/memos?sslmode=disable" | |
28 | + | volumes: | |
29 | + | - ./data:/var/opt/memos:rw | |
30 | + | depends_on: | |
31 | + | db: | |
32 | + | condition: service_healthy | |
33 | + | healthcheck: | |
34 | + | test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:5230/ || exit 1"] | |
35 | + | interval: 30s | |
36 | + | timeout: 10s | |
37 | + | retries: 3 | |
38 | + | restart: on-failure:3 |