Files
WebNationsGlory_ServeurBuil…/Dockerfile

24 lines
581 B
Docker

FROM node:18-alpine
WORKDIR /app
# Copy npm config
COPY .npmrc ./
# Copy package files
COPY backend/package*.json ./
# Install dependencies - handle npm bug with explicit install
RUN npm cache clean --force && \
npm install --no-optional --legacy-peer-deps || true && \
npm install express express-session bcryptjs dotenv cors multer fs-extra && \
test -d node_modules/express || (ls -la node_modules/ && echo "FATAL: express not found" && exit 1)
# Copy application code
COPY backend/src ./src
COPY frontend ./frontend
EXPOSE 4001
CMD ["node", "src/server.js"]