Nodebb Docker commands?

NodeBB Development
  • With NodeBB you can run ./nodebb start to stop you can do ./nodebb stop. Now that I have dockerized it http://nodebb-francais.readthedocs.org/projects/nodebb/en/latest/installing/docker/nodebb-redis.html I am not sure how I can interact with it.

    I have followed the steps "Using docker-machine mac os x"

    docker run --name my-forum-redis -d -p 6379:6379 nodebb/docker:ubuntu-redis
    

    Then

    docker run --name my-forum-nodebb --link my-forum-redis:redis -p 80:80 -p 443:443 -p 4567:4567 -P -t -i nodebb/docker:ubuntu
    

    Then

    docker start my-forum-nodebb
    

    I had an issue with redis address in use, so I want to fix that and restart but I am not sure how? Also I would like to issue the command grunt in the project directory, again not sure how?

    My question is how can I interact with an app inside a docker container as if I had direct access to the project folder itself? Am I missing something?

    I hate inconsistent environments, configuring stuff locally and on cloud to create consistency, also DB content, so I figured docker would be great for this. I would like to run docker on my mac using docker-machine, but I am not sure if it has the ability to use grunt etc?

  • Here is a possible solution, looks good I havent tested it yet because I am being blocked by this error warn: NodeBB Setup Aborted. getaddrinfo ENOTFOUNDhttp://stackoverflow.com/questions/36072140/docker-issue-commands-to-an-app-inside-container

  • It's outdated, so don't use it.

    1. you can use just redis instead of nodebb/docker:ubuntu-redis and build nodebb image with Dockerfile of NodeBB ( from official github repo ), but only for testing purpose.
    2. Or check mine ( NodeBB with Docker full chain ( nginx, redis, mongodb ) ) 🙂

    But here is genenal answers for your questions.

    Basically If a container is alive ( means if you can see the container with docker ps ) then you connect to bash shell

    docker exec -it <container name> bash
    

    If a container is Exit status, then it's more complicate. here An Golden Rule is that any modifications in containers is temporary and you will loose it. ( even there are ways to save a current container to image, but it's worst idea ).

    Basically you can't connect to a container in Exit status, but

    1. You can copy from or to the container with docker copy
    2. You can manage files if you mounted volumes
    3. After you solved problem then you can docker restart. BUT remember the Golden Rule

    So best idea is, I think, you have to be able to make your own Dockerfile with proper options from scratch( means from ubunt) or official docker image like redis.

    Docker is fun and powerful, fantastic, good to study, but much more complicate than without it before you have enough knowledge and skills. And even it will harm you easily.

    Nevertheless, I don't discourage you to use docker!!, I encourage it 🙂
    I'm just giving a most important tip here. "Don't use docker for production before you know how to deal with a concept of a temporary container" but GOOD FOR TEST AND LEARN.

    Welcome to docker 🙂

    And always do back them up. 🙂

  • @qgp9 said:

    vertheless, I don't discourage you to use docker!!, I encourage it
    I'm just giving a most important tip here. "Don't use docker for production before you know how to deal with a concept of a temporary container" but GOOD FOR TEST AND LEARN.

    Thanks for the positive answer, it was fun playing around with docker. I ended up realizing the most simple solution was just to share one redis db, duh right. It was good to play around with docker though I did learn a bit.


Suggested Topics