CodingGarden / entropychat.app

A discord clone made by the Coding Garden Community.
https://entropychat.app
103 stars 37 forks source link

ISSUE-27: Fix docker mongo setup #28

Open carlan opened 4 years ago

carlan commented 4 years ago

This is the fix for the mongodb initialization. I haven't tested on MacOS and Windows, it's working properly on *nix based OS's.

What was done:

Fixes #27 💚

Type of change

PR Checklist:

carlan commented 4 years ago

:wave: I had some time to work on this today.

I updated this PR to undo the changes I've made previously and introduce some new files to solve the issue. It's working fine on *nix. I'm curious to see it running on Mac.

~One downside, the placeholder file docker-data/mongod.log will need to be present before hand otherwise docker will create it as a directory and we need it as a file. I had to update the gitignore and check in the docker-data and the placeholder file.~ EDIT: this isn't relevant with the latest changes.

Let me know your thoughts on it.

EDIT: I saw you had a bit of hard time understanding/remembering (no offence intended) what's going on. I should have added a comment explaining what I've done. Sorry about that. The solution I've applied for this is rudimentar simple, I believe as you wanted/mentioned on previous stream. On db container I'm exporting the mongo logs in a volume, without it the server api wouldn't have a way to check if the database is ready or not based on the string. On server api container, I'm reading the log from the same volume and waiting for the string before continue.