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