Update Dockerfile

This commit is contained in:
fcarraUniSa
2026-02-18 13:56:46 +01:00
committed by GitHub
parent 760a9c5340
commit fdd726753b

View File

@@ -1,24 +1,20 @@
# Build Stage FROM node:20-alpine
FROM node:20-alpine AS build
# Install dependencies for native modules if needed # Install dependencies for native modules
RUN apk add --no-cache python3 make g++ RUN apk add --no-cache python3 make g++
WORKDIR /app WORKDIR /app
COPY package.json ./ COPY package.json ./
# Install dependencies without lockfile to avoid conflicts # Install dependencies
RUN npm install RUN npm install
COPY . . COPY . .
# Build the app # Ensure uploads directory exists
RUN npm run build RUN mkdir -p uploads
# Production Stage EXPOSE 3000
FROM nginx:alpine
COPY nginx.conf /etc/nginx/conf.d/default.conf CMD ["npm", "start"]
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]