version: "3.9"

services:
  backend:
    image: ghcr.io/leonmuscoden/letterfeed-backend:latest
    restart: unless-stopped
    environment:
      LETTERFEED_APP_BASE_URL: ${LETTERFEED_APP_BASE_URL}
      LETTERFEED_BACKEND_URL: ${LETTERFEED_BACKEND_URL}
      LETTERFEED_DATABASE_URL: ${LETTERFEED_DATABASE_URL}
      LETTERFEED_IMAP_SERVER: ${LETTERFEED_IMAP_SERVER}
      LETTERFEED_IMAP_USERNAME: ${LETTERFEED_IMAP_USERNAME}
      LETTERFEED_IMAP_PASSWORD: ${LETTERFEED_IMAP_PASSWORD}
      LETTERFEED_SEARCH_FOLDER: ${LETTERFEED_SEARCH_FOLDER}
      LETTERFEED_MOVE_TO_FOLDER: ${LETTERFEED_MOVE_TO_FOLDER}
      LETTERFEED_MARK_AS_READ: ${LETTERFEED_MARK_AS_READ}
      LETTERFEED_EMAIL_CHECK_INTERVAL: ${LETTERFEED_EMAIL_CHECK_INTERVAL}
      LETTERFEED_AUTO_ADD_NEW_SENDERS: ${LETTERFEED_AUTO_ADD_NEW_SENDERS}
      LETTERFEED_SECRET_KEY: ${LETTERFEED_SECRET_KEY}
      LETTERFEED_AUTH_USERNAME: ${LETTERFEED_AUTH_USERNAME}
      LETTERFEED_AUTH_PASSWORD: ${LETTERFEED_AUTH_PASSWORD}
    volumes:
      - letterfeed_data:/data

  frontend:
    image: ghcr.io/leonmuscoden/letterfeed-frontend:latest
    restart: unless-stopped
    environment:
      LETTERFEED_APP_BASE_URL: ${LETTERFEED_APP_BASE_URL}
      LETTERFEED_BACKEND_URL: ${LETTERFEED_BACKEND_URL}
    expose:
      - 3000
    depends_on:
      - backend

volumes:
  letterfeed_data:
