Node.BB losing data after container restart

Unsolved Technical Support
  • Hey community,

    I'm having an issue with Node.BB, the forum software I'm using. Every time I restart or pull the container, it reverts back to the initial installation setup, even though I have persistent volumes defined. I can see that the postgres volume has files populated in it, but I'm not sure why this is happening.

    I'm thinking that it might be a permission issue or that I'm not running the container with the proper UID/GID (user ID/group ID), which could be preventing the container from accessing the files in the persistent volume and causing it to revert back to the initial setup.

    Has anyone else experienced this issue or have any ideas on how I can troubleshoot and resolve it? Any input would be greatly appreciated. Thanks!

    version: '3.8'
    
    services:
      nodebb:
        image: nodebb/docker
        container_name: nodebb
        restart: always
        environment:
          NODE_ENV: production
          DATABASE_HOST: db
          DATABASE_PORT: 5432
          DATABASE_NAME: nodebb
          DATABASE_USER: nodebb
          DATABASE_PASS: ${DATABASE_PASS}
        env_file:
          - .env
        ports:
          - "4567:4567"
        depends_on:
          - db
        volumes:
          - ./nodebb_data:/var/lib/nodebb
      db:
        image: postgres
        container_name: nodebb_db
        restart: always
        environment:
          POSTGRES_USER: nodebb
          POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
          POSTGRES_DB: nodebb
        env_file:
          - .env
        volumes:
          - ./postgres_data:/var/lib/postgresql/data
    
  • Here's what I see when starting the container back up..

    # docker-compose up
    Creating network "nodebb_default" with the default driver
    Creating nodebb_db ... done
    Creating nodebb    ... done
    Attaching to nodebb_db, nodebb
    db_1      | 
    db_1      | PostgreSQL Database directory appears to contain a database; Skipping initialization
    db_1      | 
    db_1      | 2023-03-10 15:28:32.768 UTC [1] LOG:  starting PostgreSQL 15.2 (Debian 15.2-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
    db_1      | 2023-03-10 15:28:32.769 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
    db_1      | 2023-03-10 15:28:32.769 UTC [1] LOG:  listening on IPv6 address "::", port 5432
    db_1      | 2023-03-10 15:28:32.771 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
    db_1      | 2023-03-10 15:28:32.777 UTC [29] LOG:  database system was shut down at 2023-03-10 15:28:26 UTC
    db_1      | 2023-03-10 15:28:32.785 UTC [1] LOG:  database system is ready to accept connections
    nodebb    | 2023-03-10T15:28:33.885Z [8] - info: Launching web installer on port 4567
    nodebb    | 2023-03-10T15:28:39.790Z [8] - info: Web installer listening on http://0.0.0.0:4567
    
  • I've been attempting to get Node.bb to run in Docker for a while, I can't help but express my disappointment in the overall lack of documentation available for this. It's frustrating to see that there are so few resources available to help users set up and configure their Node.bb instances in a Docker environment. What's even more disheartening is the lack of help available from the community. Despite searching through forums and message boards, it's difficult to find anyone who can provide meaningful guidance on this issue.

  • Sorry to disappoint, but Docker is just not something we put effort into supporting. None of us use Docker or are experienced with it. Nobody on the team has the expertise to support it.

  • @PitaJ Interesting.. why this? https://hub.docker.com/r/nodebb/docker & how can your team not use Docker for development etc?? Sorry, but that's just shocking..

  • @schwach how's that shocking? Web development as an industry has been around far far longer than Docker has, so it's not surprising that there is software in the wild that isn't built for it.

    Fun fact: Docker was released in 2013, and we started NodeBB in 2014. Hopefully you can excuse us for not choosing to use Docker 😄

    We have installation instructions for a variety of OSes, though the recommended OS is Ubuntu on a VPS.

    Docker support is provided by the community (as mentioned prior) because the core maintainers of NodeBB don't actually use Docker to deploy. There was community interest in it, and so NodeBB is compatible with it, but I will be the first to admit that it is not our primary focus for that reason. Sorry about that.

  • Thank you for sharing the fun fact about the history of Docker, as well as NodeBB's approach to supporting it. It's understandable that not all software was initially built with Docker compatibility in mind, so it's great to see that NodeBB has taken steps to support it (in some capacity) in response to community interest.


Suggested Topics


| | | |