Update
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
# Stage 1: Frontend build
|
||||
FROM node:20-alpine AS frontend-build
|
||||
WORKDIR /app/frontend
|
||||
COPY frontend/package.json frontend/package-lock.json ./
|
||||
RUN npm ci
|
||||
COPY frontend/ ./
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: Backend + Frontend
|
||||
FROM node:20-alpine AS runtime
|
||||
WORKDIR /app/backend
|
||||
COPY backend/package.json backend/package-lock.json ./
|
||||
RUN npm ci --only=production
|
||||
COPY backend/ ./
|
||||
COPY --from=frontend-build /app/frontend/dist ./public
|
||||
|
||||
ENV NODE_ENV=production
|
||||
EXPOSE 4000
|
||||
USER node
|
||||
CMD ["node", "index.js"]
|
||||
Reference in New Issue
Block a user