Skip to content

Instantly share code, notes, and snippets.

Last active Jun 3, 2020
What would you like to do?
Django Dockerfile
FROM python:3.8
COPY ./ /app
RUN apt-get update -q && apt-get install -qy libmariadbclient-dev && \
pip install Django
CMD ["python", "", "runserver"]
Copy link

ecelis commented Jun 3, 2020


Create an empty directory and a Dockerfile within with the above contents. Build the mydjangoapp image and then start a new Django project.

docker build -t mydjangoapp .
docker run -it -v$(pwd):/app mydjangoapp django-admin startproject app
docker run -it -v$(pwd)/app:/app -p8000:8000 mydjangoapp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment