Skip to content

Instantly share code, notes, and snippets.

@FGtatsuro
Created August 7, 2018 10:01
Show Gist options
  • Save FGtatsuro/717f492277c9be2e3bf19e94226a5c9c to your computer and use it in GitHub Desktop.
Save FGtatsuro/717f492277c9be2e3bf19e94226a5c9c to your computer and use it in GitHub Desktop.
Dockerfile template for Python
# FYI:
# - https://docs.docker.com/engine/reference/builder/
# - https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
# - https://hub.docker.com/_/python/
FROM python:3.7
# Backward compatibility with deprecate onbuild image.
# FYI: https://github.com/docker-library/python/pull/314/files#diff-7531449f9a1a85f134eba7d960a91c91L1
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY requirements.txt /usr/src/app/
RUN pip install --no-cache-dir -r requirements.txt
COPY . /usr/src/app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment