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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardcoded properties #27

Open
mrbodich opened this issue Mar 15, 2023 · 3 comments
Open

Hardcoded properties #27

mrbodich opened this issue Mar 15, 2023 · 3 comments

Comments

@mrbodich
Copy link

The next command in Dockerfile makes impossible to re-map the folders structure

CMD ["--root=/data", "--address=0.0.0.0", "--database=/config/filebrowser.db"]

Example of real life issue: I've tried to deploy this to fly.io, but it allows to mount only 1 volume.
I've solved this issue by removing this command and slightly modifying your Dockerfile + starting from custom .sh entrypoint to have ability to make some initial preparations.

Proposal:

  1. Remove root, address, database hardcoded setup
  2. Make ENTRYPOINT ["/start.sh"] instead of direct ["/filebrowser"] call

That's what I've actually did

In my case my folders structure is
root: /data/data
database: /data/config/filebrowser.db

So I can mount single /data directory.
In .sh script I create /data/data directory so FileBrowser can find it.

@hurlenko
Copy link
Owner

You can override both the ENTRYPOINT and CMD parts of a dockertfile when running a container:

docker run -v /mydir:/mydir --entrypoint=/mydir/start.sh hurlenko/filebrowser --root=/mydir/data --database=/mydir/config/filebrowser.db

I have no experience with fly.io, not sure if it is possible to do this via their platform. As for the proposals - I believe it might break existing setups, don't really want to do that.

@mrbodich
Copy link
Author

You don't run docker command when deploy to fly.io, so unfortunately that's not an option.
I will stay with my own build then based on your Dockerfile and get.sh.

I think you can fix that so it will work for old users. Just add .filebrowser.yaml

version: 3
address: 0.0.0.0
root: /data
database: /config/filebrowser.db

And copy it in Dockerfile

COPY /.filebrowser.yaml /.filebrowser.yaml

The priority listed here https://filebrowser.org/cli/filebrowser will let us override properties easily with ENVs or replace .filebrowser.yaml in simple Dockerfile not recreating whole workflow just to set own variables.
Those users who did not do this setup will still have the same properties you did, but with ability to override using different techniques like set another config with flag, replace .filebrowser.yaml with own, use ENVs.

Flags have highest priority that makes your image braking original customisation. So, that was my suggestion how to fix that.

@mrbodich
Copy link
Author

mrbodich commented Mar 15, 2023

Just an example of my props. I've also added Nginx to the image to use another subpath.
host/browser/ - filebrowser
host/shared/ - proxied direct link to content in shared folder

root: /data/data
database: /data/config/database.db

As I mentioned, this config lets me mount one single volume.

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

2 participants