Command to restart NodeBB with Bash
-
Hello
Docker & launch script
I have just built a launch script to automate the two commands with parameters of NodeBB and redis.
I have configuration files on the host, linked to containers. In this way I can stop, delete and re-create NodeBB container and Redis container with data persistence !But there is just plugins who aren't persistent. So I install them on the launch script. In order to use them when I go on my forum, I need to restart or reload NodeBB.
Someone can explain to me which command can I use on bash in my launch script ?
Thank very much
-
Isn't
./nodebb restart
enough?In that case,
kill -HUP <nodebb precess id>
may works for a restarting.But because you are using a docker, I guess that just restart of a container will be safe also. If you stop a container, docker sends
SIGTERM
to a main process and as I know that is exactly the signal to stop a nodeBB -
@flex said:
NodeBB could not be restarted, as a running instance could not be found.
Yes, I got same with a dockerized nodeBB ( with both of
npm start
and./nodebb start
as a CMD )Just restart docker. A stoping of docker container is exactly same as
./nodeBB stop
Of course you can use
kill <process id>
for stoping andkill -HUP <process id>
for restarting -
-
@flex Good to hear that.
I think a reason why
./node restart
doesn't work is that the restart command may work only in a demonized situation. I haven't tried to see details yet.Also if you are interested on my docker configuration, welcome to see and comments at https://github.com/qgp9/nodebb-docker-dev
-
@qgp9 said:
if you are interested on my docker configuration
I see that you use 3 docker container with one nginx. I use a nginx reverse proxy (in order to be able to use subdomains over the same IP address). Do you think that it's possible to don't use yours and replace it by my reverse proxy ?
It's just a curiosity question, because now my configuration is working a least
-
@flex said:
Do you think that it's possible to don't use yours and replace it by my reverse proxy ?
HI, If you meant that one use a niginx which is installed on a host instead of a dockerized nginx which is dedicated for NodeBB, then it's totally possible, yes
I just put some ideas and matters
- One can remove a dockerized nginx easily by just a modifying(removing) of nginx part from docker-compose.yml. Really, that's just it. ( This is a full chain, but if one doesn't need/want a full chain then.. )
- One can use a dockerized nginx as a prime web server instead a host installed web server and can serve subomains or what ever with other docker or directory
- Actually this doesn't happen yet, but nginx can serve static files for NodeBB efficiently and you know, nginx is extremely small. So I'd rather proxy from a host installed nginx to the nodebb dedicated nginx docker ( In this case one needs to change a line
80:80
with 8080:80 or<any port>:80
in docker-compose.yml )
But, if anybody wants to get an easier way and less steps, then your idea will be also a good option.