I was wondering how I can preserve all the data when running "docker-compose down" because I noticed that all the data related to users, threads, and categories gets deleted after executing "docker-compose down". Thank you.
I was wondering how I can preserve all the data when running "docker-compose down" because I noticed that all the data related to users, threads, and categories gets deleted after executing "docker-compose down". Thank you.
Default docker-compose
setup on main repo is designed for development, so there are no volumes for any services that would preserve the data when containers are downed.
misago-docker
defines volumes and keeps data when containers are downed, but its designed for production deployments and would need modifications to work on localhost.
Ps. docker-compose
is old and deprecated way to use compose in Docker. New way is going docker compose down
because compose
is now docker
plugin and not a separate executable.
Thanks for that. If I want to define volumes to keep data both on localhost and in development, how can I configure it in the docker-compose.yml file?
In postgres service find:
ports:
- '127.0.0.1:5432:5432'
Replace with:
ports:
- '127.0.0.1:5432:5432'
volumes:
- misago-postgres-15:/var/lib/postgresql/data
At end of docker-compose.yml
add:
volumes:
misago-postgres-15:
Words can't express how grateful I am!