Ad

Docker-compose / Postgres - How To Disable Data Persistence?

- 1 answer

I'm using postgres image form here. This image persist db data on host.

I want to disable this and get clear instance each time when I run docker-compose file.

How to do this?

Ad

Answer

You have to use docker-compose down instant of docker-compose stop.

docker-compose stop will only hibernate containers,

While down will completely destroy containers (but not images).

So, the next time you ran docker-compose up after the down command should have a clear database instance.

Ad
source: stackoverflow.com
Ad