Update oaff/testing/Dockerfile to benefit from a multistage build and decrease time taken for tests to run. Explanation from @cuttlefish in this PR:
The testing Dockerfile seems to inherit from the main image, then install a bunch of dependencies. That'll be pretty slow. All of the test requirements will need to be installed every time a single file changes in the base image.
A multistage build would be a lot faster, but I'm not sure how much time you have to put into this.
It is also worth considering a multistage build in /Dockerfile:
- The first stage would build the Python dependencies with the required OS dependencies
- The second stage would create an image containing the relevant built python dependencies, and runtime OS dependencies
curl, but none of the dependencies from the first stage (libpq-dev, python3-pip, python3-psycopg2).
Update
oaff/testing/Dockerfileto benefit from a multistage build and decrease time taken for tests to run. Explanation from @cuttlefish in this PR:It is also worth considering a multistage build in
/Dockerfile:curl, but none of the dependencies from the first stage (libpq-dev,python3-pip,python3-psycopg2).