hack4impact-uiuc / h4i-recruitment

H4I recruitment platform
https://h4i-recruitment.vercel.app
15 stars 3 forks source link

Dockerize Mongo #369

Closed alicesf2 closed 4 years ago

alicesf2 commented 4 years ago

Resolves #367

vercel[bot] commented 4 years ago

This pull request is being automatically deployed with Vercel (learn more). To see the status of your deployment, click below or on the icon next to each commit.

๐Ÿ” Inspect: https://vercel.com/hack4impact/h4i-recruitment/ngvqrzrgy โœ… Preview: https://h4i-recruitment-git-af-dockerize-mongo.hack4impact1.vercel.app

josh-byster commented 4 years ago

Looks great, Alice! ๐Ÿš€

Small thing: to allow us to populate the DB and have the full "Docker experience", let's do as much as we can inside the Docker container itself. Hence it would make sense to spin up a container and seed the database from inside that container. To do this we can change the populatedb script in the package JSON file to docker-compose run backend node src/utils/populate.js, which will spin up a container, run the same command inside the container, and then remove the container.

This way, the user doesn't even need NodeJS installed on their machine to run our appโ€”it runs within the docker container which is created from the NodeJS image and hence already has node installed.