-
Notifications
You must be signed in to change notification settings - Fork 6
add local email service docker compse #888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,127 @@ | ||||||||||
| # Local Email Services for Development | ||||||||||
| # | ||||||||||
| # Usage: | ||||||||||
| # docker-compose -f docker-compose.local-email.yml up -d | ||||||||||
| # | ||||||||||
| # Services: | ||||||||||
| # - mailpit (SMTP: 1025, Web UI: 8025) | ||||||||||
| # - constructive-admin-server (3002) | ||||||||||
| # - send-email-link (8082) | ||||||||||
| # - knative-job-service (8080) | ||||||||||
| # | ||||||||||
| # Prerequisites: | ||||||||||
| # - PostgreSQL running with constructive database | ||||||||||
| # - Network: constructive-net (created by docker-compose.yml) | ||||||||||
| # - Build image first: docker build -t constructive:dev . | ||||||||||
|
|
||||||||||
| services: | ||||||||||
| # Mailpit - Local email testing (replaces Mailgun) | ||||||||||
| mailpit: | ||||||||||
| container_name: mailpit | ||||||||||
| image: axllent/mailpit:latest | ||||||||||
| ports: | ||||||||||
| - "1025:1025" # SMTP | ||||||||||
| - "8025:8025" # Web UI | ||||||||||
| networks: | ||||||||||
| - constructive-net | ||||||||||
|
|
||||||||||
| # Admin GraphQL Server (internal, header-based routing) | ||||||||||
| constructive-admin-server: | ||||||||||
| container_name: constructive-admin-server | ||||||||||
| image: constructive:dev | ||||||||||
| entrypoint: ["constructive", "server", "--host", "0.0.0.0", "--port", "3000", "--origin", "*"] | ||||||||||
| extra_hosts: | ||||||||||
| - "host.docker.internal:host-gateway" | ||||||||||
| environment: | ||||||||||
| NODE_ENV: development | ||||||||||
| PORT: "3000" | ||||||||||
| SERVER_HOST: "0.0.0.0" | ||||||||||
| SERVER_TRUST_PROXY: "true" | ||||||||||
| SERVER_ORIGIN: "*" | ||||||||||
| SERVER_STRICT_AUTH: "false" | ||||||||||
| # Postgres - use host.docker.internal to connect to local postgres | ||||||||||
| PGHOST: host.docker.internal | ||||||||||
|
Comment on lines
+42
to
+43
|
||||||||||
| # Postgres - use host.docker.internal to connect to local postgres | |
| PGHOST: host.docker.internal | |
| # Postgres - use postgres service on constructive-net | |
| PGHOST: postgres |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added extra_hosts: ["host.docker.internal:host-gateway"] to support Linux Docker Engine.
macOS/Windows Docker Desktop will ignore this setting (already has built-in support), so no impact on existing usage.
Copilot
AI
Mar 25, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue as above: PGHOST: host.docker.internal can break on Linux and is inconsistent with the docker-compose.yml Postgres container workflow. Consider using PGHOST=postgres when relying on the shared constructive-net, or add an extra_hosts mapping for host.docker.internal if connecting to host Postgres is intentional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added extra_hosts: ["host.docker.internal:host-gateway"] to support Linux Docker Engine.
macOS/Windows Docker Desktop will ignore this setting (already has built-in support), so no impact on existing usage.
Copilot
AI
Mar 25, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JOBS_SUPPORT_ANY is set to "true" while JOBS_SUPPORTED is also set. When JOBS_SUPPORT_ANY is true, the knative job worker/scheduler will poll for and attempt to execute all task identifiers in app_jobs (ignoring the supported list), which can cause repeated failures if other job types exist. Set JOBS_SUPPORT_ANY to "false" here to ensure only send-email-link is processed (matching the intent of this compose file).
| JOBS_SUPPORT_ANY: "true" | |
| JOBS_SUPPORT_ANY: "false" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding JOBS_SUPPORT_ANY = true:
Keeping it as true is intentional for extensibility. When adding new job services in the future (e.g., send-sms), we only need to update INTERNAL_GATEWAY_DEVELOPMENT_MAP - no need to maintain two separate configs.
If an unconfigured job type appears in app_jobs, the error serves as a reminder to add the gateway mapping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This compose file pins
container_nameforconstructive-admin-server(and alsosend-email-link/knative-job-servicebelow). Because these names are also used indocker-compose.jobs.yml, running both stacks (or reusing containers across projects) will fail with container-name conflicts. Consider removingcontainer_nameso Compose can namespace by project, or prefix these names (e.g.,local-email-...) and update internal URLs accordingly.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added extra_hosts: ["host.docker.internal:host-gateway"] to support Linux Docker Engine.
macOS/Windows Docker Desktop will ignore this setting (already has built-in support), so no impact on existing usage.