Created
August 29, 2019 10:51
-
-
Save jensneuhaus/f8ee4e6bafe0dc2d807637143683d686 to your computer and use it in GitHub Desktop.
A more simple Dockerfile
This file contains hidden or 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
| # 1 Use the Python Slim | |
| FROM python:3.7-slim | |
| # 2 Force stdin, stdout and stderr to be totally unbuffered and don´t write .pyc or .pyo files | |
| ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 | |
| # 3 Create the Working dir and the staticfiles folder | |
| RUN mkdir -p /app \ | |
| && mkdir -p /venv \ | |
| && mkdir -p /app/staticfiles | |
| # 4 Copy some required files | |
| COPY Pipfile Pipfile.lock | |
| # 5 Copy the App | |
| COPY . /app/ | |
| # 6 user django is the owner | |
| RUN chown -R django /app | |
| # 7 | |
| WORKDIR /app | |
| # 8 Run as django user | |
| USER django |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment