2020-05-01 15:40:16 +00:00
|
|
|
FROM ubuntu:20.04
|
2017-11-25 04:00:00 +00:00
|
|
|
MAINTAINER MascoSkray <MascoSkray@gmail.com>
|
2019-04-18 14:20:16 +00:00
|
|
|
ARG CLONE_ADDFLAG
|
2017-11-25 04:00:00 +00:00
|
|
|
|
2019-07-15 08:32:05 +00:00
|
|
|
WORKDIR /opt
|
2021-01-23 17:41:30 +00:00
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
2017-11-25 04:00:00 +00:00
|
|
|
#Update apt and install git
|
2021-01-25 20:23:21 +00:00
|
|
|
RUN apt-get update && apt-get install -y apache2 cmake curl fp-compiler g++ git gnupg libapache2-mod-php libapache2-mod-xsendfile libyaml-dev make mysql-server ntp openjdk-11-jdk openjdk-8-jdk php php-dev php-mbstring php-mysql php-pear php-zip python python3 python3-requests re2c unzip vim wget zip --no-install-recommends
|
2017-11-25 04:00:00 +00:00
|
|
|
#Clone the latest UOJ Community verison to local
|
2019-07-16 02:43:02 +00:00
|
|
|
RUN git clone https://github.com/UniversalOJ/UOJ-System.git --depth 1 --single-branch ${CLONE_ADDFLAG} uoj
|
2017-11-25 04:00:00 +00:00
|
|
|
#Install environment and set startup script
|
2019-07-16 02:43:02 +00:00
|
|
|
RUN cd uoj/install/bundle && sh install.sh -p && echo "\
|
2018-12-15 11:55:03 +00:00
|
|
|
#!/bin/sh\n\
|
2021-07-27 09:09:06 +00:00
|
|
|
rm -rf /run/mysqld/*\n\
|
2018-10-10 15:50:50 +00:00
|
|
|
chown -R mysql:mysql /var/lib/mysql /var/run/mysqld\n\
|
2019-07-15 08:32:05 +00:00
|
|
|
if [ ! -f \"/var/uoj_data/.UOJSetupDone\" ]; then\n\
|
2019-07-16 02:43:02 +00:00
|
|
|
cd /opt/uoj/install/bundle && sh install.sh -i\n\
|
2017-11-25 04:00:00 +00:00
|
|
|
fi\n\
|
|
|
|
service ntp start\n\
|
|
|
|
service mysql start\n\
|
|
|
|
service apache2 start\n\
|
2019-07-16 02:43:02 +00:00
|
|
|
su local_main_judger -c \"/opt/uoj/judger/judge_client start\"\n\
|
2019-07-15 08:32:05 +00:00
|
|
|
exec bash\n" >/opt/up && chmod +x /opt/up
|
2017-11-25 04:00:00 +00:00
|
|
|
|
|
|
|
ENV LANG=C.UTF-8 TZ=Asia/Shanghai
|
|
|
|
EXPOSE 80 3690
|
2019-07-15 08:32:05 +00:00
|
|
|
CMD /opt/up
|