Dockerfile 996 Bytes
Newer Older
Evili del Rio's avatar
Evili del Rio committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
FROM python:alpine

#ARG dev_packages="gcc g++ libc-dev libxml2-dev libxslt-dev postgresql-dev openldap-dev \
#                  jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev"

ARG dev_packages="gcc g++ libc-dev postgresql-dev"
ARG lib_packages="git postgresql-libs"
ARG django_version=">2.2,<2.3"
RUN mkdir -pv /app
RUN mkdir -pv /settings

WORKDIR /app

RUN pip install --upgrade pip
RUN apk update && \
      apk add bash \
      ${lib_packages} \
      ${dev_packages} && \
      pip install gunicorn \
        "django${django_version}" \
21
        django-health-check dj-database-url \
Evili del Rio's avatar
Evili del Rio committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35
        psycopg2-binary mysql-connector whitenoise[brotli] && \
      apk del ${dev_packages} && \
      apk add ${lib_packages} && \
      rm -fr /root/.cache

ENV DJANGO_STATIC_ROOT=/static
ENV DJANGO_MEDIA_ROOT=/media

VOLUME ["/static", "/media", "/app"]

EXPOSE 5000/tcp

COPY environment_settings.py /
COPY entrypoint.sh /
Evili del Rio's avatar
Evili del Rio committed
36
COPY health_urls.py /settings
Evili del Rio's avatar
Evili del Rio committed
37 38

ENTRYPOINT ["/entrypoint.sh"]