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: CLAUDE.md
+42Lines changed: 42 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,48 @@ The `PIPELINE` constant in `@adt/types` defines all stages, their steps, labels,
65
65
66
66
**Never hardcode stage/step ordering, names, or groupings outside of `PIPELINE`.** If you need a new derived lookup, add it to `packages/types/src/pipeline.ts` alongside the existing ones (`STAGE_ORDER`, `STEP_TO_STAGE`, `STAGE_BY_NAME`, `ALL_STEP_NAMES`).
67
67
68
+
## Docker
69
+
70
+
Three build targets in `Dockerfile`:
71
+
72
+
| Target | Description | Used by |
73
+
|--------|-------------|---------|
74
+
|`api`| Node.js API server only |`docker-compose.yml` (multi-container) |
75
+
|`studio`| nginx serving the built SPA |`docker-compose.yml` (multi-container) |
|`PORT`|`3001`| Internal only — nginx proxies to this |
95
+
96
+
**`TEMPLATES_DIR` trap:** The Dockerfile and `docker-compose.yml` set `TEMPLATES_DIR=/app/templates` but the application **never reads this env var**. Templates dir is always derived from `path.join(path.dirname(PROMPTS_DIR), "templates")`. To use a custom templates directory, mount it as a sibling of `prompts/` — i.e. override `PROMPTS_DIR` and keep `templates/` next to it.
97
+
98
+
**Release pipeline:** pushing a `v*` tag triggers `.github/workflows/release.yml` which builds the `app` target and pushes to `ghcr.io/unicef/adt-studio:latest` and `ghcr.io/unicef/adt-studio:<tag>`. A ready-to-use `docker-compose.yml` (generated from `docker/compose-release.yml.template`) is uploaded as a release asset.
99
+
100
+
**Key Docker files:**
101
+
-`Dockerfile` — multi-stage build (base → deps → build → api / studio / app)
102
+
-`docker-compose.yml` — local dev/testing (multi-container)
103
+
-`docker/nginx.conf` — nginx config for the `studio` stage (proxies to `http://api:3001`)
104
+
-`docker/nginx-single.conf` — nginx config for the `app` stage (proxies to `http://127.0.0.1:3001`)
105
+
-`docker/entrypoint.sh` — starts API + nginx in the `app` stage, health-checks API before nginx starts
106
+
-`docker/compose-release.yml.template` — template for the release asset
107
+
108
+
**External packages in Docker:**`jsdom`, `esbuild`, `tailwindcss`, `postcss`, and `playwright` cannot be bundled by esbuild because they read data files relative to their own `__dirname`. They are installed into `apps/api/dist/node_modules/` by the Dockerfile build stage via npm. If a new package exhibits the same pattern (ENOENT error pointing to a path under `/app/apps/`), add it to both the `external` array in `apps/api/scripts/bundle-server.mjs` and the npm install step in the Dockerfile.
0 commit comments