Commit 32f9df2e authored by Evili del Rio's avatar Evili del Rio

Correct Dockerfile

parent e4526b8c
FROM python:3.7-alpine
ARG dev_packages="gcc g++ libc-dev libxml2-dev libxslt-dev postgresql-dev openldap-dev"
RUN mkdir -pv /app
WORKDIR /app
RUN pip install --upgrade pip
COPY requirements.txt .
RUN apk update && \
apk add bash \
${dev_packages} && \
pip install gunicorn \
psycopg2-binary psycopg2 mysql-connector \
django-heroku whitenoise[brotli] && \
pip install -r requirements.txt && \
apk del ${dev_packages} && \
rm -fr /root/.cache
ENV DJANGO_STATIC_ROOT=/static
ENV DJANGO_MEDIA_ROOT=/media
VOLUME ["/app", "/static", "/media"]
EXPOSE 5000/tcp
ENTRYPOINT ["/app/entrypoint.sh"]
#!/usr/bin/env bash
DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE:-production}
DJANGO_WSGI=${DJANGO_WSGI:-$(basename $(find . -maxdepth 2 -type f -name wsgi.py | head -1|awk -F/ '{print $2"."$3}') .py)}
python manage.py collectstatic --no-input
python manage.py migrate
LOG_LEVEL=${LOG_LEVEL:-INFO}
/usr/local/bin/gunicorn --bind 0.0.0.0:5000 --log-level=${LOG_LEVEL} \
${DJANGO_WSGI} $*
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment