C#C
C#17mo ago
Filomeon

✅ PostgreSQL in docker container

Hello everyone,

I hope this isn't too silly a question.

I just pulled the docker image of postgres, started a container and then used that container with my .NET API and Entity framework project to create a database and populate it.

The only problem is that I've seen some strange information on the Internet that say that docker container is stateless and that, in principle, you'd have to manipulate the database data so that it's copied somewhere on the host disk if you don't want the data to disappear after each container shutdown.

However, thanks to DBeaver, I can see that my database has all the data I seeded with entity framework, even after restarting the container, and I can also see that I can't access my database until I start the container.

So where is my database data stored? In the container or on my local computer disk?
Was this page helpful?