Skip to content

Instantly share code, notes, and snippets.

@bsolomon1124
Created March 23, 2020 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bsolomon1124/55c7a2b7bafd6a84206240012c94b3e8 to your computer and use it in GitHub Desktop.
Save bsolomon1124/55c7a2b7bafd6a84206240012c94b3e8 to your computer and use it in GitHub Desktop.
Minimalistic Dockerfile for testing small Django features & quirks
FROM python:3.8-slim-buster
ARG DJANGO_VERSION='3.*'
ARG PROJECT_NAME='project'
ARG APP_NAME='app'
RUN set -ex \
&& python3 -m pip install --upgrade --no-cache-dir pip "Django==${DJANGO_VERSION}" \
&& django-admin startproject ${PROJECT_NAME} \
&& cd ${PROJECT_NAME} || exit 1 \
&& django-admin startapp ${APP_NAME} \
&& python3 manage.py migrate
WORKDIR "/$PROJECT_NAME"
CMD ["/bin/bash"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment