托管于语雀:https://yuque.com/a632079/nodebb
文档覆盖了 NodeBB 英文文档提及的所有内容,并补充了一些内容。
主要内容:
This is a chinese document of nodebb, created by me, who is a transifex reviewer.
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 ENOTFOUND
http://stackoverflow.com/questions/36072140/docker-issue-commands-to-an-app-inside-container
It's outdated, so don't use it.
redis
instead of nodebb/docker:ubuntu-redis and build nodebb image with Dockerfile
of NodeBB ( from official github repo ), but only for testing purpose.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
docker copy
volumes
docker restart
. BUT remember the Golden RuleSo 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.