version: '3.9' services: dovecot: build: context: . dockerfile: dovecot/Dockerfile image: mailstack_dovecot:latest container_name: mailstack-dovecot ports: - "1143:143" - "1993:993" volumes: - vmail:/var/mail/vhosts - ./hosts:/etc/hosts:ro networks: - mailstack postfix: build: context: . dockerfile: postfix/Dockerfile image: mailstack_postfix:latest container_name: mailstack-postfix ports: - "1025:25" - "1587:587" - "1465:465" volumes: - vmail:/var/mail/vhosts - ./hosts:/etc/hosts:ro networks: - mailstack depends_on: - dovecot volumes: vmail: networks: mailstack: driver: bridge