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