version: "3.7"

services:
  joplin:
    image: joplin/server:latest
    container_name: joplin-server
    restart: always
    environment:
      - APP_PORT=8030
      - APP_BASE_URL=https://server.joplin.adamoutler.com
      - DB_CLIENT=sqlite3
      - DB_FILE=/var/lib/joplin/database.sqlite
    ports:
      - "8030:8030"
    volumes:
      - data:/var/lib/joplin
    networks:
      - joplin-net
  joplin-vieweb:
    image: gri38/django-joplin-vieweb # Check Docker Hub for the image name/tags
    ports:
      - "8088:8000" # Or your preferred host port
    environment:
      # *** Points to your Joplin Server instance ***
      - JOPLIN_URL=https://server.joplin adamoutler.com # Use service name if on same Docker network
      # Or use http://your_server_ip_or_domain:22300 if accessing externally/differently

      # Optional: Set login credentials if your server requires it
      # (Check joplin-vieweb docs for exact env var names if needed)
      # - JOPLIN_USERNAME=your_joplin_user_email
      # - JOPLIN_PASSWORD=your_joplin_user_password

      # Optional: Set vieweb specific port if needed inside container (usually defaults ok)
      # - PORT=8088

      # Optional: Require login to vieweb itself (check docs for JOPLIN_LOGIN_REQUIRED or similar)
      # - JOPLIN_LOGIN_REQUIRED=true # or false/unset
    networks:
      - joplin-net
  joplin-terminal-xapi:
    image: gri38/joplin-terminal-xapi:latest
    restart: unless-stopped
    volumes:
      - joplin:/root/.config/joplin
    networks:
      - joplin-net
volumes:
  data:

networks:
  joplin_network:
    name: joplin_network