-
Notifications
You must be signed in to change notification settings - Fork 25
/
Dockerfile
36 lines (28 loc) · 953 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
FROM node:10-buster
# Download and extract Sandbox RootFS (as the first-step!)
COPY sandbox-rootfs-url.txt /
RUN apt-get update && \
apt-get install -y wget && \
wget -O /sandbox-rootfs.tar.xz "$(cat /sandbox-rootfs-url.txt)" && \
tar xf /sandbox-rootfs.tar.xz -C /
# Install OS dependencies
RUN apt-get update && \
apt-get install -y build-essential libboost-all-dev
WORKDIR /app
# Install NPM dependencies
COPY package.json yarn.lock ./
RUN yarn --frozen-lockfile
# Copy code and build
COPY . .
RUN yarn build
ENV NODE_ENV=production \
SYZOJ_JUDGE_RUNNER_INSTANCE=runner \
SYZOJ_JUDGE_SANDBOX_ROOTFS_PATH=/rootfs \
SYZOJ_JUDGE_WORKING_DIRECTORY=/tmp/working \
SYZOJ_JUDGE_BINARY_DIRECTORY=/tmp/binary \
SYZOJ_JUDGE_TESTDATA_PATH=/app/testdata \
SYZOJ_JUDGE_DO_NOT_USE_X32_ABI=true
VOLUME ["/app/config", "/app/testdata"]
COPY ./docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["daemon"]