• GitHub
  • Documentation
  • Discord
  • Donate
search
  • chevron_right Threads
  • label Support

Keep data in `docker compose down` in dev setup?

billy
July 2, 2023
chat_bubble_outline 4
  • check_circle
  • link
    billy
    Members 17 posts
    July 2, 2023, 4:47 p.m. July 2, 2023, 4:47 p.m.
    link

    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.

  • link
    rafalp
    Project Lead 1976 posts
    July 2, 2023, 7:02 p.m. July 2, 2023, 7:02 p.m.
    link
    check_box

    Marked as best answer by July 2, 2023, 11:20 p.m..

    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.

  • link
    billy
    Members 17 posts
    July 2, 2023, 11:20 p.m. July 2, 2023, 11:20 p.m.
    link

    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?

  • link
    rafalp
    Project Lead 1976 posts
    July 5, 2023, 5:05 p.m. July 5, 2023, 5:05 p.m.
    link

    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:
    
  • link
    billy
    Members 17 posts
    July 6, 2023, 3:44 a.m. July 6, 2023, 3:44 a.m.
    link

    Words can't express how grateful I am!

arrow_upward Go to top
  • This site uses cookies to gather statistical data for use in traffic analysis.
  • GitHub
  • Documentation
  • Discord
  • Donate
  • Terms of service
  • Privacy policy
powered by misago