testing new docker file for build

This commit is contained in:
Parsa Nazer
2025-03-06 19:44:42 +03:30
parent 7da0ae12da
commit b557a7708c
+9 -3
View File
@@ -13,11 +13,17 @@
# CMD ["npm", "run", "start"]
FROM node:20-alpine
# Use a Debian-based image instead of Alpine to avoid musl-related issues
FROM node:20-slim
WORKDIR /app
COPY package*.json ./
RUN npm install -g npm@latest && \
npm install
# 1. Clean npm cache
# 2. Force install optional dependencies
# 3. Use --legacy-peer-deps if needed
RUN npm cache clean --force && \
npm install --include=optional --legacy-peer-deps
COPY . .
RUN npm run build
EXPOSE 3000