Compare commits

..

4 Commits

Author SHA1 Message Date
33f52aad6c Allow prod host through vite preview 2026-04-23 22:41:06 +04:00
da8a7f17a4 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`.
2026-04-23 22:23:26 +04:00
2fe67960a1 Remove stale per-package lockfiles
Now ignored via .gitignore; the workspace-root pnpm-lock.yaml is the
single source of truth. These files were never tracked in git and
caused --frozen-lockfile to reject installs in the docker containers.
2026-04-23 21:58:59 +04:00
fc59e7e133 Run docker installs from the workspace root
Mounting only ./backend and ./frontend into /app made pnpm look for a
per-package lockfile (stale) and miss the workspace-root one entirely,
so --frozen-lockfile failed and root pnpm.onlyBuiltDependencies didn't
apply. Mount the whole repo at /repo, install with --filter from root,
and use the canonical workspace lockfile. Drop the per-package
onlyBuiltDependencies overrides — pnpm warns they're ignored outside
the workspace root.

Pin node:22-bookworm: node:lts now resolves to Node 24, for which
isolated-vm@5.0.3 has no prebuild and won't compile (V8 headers
require C++20).

Gitignore stray per-package lockfiles so they don't drift again.
2026-04-23 21:57:37 +04:00
7 changed files with 28 additions and 17950 deletions

4
.gitignore vendored
View File

@@ -11,6 +11,10 @@ node_modules/
package-lock.json package-lock.json
yarn.lock yarn.lock
# pnpm: only the workspace-root lockfile is authoritative
backend/pnpm-lock.yaml
frontend/pnpm-lock.yaml
# Mac # Mac
.DS_Store .DS_Store

View File

@@ -18,13 +18,5 @@
"devDependencies": { "devDependencies": {
"nodemon": "3.1.14", "nodemon": "3.1.14",
"uuid": "14.0.0" "uuid": "14.0.0"
},
"pnpm": {
"onlyBuiltDependencies": [
"argon2",
"isolated-vm",
"sharp",
"sqlite3"
]
} }
} }

14825
backend/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -4,51 +4,59 @@ networks:
services: services:
backend: backend:
image: node:lts-bookworm image: node:22-bookworm
container_name: pca_pijac_backend container_name: pca_pijac_backend
restart: unless-stopped restart: unless-stopped
env_file: ./backend/.env.production env_file: ./backend/.env.production
working_dir: /repo/backend
networks: networks:
- main - main
volumes: volumes:
- ./backend:/app - .:/repo
- ./data:/data - ./data:/data
labels: labels:
caddy: admin.pca-pijac.dev.civokram.com caddy: admin.pca-pijac.dev.civokram.com
caddy.reverse_proxy: '{{upstreams 8055}}' caddy.reverse_proxy: '{{upstreams 8055}}'
environment:
CI: "true"
command: command:
- sh - sh
- -c - -ec
- | - |
npm i -g pnpm npm i -g pnpm
cd /app cd /repo
pnpm install --production pnpm install --filter ./backend... --frozen-lockfile --prod
cd /repo/backend
rm -f .env rm -f .env
pnpm exec directus database migrate:latest
pnpm run start pnpm run start
frontend: frontend:
image: node:lts-bookworm image: node:22-bookworm
container_name: pca_pijac_frontend container_name: pca_pijac_frontend
restart: unless-stopped restart: unless-stopped
env_file: ./frontend/.env.production env_file: ./frontend/.env.production
working_dir: /repo/frontend
depends_on: depends_on:
- backend - backend
networks: networks:
- main - main
volumes: volumes:
- ./frontend:/app - .:/repo
labels: labels:
caddy: pca-pijac.dev.civokram.com caddy: pca-pijac.dev.civokram.com
caddy.reverse_proxy: '{{upstreams 3000}}' caddy.reverse_proxy: '{{upstreams 3000}}'
environment:
CI: "true"
command: command:
- sh - sh
- -c - -ec
- | - |
npm i -g pnpm npm i -g pnpm
cd /app cd /repo
pnpm install --frozen-lockfile pnpm install --filter ./frontend... --frozen-lockfile
cd /repo/frontend
sleep 10 sleep 10
rm -f .env rm -f .env
pnpm run build pnpm run build
pnpm prune --prod
pnpm run start pnpm run start

View File

@@ -10,7 +10,7 @@
"packageManager": "pnpm@10.33.2", "packageManager": "pnpm@10.33.2",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "tsc -b && vite build", "build": "vite build && tsc -b --noEmit",
"preview": "vite preview", "preview": "vite preview",
"start": "vite preview --host 0.0.0.0 --port 3000", "start": "vite preview --host 0.0.0.0 --port 3000",
"typecheck": "tsc -b --noEmit", "typecheck": "tsc -b --noEmit",
@@ -47,10 +47,5 @@
"tailwindcss": "4.2.4", "tailwindcss": "4.2.4",
"typescript": "6.0.3", "typescript": "6.0.3",
"vite": "8.0.10" "vite": "8.0.10"
},
"pnpm": {
"onlyBuiltDependencies": [
"esbuild"
]
} }
} }

3100
frontend/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -24,6 +24,10 @@ export default defineConfig({
server: { server: {
port: 3000, port: 3000,
}, },
preview: {
port: 3000,
allowedHosts: ['pca-pijac.dev.civokram.com'],
},
build: { build: {
outDir: 'node_modules/.cache/dist', outDir: 'node_modules/.cache/dist',
emptyOutDir: true, emptyOutDir: true,