Closed oppianmatt closed 8 years ago
docker now no longer cleans up volumes that aren't referenced so the docker data container pattern is obsolete.
https://docs.docker.com/engine/userguide/containers/dockervolumes/
Data volumes persist even if the container itself is deleted.
So you can remove the data entry in compose and replace the postgres entry with:
data
postgres: restart: always image: postgres:latest ports: - "5432:5432" volumes: - pgdata:/var/lib/postgresql/data/
This uses a named volume (so you can find it easily).
Should probably give redis a volume to so it's persisted:
redis: restart: always image: redis:latest ports: - "6379:6379" volumes: - redisdata:/data
Thanks! Updating the code and the blog post now!
docker now no longer cleans up volumes that aren't referenced so the docker data container pattern is obsolete.
https://docs.docker.com/engine/userguide/containers/dockervolumes/
So you can remove the
data
entry in compose and replace the postgres entry with:This uses a named volume (so you can find it easily).
Should probably give redis a volume to so it's persisted: