fix(deploy): install dev deps in builder so tsc is available, keep production deps in final image
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
FROM node:20-alpine AS builder
|
FROM node:20-alpine AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY backend/package*.json backend/
|
COPY backend/package*.json backend/
|
||||||
# Use npm ci if a lockfile exists in backend, otherwise fall back to npm install
|
# Install all dependencies (including dev) in builder so tools like tsc are available for build
|
||||||
RUN sh -c 'if [ -f backend/package-lock.json ] || [ -f backend/npm-shrinkwrap.json ]; then npm ci --prefix backend --production; else npm install --prefix backend --production; fi'
|
RUN sh -c 'if [ -f backend/package-lock.json ] || [ -f backend/npm-shrinkwrap.json ]; then npm ci --prefix backend; else npm install --prefix backend; fi'
|
||||||
COPY backend/ backend/
|
COPY backend/ backend/
|
||||||
RUN npm run build --prefix backend
|
RUN npm run build --prefix backend
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user