Sunday, 6 November 2022

Create a cloud run job which shares code with a cloud run service

I see google cloud run now has jobs which is amazing!

What I would like to achieve is to have a main container serving web traffic and also a job container which can be activated based on some business logic from the primary web service.

The part I am unsure of how to implement is to have shared code between the two containers, the service and the job.

I am assuming that I could just build the whole web service as the job container, and inside have a Procfile with:

web: python3 app/scripts/main.py

Now the script module can pull arbitrary code from app.

Would there be a better way to do this with two Dockerfiles, two stage builds etc?



from Create a cloud run job which shares code with a cloud run service

No comments:

Post a Comment