54 Replies
docker-compose
building log
Name or service not known
dockerfile
i think u specified the network wrong for the services in the docker compose file as it wants a list from u
so ur file should look like this:
same error
did u check the postgres logs to see if its actually up and running?
2023-12-02 11:39:54 Error: Database is uninitialized and superuser password is not specified.
2023-12-02 11:39:54 You must specify POSTGRES_PASSWORD to a non-empty value for the
2023-12-02 11:39:54 superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
2023-12-02 11:39:54
2023-12-02 11:39:54 You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
2023-12-02 11:39:54 connections without a password. This is not recommended.
2023-12-02 11:39:54
2023-12-02 11:39:54 See PostgreSQL documentation about "trust":
2023-12-02 11:39:54 https://www.postgresql.org/docs/current/auth-trust.html
PostgreSQL Documentation
21.4. Trust Authentication
21.4. Trust Authentication # When trust authentication is specified, PostgreSQL assumes that anyone who can connect to the server is authorized …
hmm so its indeed not running, but i dunno why its complaining
maybe its not liking
root
as password, can u try something else?same
this shouldnt make a difference, but can u try this notation instead?
same as always
btw im starting compose with docker-compose up
wait
okay
it just started properly idk why
weird indeed
but there is still c# error
if u run
docker ps
is it showing the postgres container?it worked because of instead of
and what does
docker logs postgres
show?can u show ur current docker compose file?
output of
docker network inspect projectserv-net
?hmm maybe it doesnt like the
-
in the name
try to change that and restart both containerssame
docker network ls
?docker network inspect projectserv_projectservnet
?can u show me the updated compose file again?
and u still get the
Name or service not known
exception if u try to run the app container? 😒yea
and the postgres container is waiting for connections right?
yea
hmmm thats weird
tbh im out of ideas, the docker compose file looks correct to me, same for the connection string
can u try
docker-compose down
followed by docker-compose up -d
and then docker ps
?
i want to see the output from all of themno containers
because of docker-compose up -d
maybe there are other ways to automatically update db?
I think i fixed it
but how can i access that app ?
it does not look like my app
ok, now it fully woking but idk why there is items in my db
nvm
btw i fixed whole thing by removing and adding to the context Database.EnsureCretead()
$close
Use the /close command to mark a forum thread as answered
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
so, how can I run .sh after I deployed db and app?
because as I know Database.EnsureCretead is not a good option to update db
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
as i know it makes db from context class
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
not from migrations
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
as i know it makes db from context class not from migrations, which means I cant make a rollback
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
Tim Brown
Code Buckets
Applying Entity Framework Migrations to a Docker Container
I’m going to run through how to deploy an API and a database into two separate Docker containers then apply Entity Framework migrations. This will create and populate the database with the co…
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
good catch and thanks for the cc 🙂