id: mailpit
category: service
displayName: Mailpit
description: 'SMTP catcher for local dev, so apps send mail to it and nothing leaves the machine. SMTP on `mailpit:1025`; web UI + API on 8025, reachable from the host via `monoceros tunnel <name> mailpit:8025` and from another device via `monoceros share`.'
service:
  image: axllent/mailpit:latest
  defaultPort: 1025
  # 8025, not the defaultPort: 1025 is SMTP, which is what the app dials and
  # what nobody opens in a browser. The web inbox is the part worth reaching.
  httpPort: 8025
  healthcheck:
    # Mailpit ships its own readiness probe in the image — no curl/wget needed.
    test: [CMD, /mailpit, readyz]
    interval: 15s
    timeout: 5s
    retries: 5
  connectionEnv:
    URL: smtp://${host}:${port}
    HOST: ${host}
    PORT: ${port}
# The service block for the project's pipeline compose file, verbatim.
deploy:
  compose: |-
    image: axllent/mailpit:latest
    # Test runs only. Mailpit catches mail so nothing leaves the machine, which
    # is what integration tests want and what an environment with real users
    # must never have. There, the app sends through a real mail service.
    healthcheck:
      test: [CMD, /mailpit, readyz]
      interval: 5s
      timeout: 5s
      retries: 20
    # No volume: caught mail is test output, not data.
