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.
58 lines
1.2 KiB
YAML
58 lines
1.2 KiB
YAML
networks:
|
|
main:
|
|
external: true
|
|
|
|
services:
|
|
backend:
|
|
image: node:22-bookworm
|
|
container_name: pca_pijac_backend
|
|
restart: unless-stopped
|
|
env_file: ./backend/.env.production
|
|
working_dir: /repo/backend
|
|
networks:
|
|
- main
|
|
volumes:
|
|
- .:/repo
|
|
- ./data:/data
|
|
labels:
|
|
caddy: admin.pca-pijac.dev.civokram.com
|
|
caddy.reverse_proxy: '{{upstreams 8055}}'
|
|
command:
|
|
- sh
|
|
- -c
|
|
- |
|
|
npm i -g pnpm
|
|
cd /repo
|
|
pnpm install --filter ./backend... --frozen-lockfile --prod
|
|
cd /repo/backend
|
|
rm -f .env
|
|
pnpm run start
|
|
|
|
frontend:
|
|
image: node:22-bookworm
|
|
container_name: pca_pijac_frontend
|
|
restart: unless-stopped
|
|
env_file: ./frontend/.env.production
|
|
working_dir: /repo/frontend
|
|
depends_on:
|
|
- backend
|
|
networks:
|
|
- main
|
|
volumes:
|
|
- .:/repo
|
|
labels:
|
|
caddy: pca-pijac.dev.civokram.com
|
|
caddy.reverse_proxy: '{{upstreams 3000}}'
|
|
command:
|
|
- sh
|
|
- -c
|
|
- |
|
|
npm i -g pnpm
|
|
cd /repo
|
|
pnpm install --filter ./frontend... --frozen-lockfile
|
|
cd /repo/frontend
|
|
sleep 10
|
|
rm -f .env
|
|
pnpm run build
|
|
pnpm run start
|