-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
27 lines (25 loc) · 891 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
FROM node:20.8.0-alpine3.17 AS ts-compile
WORKDIR /usr/anticorruption-layer
COPY yarn*.lock ./
COPY package*.json ./
COPY tsconfig*.json ./
COPY .npmrc ./
RUN yarn install --frozen-lockfile --production=false
COPY . ./
RUN yarn build:app
FROM node:20.8.0-alpine3.17 AS ts-remove
WORKDIR /usr/anticorruption-layer
COPY --from=ts-compile /usr/anticorruption-layer/yarn*.lock ./
COPY --from=ts-compile /usr/anticorruption-layer/package*.json ./
COPY --from=ts-compile /usr/anticorruption-layer/dist ./
COPY --from=ts-compile /usr/anticorruption-layer/.npmrc ./
RUN yarn install --frozen-lockfile --production=false
FROM gcr.io/distroless/nodejs20-debian12
WORKDIR /usr/anticorruption-layer
COPY --from=ts-remove /usr/anticorruption-layer ./
USER 1000
ENV GRPC_SERVER_PORT=40020
ENV GRPC_SERVER_HOST=localhost
ENV GRPC_RDB_SERVER_HOST=localhost
ENV GRPC_RDB_SERVER_PORT=9090
CMD ["server.js"]