S2OJ/install/bundle/Dockerfile
Masco Skray eff4c8ed9c style(install/bundle): make install script dash compatible
We wrote the script that can only be executed on bash.
But Ubuntu sets dash as its default shell environment.
One of the most difference is the POSIX standard echo,
another is parameter of chown can't be put to the end.
So we made some changes to let the script used widely.
And you will not face the syntax error when open this.
2018-12-15 19:57:57 +08:00

25 lines
826 B
Docker

FROM ubuntu:18.04
MAINTAINER MascoSkray <MascoSkray@gmail.com>
#Update apt and install git
RUN apt-get update && apt-get install -y git gnupg
#Clone the latest UOJ Community verison to local
RUN cd ~ && git clone https://github.com/UniversalOJ/UOJ-System.git --depth 1
#Install environment and set startup script
RUN cd ~/UOJ-System/install/bundle && sh install.sh -e && echo "\
#!/bin/sh\n\
chown -R mysql:mysql /var/lib/mysql /var/run/mysqld\n\
if [ ! -f \"/var/svn/.UOJSetupDone\" ]; then\n\
cd ~/UOJ-System/install/bundle && sh install.sh -c\n\
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