Some checks failed
Main / build-and-push-docker-image (20.x) (push) Failing after 3m27s
27 lines
672 B
Docker
27 lines
672 B
Docker
# --- Stage 1: Dependencies ---
|
|
FROM node:20-alpine AS dependencies
|
|
RUN corepack enable
|
|
RUN corepack prepare yarn@stable --activate
|
|
WORKDIR /app
|
|
COPY package.json yarn.lock ./
|
|
RUN yarn install --immutable
|
|
|
|
# --- Stage 2: Builder ---
|
|
FROM node:20-alpine AS builder
|
|
RUN corepack enable
|
|
RUN corepack prepare yarn@stable --activate
|
|
WORKDIR /app
|
|
COPY --from=dependencies /app ./
|
|
COPY . .
|
|
RUN yarn build
|
|
|
|
# --- Stage 3: Runner ---
|
|
FROM node:20-alpine AS runner
|
|
RUN corepack enable
|
|
RUN corepack prepare yarn@stable --activate
|
|
WORKDIR /app
|
|
COPY --from=builder /app/build ./build
|
|
COPY --from=dependencies /app/.yarn ./.yarn
|
|
|
|
CMD ["yarn", "start"] # Replace with your start command
|