Merge pull request 'improvement: DockerFiles updated to avoid some deployment issues.' (#63) from improvement/v1-demo-improvements into master
All checks were successful
Registry — build, push, deploy / temp-success (push) Successful in 1s

Reviewed-on: http://178.131.50.201:3000/admin/dyolink/pulls/63
Reviewed-by: rameen <rameen.naghdi@gmail.com>
This commit was merged in pull request #63.
This commit is contained in:
2026-07-20 21:37:27 +03:30
2 changed files with 19 additions and 3 deletions

View File

@@ -9,13 +9,22 @@ COPY package*.json ./
COPY .npmrc ./ COPY .npmrc ./
COPY prisma ./prisma/ 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 . . COPY . .
RUN npm run prisma:generate RUN npm run prisma:generate
RUN npm run build 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 WORKDIR /app
COPY package*.json ./ 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 . . COPY . .