Skip to content

Instantly share code, notes, and snippets.

@youngsoul
Last active September 2, 2021 17:11
Show Gist options
  • Select an option

  • Save youngsoul/63e78454199f8290217fab6cb930eae9 to your computer and use it in GitHub Desktop.

Select an option

Save youngsoul/63e78454199f8290217fab6cb930eae9 to your computer and use it in GitHub Desktop.
Docker file to dockerize a Python project directory
# pull official base image
FROM python:3.9.6
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set working directory
WORKDIR /code
# Install Dependencies
RUN pip install --upgrade pip
COPY requirements.txt /code/
RUN pip install -r requirements.txt
# Copy project code from local into container
COPY . /code/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment