2017-08-22 21:15:30 +00:00
|
|
|
FROM alpine:3.6
|
|
|
|
|
|
|
|
ENV APPS_DIR /opt/apps
|
|
|
|
ENV DB_DIR $APPS_DIR/db
|
|
|
|
ENV STATIC_ROOT $APPS_DIR/static
|
|
|
|
|
|
|
|
COPY requirements.txt $APPS_DIR/
|
|
|
|
|
|
|
|
WORKDIR $APPS_DIR
|
|
|
|
|
2017-08-23 10:59:17 +00:00
|
|
|
# uWSGI requires linux-headers
|
2017-08-25 12:08:01 +00:00
|
|
|
# django-split-settings needs ca-certificates as they changed on PyPi
|
2017-08-22 21:15:30 +00:00
|
|
|
RUN set -ex \
|
|
|
|
&& buildDeps=' \
|
|
|
|
build-base \
|
2017-08-25 12:08:01 +00:00
|
|
|
ca-certificates \
|
2017-08-23 10:59:17 +00:00
|
|
|
linux-headers \
|
2017-08-22 21:15:30 +00:00
|
|
|
python3-dev \
|
|
|
|
' \
|
|
|
|
&& apk --no-cache --update add \
|
2017-08-25 12:14:01 +00:00
|
|
|
gettext \
|
2017-08-22 21:15:30 +00:00
|
|
|
mailcap \
|
|
|
|
python3 \
|
|
|
|
$buildDeps \
|
|
|
|
&& pip3 install --no-cache-dir --upgrade pip \
|
|
|
|
&& pip3 install --no-cache-dir --upgrade -r requirements.txt \
|
|
|
|
&& apk del $buildDeps \
|
|
|
|
&& rm -rf /var/cache/apk/*
|
|
|
|
|
2017-08-23 10:59:17 +00:00
|
|
|
COPY ./collection .
|
2017-08-22 21:15:30 +00:00
|
|
|
|
|
|
|
VOLUME $DB_DIR
|
|
|
|
|
2017-08-23 10:59:17 +00:00
|
|
|
COPY ./docker-entrypoint.sh .
|
|
|
|
COPY ./uwsgi.ini .
|
|
|
|
ENTRYPOINT ["./docker-entrypoint.sh"]
|
|
|
|
|
2017-08-22 21:15:30 +00:00
|
|
|
EXPOSE 8000
|
2017-08-23 10:59:17 +00:00
|
|
|
CMD ["prod"]
|