0

I am using nodeBB to start a server 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?

1

1 Answer 1

2

All code in this answer is untested, as I'm currently at a computer without docker.

See whether the containers are still running

docker ps

Stop misconfigured containers

docker stop my-forum-redis
docker stop my-forum-nodebb

Remove misconfigured containers and their volumes

(The docker images they are based on will be retained.)

docker rm --volumes --force stop my-forum-nodebb
docker rm --volumes --force my-forum-redis

Start again

Then, issue your 3 commands again, now with the correct ports.

Execute arbitrary commands inside container

Also I would like to issue the command grunt in the project directory, again not sure how?

You probably want to do the following after the docker run --name my-forum-nodebb ... command but before docker start my-forum-nodebb.

docker run accepts a command to execute instead of the container's default command. Let's first use this to find out where in the container we'd land:

docker run my-forum-nodebb pwd

If that is the directory where you want to run grunt, just go forward with it:

docker run my-forum-nodebb grunt

If not, you'll have to stuff several commands into a single one. You can do that by invoking a shell:

docker run my-forum-nodebb bash -c 'cd /path/to/project/dir; grunt'

where /path/to/project/dir is to be replaced by where you want to run grunt.

Sign up to request clarification or add additional context in comments.

2 Comments

Very nice, thank you so much for you time and effort. I will try this and chime in with the result I am sure it works flawlessly :)
Some of the commands might need some tweaking to actually work. Also, some depend on the particulars (especially entrypoints) of the used images not being too non-standard, which I didn't verify yet.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.