openzim / _python-bootstrap

Sample openZIM Python project bootstrap
1 stars 1 forks source link

Split Python dependencies installation from project installation in Docker build #28

Closed benoit74 closed 9 months ago

benoit74 commented 9 months ago

In current Dockerfile, program and its dependencies are installed in the same layer: https://github.com/openzim/_python-bootstrap/blob/c02d44f76f0bdb85f78998ec0ffc13fb38b8a5a0/Dockerfile#L17-L19

This layer is rebuild everytime code, config or documentation are changed : https://github.com/openzim/_python-bootstrap/blob/c02d44f76f0bdb85f78998ec0ffc13fb38b8a5a0/Dockerfile#L13-L15

However:

Rebuilding this layer everytime code change looks like a waste of time (especially for the developer, but also in terms of computing resources) and storage (we re-upload the whole layer to ghcr.io everytime the branch is modified in a pull request and intermediate image versions might be kept on the developer machine).