Erik Näslund
05/22/2022, 11:31 PMBerian Chaiwa
05/23/2022, 12:58 AMcompose.yml
ensure that the container port for your db is exposed to your host machine via port mapping. Another thing to remember is that if you have another instance of db server running on the same port from your host, you need to stop it. Once all these are in place, running docker-compose up
should get you up and running. Here is a simple working example, you just need to prepare your .env
like below:
DATABASE_URL=<postgres://postgres:postgres@localhost:5432/hackernews-db>
Check the code here: https://github.com/chaiwa-berian/hackernews-nodeErik Näslund
05/23/2022, 10:55 PMErik Näslund
05/23/2022, 11:04 PM0.0.0.0:{PORT}
but then I get an error that I can’t connect to the db when I seed the db through the seed command
If I have the link be the container-name for the postgres I can seed the db, but I can no longer migrate.
The fault lies more likely than not with me somewhere and that I don’t really grasp how the migration works.Erik Näslund
05/23/2022, 11:09 PMBerian Chaiwa
05/24/2022, 12:05 AMdocker-compose
?Erik Näslund
05/24/2022, 2:46 AM