Commit 393e4be2 authored by Evili del Rio's avatar Evili del Rio

Use custom Docker

parent bf8ddc75
.git
*~
.env
*.sqlite3
*.pyc
FROM python:3.7-alpine
ARG dev_packages="gcc g++ libc-dev libxml2-dev libxslt-dev postgresql-dev openldap-dev"
ADD . /srv
WORKDIR /srv
RUN pip install --upgrade pip
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 ["/static", "/media"]
EXPOSE 8000/tcp
ENTRYPOINT ["./entrypoint.sh"]
#!/usr/bin/env bash
PYTHON_ENV=${PYTHON_ENV:-$(pwd)/env}
source ${PYTHON_ENV}/bin/activate
export DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE:-iiiahelpdesk.settings.production}
DJANGO_WSGI=${DJANGO_WSGI:-$(basename $(find . -maxdepth 2 -type f -name wsgi.py | head -1|awk -F/ '{print $2"."$3}') .py)}
DJANGO_GUNICORN_PORT=${DJANGO_GUNICORN_PORT:-8000}
set -e
python manage.py collectstatic --no-input
python manage.py migrate
LOG_LEVEL=${LOG_LEVEL:-INFO}
exec ${PYTHON_ENV}/bin/gunicorn --bind 0.0.0.0:${DJANGO_GUNICORN_PORT} --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