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.
env changes
Docker Compose Configuration:
docker-compose.yml
: Addeddepends_on
forquestion-service
anduser-service
to ensure MongoDB services are started before these services. Added configurations formongodb-question
andmongodb-user
services, including ports and volume mappings. [1] [2]Initialization Scripts:
init-mongo-scripts/init-mongo-questions.sh
: Added a script to initialize thequestion_service
database with 20 sample questions covering various categories and complexities.init-mongo-scripts/init-mongo-user.sh
: Added a script to initialize theuser_service
database with two user accounts: an admin user and a non-admin user, including their hashed passwords.There is one mongo image for each backend service to decrease coupling.
to connect locally on compass use these urls
mongodb://localhost:27017
mongodb://localhost:27018
LIMITATIONS:
THIS AINT GONNA SAVE YOU FROM DELETING THE ONLY ADMIN ACCOUNT.
DOCKER ISNT GOING TO SPAWN A NEW ADMIN JUST BECAUSE YOU DELETED IT.
TO SOLVE IT:
docker-compose down -v # Stops containers and removes volumes
docker-compose up --build # Rebuilds and starts the containers