Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move config to directory so we can properly use volumes #46

Open
airtonix opened this issue Jul 17, 2022 · 5 comments
Open

Move config to directory so we can properly use volumes #46

airtonix opened this issue Jul 17, 2022 · 5 comments

Comments

@airtonix
Copy link

airtonix commented Jul 17, 2022

I'd like to configure plugsy configuration to be stored in anamed volume, but you dictate that the config.json is in the root of the filesystem.

the syntax for declaring named volumes implies they are like folders :

馃洃 bad

  volumes:
    - plugsy_service_config_volume/config.json:/config.json

馃挌 Better

  volumes:
    - plugsy_service_config_volume:/opt/plugsy/config/

馃憞馃徎 My desired configuration

version: "3.3"

services:
  plugsy:
    restart: unless-stopped
    image: plugsy/core
    labels:
      traefik.http.routers.piehole-ui-router.service: plugsy-ui-service
      traefik.http.routers.plugsy-ui-router.rule: Host(`the.home.lan`)
      traefik.http.services.plugsy-ui-service.loadbalancer.server.port: 3000
    volumes:
      - plugsy_service_config_volume:/opt/plugsy/config/
      - /var/run/docker.sock:/var/run/docker.sock

volumes:
  plugsy_service_config_volume:

networks:
  default:
    external:
      name: traefik_proxy

I make editing these things easy by using codeserver to mount all the volumes that my services use.

@Mikle-Bond
Copy link

There is a workaround to this issue. You can use (somewhat undocumented) environment variable PLUGSY_LOCAL_CONFIG_FILE to point to custom location. Like this:

services:
  plugsy:
    image: plugsy/core
    environment:
      - PLUGSY_LOCAL_CONFIG_FILE=/config/config.json
    volumes:
      - ./plugsy:/config
    expose:
      - "3000/tcp"
    labels:
      caddy: import rproxy plugsy "{{upstreams 3000}}"

# ... etc ...

@samcro1967
Copy link

I just created the file locally and mounted it to the container:

  plugsy:
    hostname: plugsy
    image: plugsy/core:latest
    container_name: plugsy
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ${docker}/plugsy/config.json:/config.json
    ports:
      - 8130:3000

@Mikle-Bond
Copy link

@samcro1967 we don't want to mount files. We want to mount directories. Mounting files triggers a number of funny issues.

@Inlustra
Copy link
Collaborator

Inlustra commented Jan 7, 2024

I actually had no idea that was the reason! Thanks you for posting the link @Mikle-Bond

I still use Plugsy on the daily as my homepage, I'll look at fixing this when I get some time to get into it... Apologies for the late reply on this.

@Inlustra
Copy link
Collaborator

Thinking about the solution to this .. it's already in the code as mentioned previously by @Mikle-Bond.

  plugsy:
    hostname: plugsy
    image: plugsy/core:latest
    container_name: plugsy
    restart: always
    environment:
      - PLUGSY_LOCAL_CONFIG_FILE=/whatever/config json
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ${docker}/plugsy:/whatever
    ports:
      - 8130:3000

That does solve this issue right?
I'll get this added to the docs, and maybe look at changing the default to a folder mount

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants