rita icon indicating copy to clipboard operation
rita copied to clipboard

Bug using docker-compose service linking

Open Korving-F opened this issue 2 years ago • 1 comments

In the repository's docker-compose.yml file an aliasing trick is used so that the default rita.yaml config works out-of-the-box. This linking seems to generally work as intended with other aliases, except for the use of localhost and therefore the backend connection still breaks with an Failed to connect to database: no reachable servers-error. Not sure how to properly fix it, or what the underlying root cause exactly is though.

I tested this with Docker Compose version v2.17.3, docker version 24.0.2. Rita version v4.8.0.

# docker-compose.yaml
links:
 # give db an alias of "localhost" so that RITA's default config works unchanged
 - db:localhost
# rita.yaml
MongoDB:
  # See https://docs.mongodb.com/manual/reference/connection-string/
  ConnectionString: mongodb://localhost:27017

Korving-F avatar Jun 21 '23 12:06 Korving-F