-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdocker-compose.local-email.yml
More file actions
127 lines (122 loc) · 3.97 KB
/
docker-compose.local-email.yml
File metadata and controls
127 lines (122 loc) · 3.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
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
PGPORT: "5432"
PGUSER: ${PGUSER:-postgres}
PGPASSWORD: ${PGPASSWORD:-password}
PGDATABASE: constructive
# API configuration
API_ENABLE_SERVICES: "true"
API_IS_PUBLIC: "false"
API_EXPOSED_SCHEMAS: "metaschema_public,services_public,constructive_auth_public"
API_META_SCHEMAS: "metaschema_public,services_public,metaschema_modules_public,constructive_auth_public"
API_ANON_ROLE: "administrator"
API_ROLE_NAME: "administrator"
ports:
- "3002:3000"
networks:
- constructive-net
# Send email link function (uses SMTP to Mailpit)
send-email-link:
container_name: send-email-link
image: constructive:dev
entrypoint: ["node", "functions/send-email-link/dist/index.js"]
depends_on:
- mailpit
- constructive-admin-server
environment:
NODE_ENV: development
PORT: "8080"
LOG_LEVEL: info
# GraphQL endpoints
GRAPHQL_URL: "http://constructive-admin-server:3000/graphql"
META_GRAPHQL_URL: "http://constructive-admin-server:3000/graphql"
GRAPHQL_API_NAME: "private"
# SMTP configuration (Mailpit)
EMAIL_SEND_USE_SMTP: "true"
SMTP_HOST: mailpit
SMTP_PORT: "1025"
SMTP_FROM: "noreply@localhost"
# Local app port for email links
LOCAL_APP_PORT: "3011"
ALLOW_LOCALHOST: "true"
SEND_EMAIL_LINK_DRY_RUN: "false"
ports:
- "8082:8080"
networks:
- constructive-net
# Job service (polls app_jobs, triggers send-email-link)
knative-job-service:
container_name: knative-job-service
image: constructive:dev
entrypoint: ["node", "jobs/knative-job-service/dist/run.js"]
depends_on:
- send-email-link
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
NODE_ENV: development
# Postgres - use host.docker.internal to connect to local postgres
PGHOST: host.docker.internal
PGPORT: "5432"
PGUSER: ${PGUSER:-postgres}
PGPASSWORD: ${PGPASSWORD:-password}
PGDATABASE: constructive
JOBS_SCHEMA: app_jobs
# Worker config
JOBS_SUPPORT_ANY: "true"
JOBS_SUPPORTED: "send-email-link"
HOSTNAME: "local-worker"
# Callback server
INTERNAL_JOBS_CALLBACK_PORT: "8080"
INTERNAL_JOBS_CALLBACK_URL: "http://knative-job-service:8080/callback"
JOBS_CALLBACK_HOST: "knative-job-service"
# Function gateway
INTERNAL_GATEWAY_URL: "http://send-email-link:8080"
INTERNAL_GATEWAY_DEVELOPMENT_MAP: '{"send-email-link":"http://send-email-link:8080"}'
ports:
- "8080:8080"
networks:
- constructive-net
networks:
constructive-net:
external: true
name: constructive-net