You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: jobs/DEVELOPMENT_JOBS.md
+60-52Lines changed: 60 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,65 +110,18 @@ This starts:
110
110
111
111
### Switching dry run vs real Mailgun sending
112
112
113
-
By default, `docker-compose.jobs.yml` runs both email functions in dry-run mode (no real email is sent), and it uses placeholder Mailgun credentials unless you provide `MAILGUN_API_KEY` / `MAILGUN_KEY`.
113
+
By default, `docker-compose.jobs.yml` runs both email functions in dry-run mode (no real email is sent), and it uses placeholder Mailgun credentials.
114
114
115
-
Quick start commands:
116
-
117
-
Dry run:
115
+
Dry run (recommended for local development):
118
116
119
117
```sh
120
118
docker compose -f docker-compose.jobs.yml up -d --build --force-recreate
To use a real Mailgun key without editing `docker-compose.jobs.yml`, set these env vars before starting the stack (or put them in a local `.env` file in the `constructive/` directory). Don't commit your `.env`.
130
-
131
-
```sh
132
-
export MAILGUN_API_KEY="your-mailgun-key"
133
-
export MAILGUN_KEY="your-mailgun-key"
134
-
```
135
-
136
-
If you're not using `mg.constructive.io`, also override `MAILGUN_DOMAIN`, `MAILGUN_FROM`, and `MAILGUN_REPLY` (for example in the override file below) to match your Mailgun setup.
137
-
138
-
To actually send email (instead of dry-run), set these env vars (or put them in your local `.env`):
139
-
140
-
```sh
141
-
export SIMPLE_EMAIL_DRY_RUN=false
142
-
export SEND_EMAIL_LINK_DRY_RUN=false
143
-
```
144
-
145
-
Then recreate the stack so the new env is applied:
146
-
147
-
```sh
148
-
docker compose -f docker-compose.jobs.yml up -d --build --force-recreate
149
-
```
150
-
151
-
If you prefer not to export env vars, create a local override file (don't commit it) at `docker-compose.jobs.override.yml`:
152
-
153
-
```yml
154
-
services:
155
-
simple-email:
156
-
environment:
157
-
SIMPLE_EMAIL_DRY_RUN: "false"
158
-
159
-
send-email-link:
160
-
environment:
161
-
SEND_EMAIL_LINK_DRY_RUN: "false"
162
-
```
163
-
164
-
Start the stack with both files:
165
-
166
-
```sh
167
-
docker compose -f docker-compose.jobs.yml -f docker-compose.jobs.override.yml up -d --build --force-recreate
168
-
```
169
-
170
-
To switch back to dry-run, set `SIMPLE_EMAIL_DRY_RUN=true` and `SEND_EMAIL_LINK_DRY_RUN=true` (or delete the override file) and recreate again.
121
+
In dry-run mode:
171
122
123
+
- The `simple-email` and `send-email-link` containers log the payload they would send instead of hitting Mailgun.
124
+
- You should see log lines like `[simple-email] DRY RUN email (skipping send) ...` and `[send-email-link] DRY RUN email (skipping send) ...`.
172
125
---
173
126
174
127
## 5. Ensure GraphQL host routing works for `send-email-link`
@@ -295,3 +248,58 @@ To stop everything, including Postgres and Minio:
295
248
```sh
296
249
docker compose down
297
250
```
251
+
252
+
---
253
+
254
+
## 10. Optional Mailgun secrets for real sending
255
+
256
+
Real Mailgun credentials are **not required** to run the jobs stack locally; they are only needed if you want to send real email in development instead of using dry-run logging.
257
+
258
+
To start the stack with real sending from the command line:
Alternatively, you can set the secrets in your shell or a local `.env` file (do not commit this file) in the `constructive/` directory:
265
+
266
+
```sh
267
+
export MAILGUN_API_KEY="your-mailgun-key"
268
+
export MAILGUN_KEY="your-mailgun-key"
269
+
```
270
+
271
+
If you're not using `mg.constructive.io`, also override `MAILGUN_DOMAIN`, `MAILGUN_FROM`, and `MAILGUN_REPLY` (for example in an override file) to match your Mailgun setup.
272
+
273
+
To have the containers send real email instead of dry-run, set:
274
+
275
+
```sh
276
+
export SIMPLE_EMAIL_DRY_RUN=false
277
+
export SEND_EMAIL_LINK_DRY_RUN=false
278
+
```
279
+
280
+
Then recreate the stack so the new env is applied:
281
+
282
+
```sh
283
+
docker compose -f docker-compose.jobs.yml up -d --build --force-recreate
284
+
```
285
+
286
+
If you prefer not to export env vars, create a local override file (don't commit it) at `docker-compose.jobs.override.yml`:
287
+
288
+
```yml
289
+
services:
290
+
simple-email:
291
+
environment:
292
+
SIMPLE_EMAIL_DRY_RUN: "false"
293
+
294
+
send-email-link:
295
+
environment:
296
+
SEND_EMAIL_LINK_DRY_RUN: "false"
297
+
```
298
+
299
+
Start the stack with both files:
300
+
301
+
```sh
302
+
docker compose -f docker-compose.jobs.yml -f docker-compose.jobs.override.yml up -d --build --force-recreate
303
+
```
304
+
305
+
To switch back to dry-run, set `SIMPLE_EMAIL_DRY_RUN=true` and `SEND_EMAIL_LINK_DRY_RUN=true` (or delete the override file) and recreate again.
0 commit comments