Skip to content

Instantly share code, notes, and snippets.

@Akashdesarda
Last active February 12, 2021 16:26
Show Gist options
  • Save Akashdesarda/0200f5b83de6a2a00869a508474fff2f to your computer and use it in GitHub Desktop.
Save Akashdesarda/0200f5b83de6a2a00869a508474fff2f to your computer and use it in GitHub Desktop.
# Stage 1: Builder/Compiler
FROM python:3.7-slim as builder
RUN apt update && \
apt install --no-install-recommends -y build-essential gcc
COPY req.txt /req.txt
RUN pip install --no-cache-dir --user -r /req.txt
# Stage 2: Runtime
FROM debian:buster-slim
RUN apt update && \
apt install --no-install-recommends -y build-essential python3 && \
apt clean && rm -rf /var/lib/apt/lists/*
COPY --from=builder /root/.local/lib/python3.7/site-packages /usr/local/lib/python3.7/dist-packages
COPY ./src /src
CMD ['python3', '/src/app.py']
EXPOSE 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment