From ac7bb05708c1b605e18fa003c6eb8b377293c8c9 Mon Sep 17 00:00:00 2001 From: santiyago <72850756+santiyagoburcart@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:00:55 +0330 Subject: [PATCH] Create Dockerfile --- new-frontend/Dockerfile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 new-frontend/Dockerfile diff --git a/new-frontend/Dockerfile b/new-frontend/Dockerfile new file mode 100644 index 00000000..c76481af --- /dev/null +++ b/new-frontend/Dockerfile @@ -0,0 +1,30 @@ +# Stage 1: Build the Next.js application +FROM node:20-alpine AS builder + +WORKDIR /app + +COPY package.json yarn.lock ./ +RUN corepack enable +RUN yarn install --frozen-lockfile --network-timeout 600000 + +COPY . . +RUN yarn build + +# Stage 2: Production environment +FROM node:20-alpine AS runner + +WORKDIR /app + +ENV NODE_ENV=production + +COPY --from=builder /app/.next ./.next +COPY --from=builder /app/public ./public +COPY --from=builder /app/package.json ./package.json +COPY --from=builder /app/yarn.lock ./yarn.lock + +RUN corepack enable +RUN yarn install --production --frozen-lockfile --network-timeout 600000 + +EXPOSE 3000 + +CMD ["yarn", "start"]