Last active
February 12, 2021 16:26
-
-
Save Akashdesarda/0200f5b83de6a2a00869a508474fff2f to your computer and use it in GitHub Desktop.
This file contains 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
# 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