2022-10-04 12:57:49 +00:00
|
|
|
FROM ubuntu:22.04
|
2022-03-16 09:00:39 +00:00
|
|
|
|
|
|
|
ARG CLONE_ADDFLAG
|
|
|
|
|
2022-09-18 11:55:54 +00:00
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
RUN dpkg -s gnupg 2>/dev/null || (apt-get update && apt-get install -y gnupg) &&\
|
2022-10-04 12:57:49 +00:00
|
|
|
echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu jammy main" | tee /etc/apt/sources.list.d/ondrej-php.list && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C &&\
|
|
|
|
apt-get update --allow-unauthenticated &&\
|
2022-10-09 23:35:48 +00:00
|
|
|
apt-get install -y --allow-unauthenticated -o Dpkg::Options::="--force-overwrite" php7.4 php7.4-yaml php7.4-xml php7.4-dev php7.4-zip php7.4-mysql php7.4-mbstring php7.4-gd libseccomp-dev git vim ntp zip unzip curl wget libapache2-mod-xsendfile mysql-server php-pear cmake fp-compiler re2c libyaml-dev python2.7 python3.10 python3-requests openjdk-8-jdk openjdk-11-jdk openjdk-17-jdk
|
2022-09-18 11:55:54 +00:00
|
|
|
|
2022-09-19 07:04:45 +00:00
|
|
|
ADD . /opt/uoj
|
|
|
|
WORKDIR /opt/uoj
|
|
|
|
|
2022-03-16 09:00:39 +00:00
|
|
|
# Install environment and set startup script
|
|
|
|
RUN sh web/install.sh -p && echo "\
|
|
|
|
#!/bin/sh\n\
|
|
|
|
if [ ! -f \"/var/uoj_data/.UOJSetupDone\" ]; then\n\
|
|
|
|
cd /opt/uoj/web && sh install.sh -i\n\
|
|
|
|
fi\n\
|
|
|
|
service ntp start\n\
|
|
|
|
service apache2 start\n\
|
2022-09-20 06:53:59 +00:00
|
|
|
cd /opt/uoj/web && sh install.sh -d\n\
|
2022-03-16 09:00:39 +00:00
|
|
|
exec bash\n" >/opt/up && chmod +x /opt/up
|
|
|
|
|
|
|
|
ENV LANG=C.UTF-8 TZ=Asia/Shanghai
|
2022-09-18 02:34:20 +00:00
|
|
|
EXPOSE 80
|
2022-03-16 09:00:39 +00:00
|
|
|
CMD /opt/up
|