improvement: DockerFiles updated to avoid some deployment issues. #63

Merged
rameen merged 1 commits from improvement/v1-demo-improvements into master 2026-07-20 21:37:29 +03:30
2 changed files with 19 additions and 3 deletions
Showing only changes of commit 245a238d1a - Show all commits

View File

@@ -9,13 +9,22 @@ COPY package*.json ./
COPY .npmrc ./
COPY prisma ./prisma/
RUN npm ci
# npm ci can exit 0 on some Docker Desktop setups while leaving node_modules/.bin
# empty ("Exit handler never called!") — then `prisma` / `nest` are "not found".
RUN npm ci --no-audit --no-fund || true; \
if [ ! -e node_modules/.bin/prisma ] || [ ! -e node_modules/.bin/nest ]; then \
echo "Incomplete npm ci (missing .bin links) — falling back to npm install"; \
rm -rf node_modules; \
npm install --no-audit --no-fund; \
fi; \
test -e node_modules/.bin/prisma; \
test -e node_modules/.bin/nest
COPY . .
RUN npm run prisma:generate
RUN npm run build
RUN npm prune --production
RUN npm prune --omit=dev
# ============================================

View File

@@ -4,7 +4,14 @@ FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
# Same safeguard as backend: incomplete npm ci can leave node_modules/.bin empty.
RUN npm ci --no-audit --no-fund || true; \
if [ ! -e node_modules/.bin/next ]; then \
echo "Incomplete npm ci (missing .bin links) — falling back to npm install"; \
rm -rf node_modules; \
npm install --no-audit --no-fund; \
fi; \
test -e node_modules/.bin/next
COPY . .