Skip to content

Commit c8a3b23

Browse files
authored
Merge pull request #537 from constructive-io/anmol/jobs-doc-cleanup
docs: update readme
2 parents 324881a + 97d7623 commit c8a3b23

File tree

2 files changed

+61
-53
lines changed

2 files changed

+61
-53
lines changed

jobs/DEVELOPMENT_JOBS.md

Lines changed: 60 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -110,65 +110,18 @@ This starts:
110110

111111
### Switching dry run vs real Mailgun sending
112112

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.
114114

115-
Quick start commands:
116-
117-
Dry run:
115+
Dry run (recommended for local development):
118116

119117
```sh
120118
docker compose -f docker-compose.jobs.yml up -d --build --force-recreate
121119
```
122120

123-
Real sending (Mailgun):
124-
125-
```sh
126-
MAILGUN_API_KEY="your-mailgun-key" MAILGUN_KEY="your-mailgun-key" SIMPLE_EMAIL_DRY_RUN=false SEND_EMAIL_LINK_DRY_RUN=false docker compose -f docker-compose.jobs.yml up -d --build --force-recreate
127-
```
128-
129-
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:
171122

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) ...`.
172125
---
173126

174127
## 5. Ensure GraphQL host routing works for `send-email-link`
@@ -295,3 +248,58 @@ To stop everything, including Postgres and Minio:
295248
```sh
296249
docker compose down
297250
```
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:
259+
260+
```sh
261+
MAILGUN_API_KEY="your-mailgun-key" MAILGUN_KEY="your-mailgun-key" SIMPLE_EMAIL_DRY_RUN=false SEND_EMAIL_LINK_DRY_RUN=false docker compose -f docker-compose.jobs.yml up -d --build --force-recreate
262+
```
263+
264+
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.

jobs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ http://simple-email.interweb.svc.cluster.local
156156
and the worker will call:
157157

158158
```text
159-
POST http://simple-email.interweb.svc.cluster.local/simple-email
159+
POST http://simple-email.interweb.svc.cluster.local/
160160
```
161161

162162
---

0 commit comments

Comments
 (0)