Closed JOT85 closed 2 years ago
In 9cac6c424b1822be2eac9b23752518a369903acc, the base image was changed to python:3.7-slim-stretch
. Commit bf22f4ea446d62e17e9cec5b8c1bfd50994fecea fixed the error when using python:3.7-slim
. I still think it's a good idea to explicitly mention the version though. We could switch to bullseye? Stretch is supported until June 30, 2022.
Super awesome PR and many thanks for this, really appreciate it!
This is a prerequisite to the next PR (#748), it's just some small changes I made for quality of life when developing and a bit of tidying up.
Dockerfile layer order
The first main change is the reording of the layers in the skf-api Dockerfile. The new order adds the code add the end of the build meaning that, when the cache is used, only the last couple of layers need to be updated instead of the many that were updated before. This also makes pushing updated images much faster.
Exclude Angular2 directory
I also added a dockerignore file only for the skf-api build to exclude the Angular2 directory. To use Dockerfile specific dockerignore files, you need to set DOCKER_BUILDKIT=1, as explained in the comment at the bottom of the Dockerfile. The build still works without it, it just won't exclude the files which was the behaviour before.
Perhaps we should manually list the directories we want to include, instead of listing those to be excluded? That seems like the right way round to do this?
Remove duplicated code
The second change was to break out the deployment and deletion functions into a separate python file, so that they aren't duplicated.