Skip to content

Instantly share code, notes, and snippets.

@regmicmahesh
Created July 5, 2022 03:46
Show Gist options
  • Save regmicmahesh/8ff3975ccb2795c06325aa6f42048b52 to your computer and use it in GitHub Desktop.
Save regmicmahesh/8ff3975ccb2795c06325aa6f42048b52 to your computer and use it in GitHub Desktop.
Django Production Ready Dockerfile
FROM python:3-alpine
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV HOME=/home/app
ENV USER=app
ENV APP_HOME=/home/app/web
RUN addgroup -S app && adduser -S app -G app
RUN mkdir -p $APP_HOME
WORKDIR $APP_HOME
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . $APP_HOME
RUN chmod +x $APP_HOME/entrypoint.sh
RUN chown -R app:app $APP_HOME
USER app
ENTRYPOINT ["/home/app/web/entrypoint.sh"]
#!/bin/sh
gunicorn django_celery.wsgi:application --bind 0.0.0.0:8000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment