This commit is contained in:
10
Dockerfile
10
Dockerfile
@@ -3,7 +3,7 @@ FROM node:20-alpine AS dependencies
|
||||
RUN corepack enable
|
||||
RUN corepack prepare yarn@stable --activate
|
||||
WORKDIR /app
|
||||
COPY package.json yarn.lock ./
|
||||
COPY package.json yarn.lock /app/
|
||||
RUN yarn install --immutable
|
||||
|
||||
# --- Stage 2: Builder ---
|
||||
@@ -11,8 +11,8 @@ FROM node:20-alpine AS builder
|
||||
RUN corepack enable
|
||||
RUN corepack prepare yarn@stable --activate
|
||||
WORKDIR /app
|
||||
COPY --from=dependencies /app/node_modules ./
|
||||
COPY . .
|
||||
COPY --from=dependencies /app/node_modules /app/
|
||||
COPY . /app/
|
||||
RUN yarn build
|
||||
|
||||
# --- Stage 3: Runner ---
|
||||
@@ -20,7 +20,7 @@ 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
|
||||
COPY --from=builder /app/build /app/build
|
||||
COPY --from=dependencies /app/.yarn /app/.yarn
|
||||
|
||||
CMD ["yarn", "start"] # Replace with your start command
|
||||
|
||||
Reference in New Issue
Block a user