Reuse image build across multiple different services
haruki-nikaidou
PROOP

a month ago

Similar thread, but not truely solved: https://station.railway.com/questions/question-about-reuse-image-for-deploy-2b86e1f0

For some single-entry microservice project, this thing can happen: Different services use exactly same binary file (and same docker image). The environment variable determine the behavior of the program. For example, when WORKER_MODE is "api" , it listen to a port and handle HTTP request, meanwhile when WORKER_MODE is "consumer" , it only consume events from MQ.

Putting them into one single service cannot solve the issue, as it's impossible to set different environment variable to one service.

Also, build image at GitHub action is not really a solution. For this kind of project, it's always that the building is time consuming. Railway provides much better performance than Github Action runner, but, you cannot build docker image inside a Railway deployment. (https://docs.railway.com/tutorials/github-actions-runners#known-limitations)

Under Review

0 Threads mention this feature

0 Replies

Loading...