-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
29 lines (26 loc) · 815 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM node:20-alpine AS dependencies
RUN corepack enable
WORKDIR /app
COPY package.json ./
COPY yarn.lock ./
COPY tsconfig.json ./
RUN yarn --immutable
FROM node:20-alpine AS builder
RUN corepack enable
WORKDIR /app
COPY --from=dependencies /app/package.json ./
COPY --from=dependencies /app/.pnp.cjs ./
COPY --from=dependencies /app/.yarn ./.yarn
COPY --from=dependencies /app/yarn.lock ./
COPY --from=dependencies /app/tsconfig.json ./
COPY --from=dependencies /root/.yarn /root/.yarn
COPY ./src ./src
RUN yarn dlx -p [email protected] build
FROM node:20-alpine AS runner
RUN corepack enable
WORKDIR /app
COPY --from=builder /app/build ./
COPY --from=dependencies /app/.pnp.cjs ./
COPY --from=dependencies /app/.yarn ./.yarn
COPY --from=dependencies /root/.yarn /root/.yarn
ENTRYPOINT ["node", "src/testCode.js"]