Make docker startup work on a cold cache
Frontend: tsc was running before vite, but the routeTree.gen.ts that the routes import is generated by the Vite plugin at startup — fresh container had no cache, so tsc failed before vite ever ran. Reverse the order: vite first (generates routeTree), then tsc --noEmit validates types. Backend: run `directus database migrate:latest` before start; the deployed SQLite is on an old schema (Directus 10.x) and `directus start` aborts on the missing `searchable` column. Both services: set CI=true so pnpm doesn't prompt for `node_modules` purge on a non-TTY container, and use `sh -ec` so a failed step halts the script instead of falling through to `pnpm run start`.
This commit is contained in:
@@ -17,15 +17,18 @@ services:
|
||||
labels:
|
||||
caddy: admin.pca-pijac.dev.civokram.com
|
||||
caddy.reverse_proxy: '{{upstreams 8055}}'
|
||||
environment:
|
||||
CI: "true"
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- -ec
|
||||
- |
|
||||
npm i -g pnpm
|
||||
cd /repo
|
||||
pnpm install --filter ./backend... --frozen-lockfile --prod
|
||||
cd /repo/backend
|
||||
rm -f .env
|
||||
pnpm exec directus database migrate:latest
|
||||
pnpm run start
|
||||
|
||||
frontend:
|
||||
@@ -43,9 +46,11 @@ services:
|
||||
labels:
|
||||
caddy: pca-pijac.dev.civokram.com
|
||||
caddy.reverse_proxy: '{{upstreams 3000}}'
|
||||
environment:
|
||||
CI: "true"
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- -ec
|
||||
- |
|
||||
npm i -g pnpm
|
||||
cd /repo
|
||||
|
||||
Reference in New Issue
Block a user