# Joplin Server — data op NAS (map /volume1/docker/joplin, uid 999)
services:
  joplin:
    image: joplin/server:latest
    container_name: joplin
    restart: unless-stopped
    ports:
      - "${JOPLIN_PORT:-22300}:22300"
    environment:
      APP_PORT: 22300
      APP_BASE_URL: ${JOPLIN_BASE_URL:-http://192.168.1.211:22300}
      DB_CLIENT: pg
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-WaQTUw2t}
      POSTGRES_DATABASE: ${JOPLIN_DB:-joplin}
      POSTGRES_USER: ${POSTGRES_USER:-mo}
      POSTGRES_PORT: 5432
      POSTGRES_HOST: ${POSTGRES_HOST:-192.168.1.105}
    depends_on:
      - joplin-db

  joplin-db:
    image: postgres:16-alpine
    container_name: joplin-db
    restart: unless-stopped
    environment:
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-WaQTUw2t}
      POSTGRES_USER: ${POSTGRES_USER:-mo}
      POSTGRES_DB: ${JOPLIN_DB:-joplin}
    volumes:
      - joplin-db-data:/var/lib/postgresql/data

volumes:
  joplin-db-data:
