Some checks failed
Main / build-and-push-docker-image (20.x) (push) Failing after 3m13s
24 lines
566 B
Docker
24 lines
566 B
Docker
FROM node:lts-alpine AS base
|
|
|
|
# Stage 1: Install dependencies
|
|
FROM base AS deps
|
|
WORKDIR /app
|
|
COPY package.json yarn.lock ./
|
|
RUN corepack enable yarn && yarn install --immutable
|
|
|
|
# Stage 2: Build the application
|
|
FROM base AS builder
|
|
WORKDIR /app
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY . .
|
|
RUN corepack enable yarn && yarn build
|
|
|
|
# Stage 3: Production server
|
|
FROM base AS runner
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production
|
|
COPY --from=builder /app/.next/standalone ./
|
|
COPY --from=builder /app/.next/static ./.next/static
|
|
|
|
EXPOSE 3000
|
|
CMD ["node", "server.js"] |