This commit is contained in:
2024-09-25 17:00:22 -06:00
parent 8f415d0b8e
commit 6e3dcd6cb1
8 changed files with 62 additions and 221 deletions

View File

@@ -1,17 +1,25 @@
FROM node:22-alpine
# Stage 1: Build the application
FROM node:22-alpine AS builder
WORKDIR /app
COPY package*.json .
COPY package*.json ./
RUN npm i
COPY . .
RUN mkdir -p storage
RUN rm -rf /app/storage/*
RUN npm run build
CMD [ "npm", "run", "start" ]
FROM node:22-alpine AS production
WORKDIR /app
COPY --from=builder /app/package*.json ./
RUN npm install --omit=dev
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
RUN mkdir -p storage && rm -rf /app/storage/*
CMD [ "npm", "run", "start" ]