Update Dockerfile
This commit is contained in:
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user