Skip to content

Instantly share code, notes, and snippets.

@twyle
Created June 1, 2022 06:29
Show Gist options
  • Save twyle/6e2ebd7164f32549c3fafb26565b189b to your computer and use it in GitHub Desktop.
Save twyle/6e2ebd7164f32549c3fafb26565b189b to your computer and use it in GitHub Desktop.
FROM python:3-slim AS builder
ADD . /app
WORKDIR /app
# We are installing a dependency here directly into our app source dir
RUN /usr/local/bin/python -m pip install --upgrade pip
RUN pip install --target=/app -r requirements.txt
# A distroless container image with Python and some basics like SSL certificates
# https://github.com/GoogleContainerTools/distroless
FROM gcr.io/distroless/python3-debian10
COPY --from=builder /app /app
WORKDIR /app
ENV PYTHONPATH /app
CMD ["/app/main.py"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment