FROM node:22-slim AS builder WORKDIR /repo ARG APP_DIR COPY package.json package-lock.json tsconfig.json tsconfig.base.json ./ COPY frontend ./frontend COPY backend ./backend RUN npm ci --no-audit --no-fund --fetch-retries=5 RUN npm run build --workspace=frontend/shared RUN npm run build --workspace=${APP_DIR} FROM alpine:3.21 AS export ARG APP_DIR COPY --from=builder /repo/${APP_DIR}/dist /app/dist