Files
WebNationsGlory_ServeurBuil…/Dockerfile

24 lines
527 B
Docker

FROM node:18-alpine
WORKDIR /app
# Copy npm config first
COPY .npmrc ./
# Copy package files
COPY backend/package*.json ./
# Install dependencies with retry logic
RUN npm cache clean --force && \
npm install --no-optional --legacy-peer-deps 2>&1 | tail -20 && \
ls -la node_modules/express || npm install express && \
test -d node_modules/express || (echo "FATAL: express not found" && exit 1)
# Copy application code
COPY backend/src ./src
COPY frontend ./frontend
EXPOSE 4001
CMD ["node", "src/server.js"]