# Docker Compose file for running paperless testing with actual Gotenberg
# and Tika containers for a more end to end test of the Tika related functionality
# Can be used locally or by the CI to start the necessary containers with the
# correct networking for the tests
services:
  gotenberg:
    image: docker.io/gotenberg/gotenberg:8.27
    hostname: gotenberg
    container_name: gotenberg
    network_mode: host
    restart: unless-stopped
    # The gotenberg chromium route is used to convert .eml files. We do not
    # want to allow external content like tracking pixels or even javascript.
    command:
      - "gotenberg"
      - "--chromium-disable-javascript=true"
      - "--chromium-allow-list=file:///tmp/.*"
      - "--log-level=warn"
      - "--log-format=text"
  tika:
    image: docker.io/apache/tika:latest
    hostname: tika
    container_name: tika
    network_mode: host
    restart: unless-stopped
  greenmail:
    image: greenmail/standalone:2.1.8
    hostname: greenmail
    container_name: greenmail
    environment:
      # Enable only IMAP for now (SMTP available via 3025 if needed later)
      GREENMAIL_OPTS: >-
        -Dgreenmail.setup.test.imap -Dgreenmail.users=test@localhost:test -Dgreenmail.users.login=test@localhost -Dgreenmail.verbose
    ports:
      - "3143:3143" # IMAP
    restart: unless-stopped
  nginx:
    image: docker.io/nginx:1.29.5-alpine
    hostname: nginx
    container_name: nginx
    ports:
      - "8080:8080"
    restart: unless-stopped
    volumes:
      - ../../docs/assets:/usr/share/nginx/html/assets:ro
      - ./test-nginx.conf:/etc/nginx/conf.d/default.conf:ro
