jez500 / bender

A link dashboard that can be managed completely via the browser
Apache License 2.0
113 stars 5 forks source link

correct docker-compose file #6

Closed S0und closed 2 years ago

S0und commented 2 years ago

Hi

Although the current docker-compose file works, there is some miss match between the recommended settings and the actual compose file's content.

So you suggest the following for docker run:

You should volume mount the /app/static directory as it contains the config.json (the file containing all links and settings which you will want to persist). It also contains an images directory which is used with the image lookup.

docker run -d \
--name bender \
-p 8080:8080 \
-v </your/local/assets/>:/app/static \ 
--restart=always \
jez500/bender:latest

To map the /app/static folder, but in the compose file, the only volume is the www/assets folder

volumes:
- /your/local/assets/:/www/assets

If i try to use the same /app/static volume for the compose like you use for the docker run command, i get this:

    volumes:
      - /home/pi/docker/bender/static/:/app/static
    environment:
      - INIT_ASSETS=0 # i had to change this to 0

Nothing loads, only the page title is there as "Bender link dashboard".

if i add both volumes:

    volumes:
      - /home/pi/docker/bender/static/:/app/static
      - /home/pi/docker/bender/assets/:/www/assets
    environment:
      - INIT_ASSETS=0 

With INIT_ASSETS=1 i get this the following error:

No configuration found, installing default config & assets Assets directory not writable. Check assets directory permissions & docker user or skip default assets install by setting the INIT_ASSETS env var to 0

With INIT_ASSETS=0 - nothing loads

So could you update the docker-compose file with all the necessary volumes? Maybe i did something wrong, but as i see it, i need to map /app/static to store the configs outside of the container, and i have to use INIT_ASSETS=1 otherwise nothing loads. I think i need both of these.

jez500 commented 2 years ago

Hi @S0und thanks for raising this, yep should be /app/static and not /www/assets for volume mount. INIT_ASSETS=1 should remain for initial creation of config.json but is not required after that

jez500 commented 2 years ago

This should be solved in 1.0.3 now https://hub.docker.com/r/jez500/bender/tags