Last active
June 2, 2024 09:39
-
-
Save cse031sust02/f149d809d50116e7890691d73922d379 to your computer and use it in GitHub Desktop.
Basic Dockerfile for Django using Pipenv
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
# My Django Project | |
# Version: 1.0 | |
# FROM - Image to start building on. | |
FROM python:3 | |
# PROJECT SETUP | |
# ---------------- | |
# sets the working directory | |
WORKDIR /usr/src/django-docker | |
# copy these two files from <src> to <dest> | |
# <src> = current directory on host machine | |
# <dest> = filesystem of the container | |
COPY Pipfile Pipfile.lock ./ | |
# install pipenv on the container | |
RUN pip install -U pipenv | |
# install project dependencies | |
RUN pipenv install --system | |
# copy all files and directories from <src> to <dest> | |
COPY . . | |
# RUN SERVER | |
# ------------ | |
# expose the port | |
EXPOSE 8000 | |
# Command to run | |
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@cse031sust02
Thanks for sharing this gist ❤️