piolad / chat-app

3 stars 1 forks source link

Find a way to avoid repetition with .proto files #4

Open piolad opened 5 months ago

piolad commented 5 months ago

problem description

When using gRPC connection from 1 microservice to another, we need to have a proto file which is then compiled 2 times: for both microservices.

The action of compiling takes place during the initial start/building of the dockerfile (as far as I know). Because of that, we need to have .proto files in each directory containing the dockerfile: image image just as an example to illustrate the problem

This causes repetition problem - if we want tochange communication proto between 2 services we need to do this twice violating the DNR programming principle.

Find a way to avoid repetition (is this even possible?)

what has been tried already

  1. I have already tried having protos in the upstream directory (chat-app) and copying them during the build of the image by using COPY ../protos /home/app/protos but it is not possible because of some "context issues" - idk.
piolad commented 5 months ago

This may be helpful

https://stackoverflow.com/questions/68463928/what-is-the-best-way-to-structure-two-docker-containers-that-depend-on-common-co