Run Jolimail and Catapulte with docker - jdrouet/jolimail GitHub Wiki

As seen in Run Jolimail with docker, it's quite simple to start Jolimail. Now, if we want to start the whole pipeline to test it, it should be done with the following compose file.

version: "2.4"
services:
  # this is a mock of SMTP server for our example
  smtp:
    image: reachfive/fake-smtp-server
    networks:
      - catapulte
    ports:
      - 1080:1080

  catapulte:
    image: jdrouet/catapulte:latest
    environment:
      RUST_LOG: info
      SMTP_HOSTNAME: smtp
      SMTP_PORT: 1025
      TEMPLATE_PROVIDER: jolimail
      TEMPLATE_PROVIDER_JOLIMAIL_BASE_URL: http://jolimail:3000
    depends_on:
      - jolimail
      - smtp
    networks:
      - catapulte
      - common
    ports:
      - 3010:3000

  database:
    image: postgres:13-alpine
    environment:
      - POSTGRES_DB=jolimail
      - POSTGRES_USER=jolimail
      - POSTGRES_PASSWORD=random_password
    volumes:
      - /where/you/want/to/store/the/data:/var/lib/postgresql/data
    networks:
      - jolimail
    restart: unless-stopped

  jolimail:
    image: jdrouet/jolimail:latest
    environment:
      - DATABASE_HOST=database
      - DATABASE_USER=jolimail
      - DATABASE_DBNAME=jolimail
      - DATABASE_PASSWORD=random_password
      # this is the base URL of catapulte used in the examples
      - EXAMPLE_CATAPULTE_BASE_URL=http://localhost:3010
      # you can adjust the logs with info, debug, warn, error
      - RUST_LOG=info
    depends_on:
      - database
    networks:
      - jolimail
      - common
    ports:
      - 3000:3000
    restart: unless-stopped

networks:
  jolimail: {}
  catapulte: {}
  common: {}

And by running docker-compose up you should be able to access Jolimail and the SMTP mock.