Skip to content

Commit

Permalink
Merge pull request #90 from QingdaoU/update_dockerfile
Browse files Browse the repository at this point in the history
update Dockerfile to reduce image size
  • Loading branch information
virusdefender authored Aug 11, 2017
2 parents cda6099 + 79dfaa5 commit b5007be
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 59 deletions.
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
docker build -t registry.cn-hangzhou.aliyuncs.com/qduoj/oj_web_server -f dockerfiles/oj_web_server/Dockerfile .
docker build -t registry.cn-hangzhou.aliyuncs.com/qduoj/judger -f dockerfiles/judger/Dockerfile .
38 changes: 30 additions & 8 deletions dockerfiles/judger/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,37 @@
FROM ubuntu:16.04
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get -y install software-properties-common python-software-properties python python-dev gcc g++ git libtool python-pip libseccomp-dev
RUN add-apt-repository -y ppa:webupd8team/java && echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections
RUN apt-get update && apt-get install -y oracle-java8-installer
RUN cd /tmp && git clone -b master https://github.com/QingdaoU/Judger && cd Judger && python setup.py install
RUN mkdir -p /var/judger/run/ && mkdir /var/judger/test_case/ && mkdir /var/judger/code/
RUN chmod -R 777 /var/judger/run/
COPY dockerfiles/judger/policy /var/judger/run/
RUN apt-get update \
&& buildDeps=' \
software-properties-common \
python-software-properties \
python-dev \
git \
libtool \
python-pip \
libtool \
libseccomp-dev' \
&& apt-get -y install python gcc g++ python-pkg-resources $buildDeps\
&& add-apt-repository -y ppa:webupd8team/java \
&& echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections \
&& echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections \
&& apt-get update \
&& apt-get install -y oracle-java8-installer \
&& cd /tmp \
&& git clone -b master https://github.com/QingdaoU/Judger \
&& cd Judger \
&& python setup.py install \
&& pip install supervisor \
&& apt-get purge -y --auto-remove $buildDeps \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir -p /var/judger/run/ \
&& mkdir /var/judger/test_case/ \
&& mkdir /var/judger/code/ \
&& chmod -R 777 /var/judger/run/
COPY dockerfiles/judger/policy /var/judger/run
COPY dockerfiles/judger/supervisord.conf /etc
RUN pip install supervisor
ADD . /var/judger/code
WORKDIR /var/judger/code/judge/
EXPOSE 8080
CMD bash /var/judger/code/dockerfiles/judger/run.sh

11 changes: 0 additions & 11 deletions dockerfiles/judger/docker-compose.example.yml

This file was deleted.

10 changes: 6 additions & 4 deletions dockerfiles/oj_web_server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
FROM ubuntu:16.04
ENV PYTHONBUFFERED 1
RUN apt-get update && apt-get install -y nginx python-pip libmysqlclient-dev curl nodejs
RUN curl -sL https://deb.nodesource.com/setup | bash -
RUN apt-get install nodejs
ADD . /code
WORKDIR /code
RUN pip install -i https://pypi.douban.com/simple -r dockerfiles/oj_web_server/requirements.txt
RUN apt-get update \
&& apt-get install --no-install-recommends -y nginx python-pip \
nodejs libmysqlclient-dev python-setuptools build-essential python-dev \
&& pip install -i https://pypi.douban.com/simple -r dockerfiles/oj_web_server/requirements.txt \
&& apt-get purge -y --auto-remove build-essential python-dev\
&& rm -rf /var/lib/apt/lists/*
RUN python tools/release_static.py
CMD bash /code/dockerfiles/oj_web_server/run.sh
10 changes: 0 additions & 10 deletions dockerfiles/oj_web_server/docker-compose-nginx.example.yml

This file was deleted.

26 changes: 0 additions & 26 deletions dockerfiles/oj_web_server/docker-compose.example.yml

This file was deleted.

0 comments on commit b5007be

Please sign in to comment.