-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
31 lines (28 loc) · 890 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
30
31
FROM --platform=linux/amd64 node:20-alpine AS base
LABEL author="scorpion9979 <ahmed.i.tawefeeq@protonmail.com>"
WORKDIR /liquidator
# 1. Cache dependencies.
FROM base AS cache
COPY ./.yarnrc.yml ./.yarnrc.yml
COPY ./.yarn/ ./.yarn/
COPY ./package.json ./package.json
COPY ./yarn.lock ./yarn.lock
RUN yarn install --immutable
RUN npm prune --production --no-package-lock
# 2. Build the code.
FROM base AS build
COPY ./.yarnrc.yml ./.yarnrc.yml
COPY ./.yarn/ ./.yarn/
COPY ./package.json ./package.json
COPY ./yarn.lock ./yarn.lock
RUN yarn install --immutable
COPY ./src ./src
COPY ./tsconfig.json ./tsconfig.json
COPY ./tsconfig.prod.json ./tsconfig.prod.json
RUN yarn build
# 3. Runtime environment.
FROM base AS release
COPY --from=build /liquidator/dist ./dist
COPY --from=build /liquidator/package.json ./
COPY --from=cache /liquidator/node_modules ./node_modules
ENTRYPOINT node .