Add mongo service to Docker Compose#26
Merged
Merged
Conversation
- Rename the `db` service to `postgres`.
- Add `mongo` service to docker-compose
- Add a bridge network and a named `mongo_data` volume to
Mongo data.
- Add Mongo-specific environment variables to `.env.example`:
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the local Docker Compose development setup to include a MongoDB service alongside Postgres, and updates application/config/docs so the app can connect to MongoDB via environment variables.
Changes:
- Add a
mongoservice (with healthcheck, init dir, and persistent volume) and rename the existingdbservice topostgresindocker-compose.yaml. - Introduce MongoDB environment variables in
.env.exampleand wire MongoDB connection settings into Spring Boot config. - Expand README instructions for cloning, configuring
.env, and managing Postgres/MongoDB via Docker Compose.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
src/main/resources/application.yaml |
Adds spring.data.mongodb.uri configuration using environment variables. |
docker-compose.yaml |
Renames Postgres service and introduces a MongoDB service, network, and volume. |
.env.example |
Adds MongoDB-related environment variables and updates comments/instructions. |
README.md |
Replaces placeholder install section with Docker Compose usage and DB lifecycle commands. |
docker/mongo/init/.gitkeep |
Adds init directory placeholder for MongoDB entrypoint scripts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Update sections about how to run the app and start all the services/container - Add sections about how to start / stop / remove the Postgres database
- Make postgres and mongo use network net (learn-dev-net) - Rename postgres volume to pg_data (was pgdata) - Fix mongo mapping to always explicit use host:port form - Ensure mongo init DB uses LEARNDEV_MONGO_DB_NAME (renamed variable)
7e0f4ed to
fe31c91
Compare
Owner
Author
|
Closes #25 |
17 tasks
17 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mongo) to docker-composedbservice topostgresmongo_datavolume to persist MongoDB data