Closed alicesf2 closed 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
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.
Resolves #367
docker-compose.yml
filedotenv yarn populatedb