docker-compose.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. services:
  2. app:
  3. build:
  4. context: .
  5. container_name: mailhub-app
  6. restart: unless-stopped
  7. env_file:
  8. - .env
  9. environment:
  10. PORT: 3000
  11. DATA_DIR: /data
  12. ports:
  13. - "127.0.0.1:${APP_PORT:-3025}:3000"
  14. - "${SUBMISSION_BIND:-0.0.0.0}:25:25"
  15. - "${SUBMISSION_BIND:-0.0.0.0}:465:465"
  16. - "${SUBMISSION_BIND:-0.0.0.0}:587:587"
  17. - "${SUBMISSION_BIND:-0.0.0.0}:${SUBMISSION_ALT_PORT:-2525}:2525"
  18. volumes:
  19. - ./data:/data
  20. - ./certs:/certs:ro
  21. depends_on:
  22. postfix:
  23. condition: service_started
  24. healthcheck:
  25. test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:3000/healthz').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"]
  26. interval: 30s
  27. timeout: 5s
  28. retries: 3
  29. start_period: 15s
  30. postfix:
  31. build:
  32. context: ./docker/postfix
  33. container_name: mailhub-postfix
  34. restart: unless-stopped
  35. env_file:
  36. - .env
  37. hostname: ${MAIL_HOSTNAME:-ali.ss5.xyz}
  38. healthcheck:
  39. test: ["CMD-SHELL", "postfix status >/dev/null 2>&1 || exit 1"]
  40. interval: 30s
  41. timeout: 5s
  42. retries: 3
  43. start_period: 20s