forked from NJUPTAAA/NOJ_JudgeServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
60 lines (54 loc) · 2.88 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM ubuntu:18.04
LABEL org.opencontainers.image.authors="zsgsdesign@gmail.com"
LABEL org.opencontainers.image.vendor="NJUPTAAA"
LABEL org.opencontainers.image.documentation="https://njuptaaa.github.io/docs/#/judgeserver/deploy"
COPY build/java_policy /etc
COPY --chmod=0755 build/nojasm-compiler /usr/bin
RUN buildDeps='software-properties-common git libtool cmake python-dev python3-pip python-pip libseccomp-dev wget ncurses-dev curl' && \
export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y \
python \
python-pkg-resources \
python3-pkg-resources \
fp-compiler \
rustc \
haskell-platform \
gcc \
g++ \
gcc-multilib \
nasm \
ruby \
mono-runtime \
mono-mcs \
iverilog \
apt-transport-https \
lsb-release \
ca-certificates \
$buildDeps && \
curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs && \
add-apt-repository ppa:deadsnakes/ppa && apt-get update && apt-get install -y python3.10 && \
add-apt-repository ppa:openjdk-r/ppa && apt-get update && apt-get install -y openjdk-8-jdk openjdk-17-jdk && \
add-apt-repository ppa:longsleep/golang-backports && apt-get update && apt-get install -y golang-go && \
add-apt-repository ppa:ondrej/php && apt-get update && apt-get install -y php8.1-cli && \
cd /tmp && wget -O FreeBASIC.tar.gz https://versaweb.dl.sourceforge.net/project/fbc/FreeBASIC-1.09.0/Binaries-Linux/ubuntu-18.04/FreeBASIC-1.09.0-ubuntu-18.04-x86_64.tar.gz && \
tar zxvf FreeBASIC.tar.gz && rm -f FreeBASIC.tar.gz && cd /tmp/FreeBASIC-1.09.0-ubuntu-18.04-x86_64 && ./install.sh -i && cd /tmp && rm -rf /tmp/FreeBASIC-1.09.0-ubuntu-18.04-x86_64 && \
pip3 install -I --no-cache-dir psutil gunicorn flask requests idna && \
cd /opt && mkdir testlib && wget -O testlib/testlib https://github.com/NJUPTAAA/testlib/raw/noj/testlib.h && \
cd /tmp && git clone --depth 1 https://github.com/NJUPTAAA/NOJ_Judger Judger && cd Judger && \
mkdir build && cd build && cmake .. && make && make install && cd ../bindings/Python && python3 setup.py install && \
apt-get purge -y --auto-remove $buildDeps && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
mkdir -p /code && \
useradd -u 12001 compiler && useradd -u 12002 code && useradd -u 12003 spj && usermod -a -G code spj
RUN ln -sfn /usr/lib/jvm/java-17-openjdk-amd64/bin/java /usr/bin/java17 && \
ln -sfn /usr/lib/jvm/java-17-openjdk-amd64/bin/javac /usr/bin/javac17 && \
ln -sfn /usr/lib/jvm/java-8-openjdk-amd64/bin/java /usr/bin/java8 && \
ln -sfn /usr/lib/jvm/java-8-openjdk-amd64/bin/javac /usr/bin/javac8
ENV NJS_VERSION v0.3.2-Triangle
ADD server /code
WORKDIR /code
RUN gcc -shared -fPIC -o unbuffer.so unbuffer.c
EXPOSE 8080
RUN chmod 744 /code/entrypoint.sh
ENTRYPOINT /code/entrypoint.sh