Move Pip Installation to `requirements.txt`
Closed this issue · 4 comments
osterman commented
what
- Move all python requirements to
requirements.txt
- Use multi-stage build pattern as described here: https://blog.realkinetic.com/building-minimal-docker-containers-for-python-applications-37d0272c52f3
FROM python:3.6-alpine as base
FROM base as builder
RUN mkdir /install
WORKDIR /install
COPY requirements.txt /requirements.txt
RUN pip install --install-option="--prefix=/install" -r /requirements.txt
FROM base
COPY --from=builder /install /usr/local
why
- Rely on python package management
- Automatic package updates by Dependabot
alebabai commented
Did you mean all pip packages in dockerfile?
osterman commented
Yes, move all pip packages in the Dockerfile
osterman commented
(also, I updated the description with requirements)