Skip to content

Instantly share code, notes, and snippets.

@11philip22
Created January 14, 2021 09:51
Show Gist options
  • Save 11philip22/587a48af8f59930d5a6f135e267b9c9b to your computer and use it in GitHub Desktop.
Save 11philip22/587a48af8f59930d5a6f135e267b9c9b to your computer and use it in GitHub Desktop.
Docker pip multistage container
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