forked from l2beat/l2beat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.backend
40 lines (35 loc) · 998 Bytes
/
Dockerfile.backend
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
ARG ARCH=x86_64
ARG TURBO_TEAM
ARG TURBO_TOKEN
FROM node:18 as pruner
ARG TURBO_TEAM
ARG TURBO_TOKEN
WORKDIR /src/
COPY . .
RUN yarn global add turbo
RUN turbo prune --docker @l2beat/backend
FROM node:18 as builder
ARG ARCH
ARG TURBO_TEAM
ARG TURBO_TOKEN
WORKDIR /src/
COPY --from=pruner /src/out/json/ .
RUN yarn install
COPY --from=pruner /src/out/full/ /src/tsconfig.json ./
RUN yarn build:backend
RUN mkdir /dist/ && \
cd /dist/ && \
wget -q https://github.com/Wilfred/difftastic/releases/download/0.57.0/difft-$ARCH-unknown-linux-gnu.tar.gz && \
tar -xf difft-$ARCH-unknown-linux-gnu.tar.gz && \
rm -f difft-$ARCH-unknown-linux-gnu.tar.gz
FROM node:18-slim as release
WORKDIR /app/
RUN apt update && \
apt install -y openssh-server curl bash iproute2 jq && \
apt clean && \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /src/ .
COPY --from=builder /dist/difft /usr/local/bin/difft
COPY docker/.profile.d .profile.d
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
CMD yarn start