Curious about COPY here
rengler33 opened this issue · comments
Robert Engler commented
Hey Max, I'm curious about the COPY choice here
FROM base-image as production-image
COPY --from=base-image $VIRTUAL_ENVIRONMENT_PATH $VIRTUAL_ENVIRONMENT_PATH
Is there a reason to COPY --from=base-image
when the image itself is built FROM base-image
?
Max Pfeiffer commented
Hi Robert,
good point: I was already looking at this and wanted to optimise it the production-image in my next release. Here I wanted to do something like this:
FROM python:3.9.8-slim-bullseye as production-image
Reason is that you want your image to be as slim as possible. This way you leave out the Poetry installation that you don't need to have in your production image.
Regards, Max