2018-09-20 14:05:15 +00:00
|
|
|
FROM ubuntu:18.04
|
2017-11-25 04:00:00 +00:00
|
|
|
MAINTAINER MascoSkray <MascoSkray@gmail.com>
|
|
|
|
|
|
|
|
#Update apt and install git
|
2018-09-20 14:05:15 +00:00
|
|
|
RUN apt-get update && apt-get install -y git gnupg
|
2017-11-25 04:00:00 +00:00
|
|
|
#Clone the latest UOJ Community verison to local
|
2018-12-15 05:15:01 +00:00
|
|
|
RUN cd ~ && git clone https://github.com/UniversalOJ/UOJ-System.git --depth 1
|
2017-11-25 04:00:00 +00:00
|
|
|
#Install environment and set startup script
|
|
|
|
RUN cd ~/UOJ-System/install/bundle && bash install.sh -e && echo "\
|
|
|
|
#!/bin/bash\n\
|
2018-10-10 15:50:50 +00:00
|
|
|
chown -R mysql:mysql /var/lib/mysql /var/run/mysqld\n\
|
|
|
|
if [ ! -f \"/var/svn/.UOJSetupDone\" ]; then\n\
|
2018-09-20 14:05:15 +00:00
|
|
|
cd ~/UOJ-System/install/bundle && bash install.sh -c\n\
|
2017-11-25 04:00:00 +00:00
|
|
|
fi\n\
|
|
|
|
service ntp start\n\
|
|
|
|
service mysql start\n\
|
|
|
|
service apache2 start\n\
|
|
|
|
svnserve -d -r /var/svn\n\
|
|
|
|
su local_main_judger -c \"~/judge_client/judge_client start\"\n\
|
|
|
|
exec bash\n" >/root/up && chmod +x /root/up
|
|
|
|
|
|
|
|
ENV LANG=C.UTF-8 TZ=Asia/Shanghai
|
|
|
|
EXPOSE 80 3690
|
|
|
|
CMD /root/up
|