-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
46 lines (27 loc) · 982 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
FROM rust:alpine AS rustbuilder
WORKDIR /app
ENV GRPC_HOST=0.0.0.0:50053
RUN apk upgrade --update-cache --available && \
apk add npm gcc cmake make g++ protoc protobuf-dev
RUN npm i @a11ywatch/protos
COPY . .
RUN cargo install --no-default-features --path .
FROM node:21-alpine AS installer
WORKDIR /usr/src/app
COPY package*.json yarn.lock ./
RUN yarn install
FROM node:21-alpine AS builder
WORKDIR /usr/src/app
COPY --from=installer /usr/src/app/node_modules ./node_modules
COPY . .
RUN yarn build && rm -R ./node_modules && yarn install --production
FROM node:21-alpine
RUN apk upgrade --update-cache --available && \
apk add openssl && \
rm -rf /var/cache/apk/*
WORKDIR /usr/src/app
COPY --from=builder /usr/src/app/dist ./dist
COPY --from=builder /usr/src/app/node_modules ./node_modules
COPY --from=rustbuilder /usr/local/cargo/bin/health_client /usr/local/bin/health_client
EXPOSE 50053
CMD [ "node", "--no-experimental-fetch", "./dist/server.js"]