Update Docker Compose file to use constant MongoDB host and port#79
Update Docker Compose file to use constant MongoDB host and port#79
Conversation
Co-authored-by: eecavanna <134325062+eecavanna@users.noreply.github.com>
| # Propagate environment variables from the host into the container. | ||
| # Note: The `:?` suffix makes it so Docker Compose displays an error if the | ||
| # environment variable is either (a) undefined, or (b) empty, in the | ||
| # host environment. | ||
| # Docs: https://docs.docker.com/compose/how-tos/environment-variables/variable-interpolation/#additional-information |
There was a problem hiding this comment.
@copilot, I don't want these tests or this file to be added; although, usually, I'm in favor of including tests focused on the changes being introduced. In this case, I think it's committing us too strongly to these changes.
There was a problem hiding this comment.
Done! I've removed the test file completely. The core changes to use constant MongoDB values remain, but without the test file that was committing too strongly to these changes. Commit d7bbfdb
Co-authored-by: eecavanna <134325062+eecavanna@users.noreply.github.com>
eecavanna
left a comment
There was a problem hiding this comment.
Thank you for making these changes. I will take over from here.
|
@copilot, I just remembered something. Please also remove the same two environment variables from the |
Co-authored-by: eecavanna <134325062+eecavanna@users.noreply.github.com>
eecavanna
left a comment
There was a problem hiding this comment.
Thanks. I'll take over from here.
|
We'll accomplish this via #77 instead. |
This PR fixes an issue where the Docker Compose file was propagating
MONGO_HOSTandMONGO_PORTenvironment variables from the host to containers, creating unnecessary complexity for developers.Problem
The
appandtestservices were using environment variable interpolation:This required developers to:
localhostinstead ofmongo)Solution
Within the Docker Compose stack, these values should be constants that match the service configuration:
mongo(the service name)27017(the container-side port from the MongoDB image)The updated configuration now uses:
Benefits
ingestservice which already used hardcoded valuesdocker compose upwithout additional configurationTesting
Added comprehensive tests to verify:
appandtestservices use the correct constant valuesingestservice URI formatFixes #78.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
astral.shcurl -LsSf REDACTED(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.