2020-07-08 01:30:49 +00:00
|
|
|
FROM ubuntu:18.04
|
2017-10-31 11:51:42 +00:00
|
|
|
|
2017-11-25 11:43:26 +00:00
|
|
|
COPY build/java_policy /etc
|
2021-09-27 08:49:38 +00:00
|
|
|
#RUN sed -E -i -e 's/(archive|ports).ubuntu.com/mirrors.aliyun.com/g' -e '/security.ubuntu.com/d' /etc/apt/sources.list
|
2021-05-08 12:39:49 +00:00
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
RUN buildDeps='software-properties-common git libtool cmake python-dev python3-pip python-pip libseccomp-dev curl' && \
|
2021-08-07 05:30:20 +00:00
|
|
|
apt-get update && apt-get install -y python python3 python-pkg-resources python3-pkg-resources $buildDeps && \
|
|
|
|
add-apt-repository ppa:openjdk-r/ppa && add-apt-repository ppa:longsleep/golang-backports && \
|
|
|
|
add-apt-repository ppa:ubuntu-toolchain-r/test && \
|
2021-05-08 12:39:49 +00:00
|
|
|
add-apt-repository ppa:ondrej/php && \
|
|
|
|
curl -fsSL https://deb.nodesource.com/setup_14.x | bash - && \
|
|
|
|
apt-get update && apt-get install -y golang-go openjdk-11-jdk php-cli nodejs gcc-9 g++-9 && \
|
2021-08-07 05:30:20 +00:00
|
|
|
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 40 && \
|
|
|
|
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 40 && \
|
2021-05-08 12:39:49 +00:00
|
|
|
phpJitOption='opcache.enable=1\nopcache.enable_cli=1\nopcache.jit=1205\nopcache.jit_buffer_size=64M' && \
|
|
|
|
echo $phpJitOption > /etc/php/8.0/cli/conf.d/10-opcache-jit.ini && \
|
2021-09-27 08:49:38 +00:00
|
|
|
pip3 install -i https://mirrors.aliyun.com/pypi/simple/ -I --no-cache-dir psutil gunicorn flask requests idna && \
|
|
|
|
cd /tmp && git clone -b newnew --depth 1 https://gitee.com/qduoj/Judger.git && cd Judger && \
|
2018-03-18 00:19:44 +00:00
|
|
|
mkdir build && cd build && cmake .. && make && make install && cd ../bindings/Python && python3 setup.py install && \
|
2017-10-31 11:51:42 +00:00
|
|
|
apt-get purge -y --auto-remove $buildDeps && \
|
2018-05-05 06:59:20 +00:00
|
|
|
apt-get clean && rm -rf /var/lib/apt/lists/* && \
|
2018-10-14 13:50:20 +00:00
|
|
|
mkdir -p /code && \
|
|
|
|
useradd -u 12001 compiler && useradd -u 12002 code && useradd -u 12003 spj && usermod -a -G code spj
|
2018-03-18 00:19:44 +00:00
|
|
|
HEALTHCHECK --interval=5s --retries=3 CMD python3 /code/service.py
|
2017-11-25 11:43:26 +00:00
|
|
|
ADD server /code
|
2016-10-03 09:30:58 +00:00
|
|
|
WORKDIR /code
|
2018-12-12 06:38:29 +00:00
|
|
|
RUN gcc -shared -fPIC -o unbuffer.so unbuffer.c
|
2016-10-03 09:30:58 +00:00
|
|
|
EXPOSE 8080
|
2017-12-22 06:02:37 +00:00
|
|
|
ENTRYPOINT /code/entrypoint.sh
|