Created
January 14, 2021 09:51
-
-
Save 11philip22/587a48af8f59930d5a6f135e267b9c9b to your computer and use it in GitHub Desktop.
Docker pip multistage container
This file contains hidden or 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
FROM python:alpine as base | |
FROM base as builder | |
RUN mkdir /install | |
WORKDIR /install | |
COPY requirements.txt /requirements.txt | |
RUN pip install --no-warn-script-location --prefix=/install -r /requirements.txt | |
FROM base | |
COPY --from=builder /install /usr/local | |
RUN mkdir -p /crawler/logs | |
COPY main.py /crawler/main.py | |
WORKDIR /crawler | |
CMD ["python", "main.py"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment