| 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 |
emanuelegori / Memos With PostgreSQL
Last active 3 months ago
Open Source, Self-hosted, Your Notes, Your Way