docker-compose.yml
· 997 B · YAML
Eredeti
services:
db:
image: postgres:16
container_name: memos-db
hostname: memos-db
environment:
POSTGRES_DB: memos
POSTGRES_USER: memosuser
POSTGRES_PASSWORD: memospass
volumes:
- ./postgres_data:/var/lib/postgresql/data:rw
healthcheck:
test: ["CMD", "pg_isready", "-d", "memos", "-U", "memosuser"]
interval: 10s
timeout: 5s
retries: 5
restart: on-failure:3
memos:
image: ghcr.io/usememos/memos:latest
container_name: memos
hostname: memos
ports:
- "5230:5230"
environment:
MEMOS_DRIVER: postgres
MEMOS_DSN: "postgresql://memosuser:memospass@memos-db:5432/memos?sslmode=disable"
volumes:
- ./data:/var/opt/memos:rw
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:5230/ || exit 1"]
interval: 30s
timeout: 10s
retries: 3
restart: on-failure:3
| 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 | - "5230: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 |
| 39 |