-
Notifications
You must be signed in to change notification settings - Fork 428
/
Dockerfile.backend
44 lines (39 loc) · 1.11 KB
/
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
41
42
43
44
ARG ARCH=x86_64
ARG TURBO_TEAM
ARG TURBO_TOKEN
FROM node:22 as pruner
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
ARG TURBO_TEAM
ARG TURBO_TOKEN
RUN corepack enable
WORKDIR /src/
COPY . .
RUN pnpm add -g turbo
RUN turbo prune --docker @l2beat/backend
FROM node:22 as builder
ARG ARCH
ARG TURBO_TEAM
ARG TURBO_TOKEN
RUN corepack enable
WORKDIR /src/
COPY --from=pruner /src/out/json/ .
RUN pnpm install
COPY --from=pruner /src/out/full/ ./
RUN pnpm 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:22-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 cd packages/backend && node -r source-map-support/register build/src/index.js