OnlineJudge/deploy/Dockerfile

18 lines
766 B
Docker
Raw Normal View History

2017-10-23 02:47:26 +00:00
FROM python:3.6-alpine3.6
2017-10-23 12:59:44 +00:00
ENV OJ_ENV production
2017-10-24 13:14:29 +00:00
RUN apk add --no-cache supervisor jpeg-dev zlib-dev postgresql-dev freetype-dev
2017-10-23 12:59:44 +00:00
2017-11-24 19:37:40 +00:00
ADD deploy/requirements.txt /tmp
RUN printf "https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.6/community/\nhttps://mirrors.tuna.tsinghua.edu.cn/alpine/v3.6/main/" > /etc/apk/repositories && \
apk add --update --no-cache build-base nginx openssl curl unzip && \
pip install --no-cache-dir -r /tmp/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple && \
2017-10-23 12:59:44 +00:00
apk del build-base --purge
2017-10-23 02:47:26 +00:00
2017-11-24 19:37:40 +00:00
ADD . /app
WORKDIR /app
RUN curl -L $(curl -s https://api.github.com/repos/QingdaoU/OnlineJudgeFE/releases/latest | grep /dist.zip | cut -d '"' -f 4) -o dist.zip && \
unzip dist.zip && \
rm dist.zip
2017-10-23 02:47:26 +00:00
CMD sh /app/deploy/run.sh