version: '3.8'

services:
  postgres:
    image: postgres:14
    environment:
      POSTGRES_DB: email_organizer_dev
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: password
    ports:
      - "5432:5432"
    tmpfs:
      - /var/lib/postgresql/data
    command: >
      postgres -c log_statement=all

  imap:
    image: dovecot/dovecot:2.3-latest
    ports:
      - "5143:143"
      - "31143:31143"
    volumes:
      # Mount a volume to persist email data during development
      - ./tmp/imap-data:/srv/mail
      # Mount configuration overrides
      - ./dovecot-conf/conf.d:/etc/dovecot/conf.d
      - ./dovecot-conf/users:/etc/dovecot/users
      - ./dovecot-conf/dovecot.conf:/etc/dovecot/dovecot.conf
    environment: {}
    tmpfs:
      - /tmp
      - /run
    user: "0:0"
