Finally i found a workaround : i overload the CMD but i need to reinstall plugins i use before run.
It was indeed the named volume which is persistent, so it kept the old files.
So the new docker-compose is like below (where user 1000 is the user on the Docker host who run NodeBB ). It does not use persistent volume for NodeBB but a simple bind of config.json, so everytime a new version is published, all files and directory will be recreated when pulled.
For better performance i share static content with a named volume static with an nginx container.
Note : it does not run setup, so usable for an existing installation.
version: "3.3"
services:
redis:
image: redis:alpine
container_name: redis
restart: unless-stopped
volumes:
- /etc/localtime:/etc/localtime:ro
- redis:/data
networks:
- web
nodebb2:
image: nodebb/docker:latest
container_name: nodebb
restart: unless-stopped
user: 1000:1000
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./config.json:/usr/src/app/config.json:ro
- static:/usr/src/app/public
networks:
- web
depends_on:
redis:
condition: service_started
command : >
sh -c "npm i nodebb-plugin-calendar nodebb-plugin-category-notifications nodebb-plugin-custom-pages nodebb-plugin-desktop-notifications nodebb-plugin-gravatar nodebb-plugin-imgur nodebb-plugin-newsletter nodebb-plugin-night-mode nodebb-plugin-ns-embed nodebb-plugin-poll nodebb-plugin-question-and-answer nodebb-plugin-anti-spam-question nodebb-plugin-google-analytics nodebb-plugin-soundpack-default &&
node ./nodebb upgrade; node ./nodebb start"
networks:
web:
name: web
volumes:
redis:
Nginx container config
version: '3'
services:
reverse-proxy:
container_name: reverse-proxy
hostname: reverse-proxy
image: nginx:latest
restart: unless-stopped
ports:
- 80:80
volumes:
- conf:/etc/nginx
- html:/usr/share/nginx/html
- nodebb-static:/usr/share/nginx/html/nodebb_static
- /etc/localtime:/etc/localtime:ro
environment:
- NGINX_PORT=80
networks:
- web
networks:
web:
name: web
volumes:
conf:
html:
nodebb-static:
external:
name: nodebb_static