-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (40 loc) · 1.03 KB
/
Dockerfile
File metadata and controls
50 lines (40 loc) · 1.03 KB
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
47
48
49
50
# ----------- Base image for runtime -----------
FROM node:22-bullseye AS nsjail
# Install runtime dependencies
RUN apt-get -y update && apt-get install -y \
autoconf \
bison \
flex \
gcc \
g++ \
git \
libprotobuf-dev \
libnl-route-3-dev \
libtool \
make \
pkg-config \
protobuf-compiler \
&& rm -rf /var/lib/apt/lists/*
# ----------- Build NSJail -----------
WORKDIR /nsjail
RUN git clone --branch 3.4 https://github.com/google/nsjail.git . \
&& make clean \
&& make
# ----------- Final runtime image -----------
FROM node:22-bullseye AS runtime
RUN apt-get -y update && apt-get install -y \
libprotobuf-dev \
libnl-route-3-dev \
libtool \
libc6 \
libstdc++6 \
&& rm -rf /var/lib/apt/lists/*
# Copy NSJail binary from build stage
COPY --from=nsjail /nsjail/nsjail /usr/bin/nsjail
RUN mkdir -p /var/empty
WORKDIR /app
COPY package*.json .
RUN npm ci
COPY . .
# Start the runner
CMD ["npm", "run", "start:dev"]