I finally took the time to implement this!
I implemented the image build using a gitlab-ci pipeline that runs postgres and redis as services during the build and discards them afterwards:
Now I only have to automated the deployment with the DB migrations