Created
July 5, 2022 03:46
-
-
Save regmicmahesh/8ff3975ccb2795c06325aa6f42048b52 to your computer and use it in GitHub Desktop.
Django Production Ready Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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