Wrangling the wrangler

This commit is contained in:
2026-06-21 06:00:20 -04:00
parent ed7597f879
commit 72731306ff
8 changed files with 170 additions and 131 deletions
+16 -7
View File
@@ -23,29 +23,38 @@ Production-ready airfield website stack built with Astro, Directus, PostgreSQL,
- The frontend service bind-mounts the project into `/app`, keeps `node_modules` and `.astro` in named volumes, and serves the site with `astro dev` on the published frontend port.
- Layout and page structure are controlled entirely by Astro.
- Frontend source edits should appear without rebuilding the container image.
- Cloudflare Pages deployment uses Direct Upload with Wrangler. See `docs/cloudflare-pages.md` for the test/prod URL workflow.
- Cloudflare Worker deployment uses Wrangler static assets. See `docs/cloudflare-worker.md` for the test/prod URL workflow.
## Cloudflare Pages deployment
## Cloudflare Worker deployment
This project is normally developed through Docker Compose, so run the Worker build/deploy scripts inside the `web` service.
Copy the Worker env files first:
```bash
cp .env.worker.test.example .env.worker.test
cp .env.worker.prod.example .env.worker.prod
```
Build static files with the test URL set:
```bash
npm run build:pages:test
docker compose exec web npm run build:worker:test
```
Deploy the test build to the Cloudflare Pages `test` branch:
Deploy the test build to the test Cloudflare Worker:
```bash
npm run deploy:pages:test
docker compose exec web npm run deploy:worker:test
```
Deploy production with the production URL set:
```bash
npm run deploy:pages:prod
docker compose exec web npm run deploy:worker:prod
```
Copy `.env.pages.test.example` and `.env.pages.prod.example` before using these commands.
The deploy scripts build first, then upload `dist/` with Wrangler. The `test` command uses `.env.worker.test`; the production command uses `.env.worker.prod`.
## Programmatic Directus schema bootstrap