trying to deploy my app with docker with my problems
So i have my container running, and when I go to localhost:8080 where the docker is running, it takes me to the error view with the message being:
6 Replies
i think the problem is that i cant connect to the db.
Yes, because localhost inside docker is not the host machine
It is a container host
Is your db also in docker?
no. i need to do that. the first thing i did was do
docker build -t realtime_polls .
and then that made the image. and then to run it I did docker run -it --rm -p 5000:80 -e ASPNETCORE_URLS=http://+:80 --name realtimepolls realtimepolls
so now the caontainer is running the image i made. but now for the database, I was trying to follow this guide to add the postgres db, but whenever I try to create a new database, i dont see it in the list when i do \l https://www.commandprompt.com/education/how-to-create-a-postgresql-database-in-docker/How to Create a PostgreSQL Database in Docker
To create a PostgreSQL database in Docker, use the “CREATE DATABASE <database-name>;” command. Then, create a new table in it and insert values in the ta…
nvm resolved