mirror of
https://github.com/filebrowser/filebrowser.git
synced 2026-01-23 02:35:10 +00:00
feat: improved docker image volumes and permissions (#5160)
This commit is contained in:
parent
04a13f086f
commit
2e26393a02
14 changed files with 149 additions and 113 deletions
41
docker/alpine/init.sh
Executable file
41
docker/alpine/init.sh
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
# Backwards compatibility for old Docker image
|
||||
if [ -f "/.filebrowser.json" ]; then
|
||||
ln -s /.filebrowser.json /config/settings.json
|
||||
|
||||
echo ""
|
||||
echo "!!!!!!!!!!!!!!!!!!!!! IMPORTANT INFORMATION !!!!!!!!!!!!!!!!!!!!!"
|
||||
echo "Symlinking /.filebrowser.json to /config/settings.json for backwards compatibility."
|
||||
echo ""
|
||||
echo "The volume mount configuration has changed in the latest release."
|
||||
echo "Please rename .filebrowser.json to settings.json and mount the parent directory to /config".
|
||||
echo "Read more on https://github.com/filebrowser/filebrowser/blob/master/docs/installation.md#docker"
|
||||
echo ""
|
||||
echo "This workaround will be removed in a future release."
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# Backwards compatibility for old Docker image
|
||||
if [ -f "/database.db" ]; then
|
||||
ln -s /database.db /database/filebrowser.db
|
||||
|
||||
echo ""
|
||||
echo "!!!!!!!!!!!!!!!!!!!!! IMPORTANT INFORMATION !!!!!!!!!!!!!!!!!!!!!"
|
||||
echo ""
|
||||
echo "The volume mount configuration has changed in the latest release."
|
||||
echo "Please rename database.db to filebrowser.db and mount the parent directory to /database".
|
||||
echo "Read more on https://github.com/filebrowser/filebrowser/blob/master/docs/installation.md#docker"
|
||||
echo ""
|
||||
echo "This workaround will be removed in a future release."
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# Ensure configuration exists
|
||||
if [ ! -f "/config/settings.json" ]; then
|
||||
cp -a /defaults/settings.json /config/settings.json
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
9
docker/common/healthcheck.sh
Executable file
9
docker/common/healthcheck.sh
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
PORT=${FB_PORT:-$(jq -r .port /config/settings.json)}
|
||||
ADDRESS=${FB_ADDRESS:-$(jq -r .address /config/settings.json)}
|
||||
ADDRESS=${ADDRESS:-localhost}
|
||||
|
||||
curl -f http://$ADDRESS:$PORT/health || exit 1
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
|
||||
exec s6-setuidgid abc filebrowser -c /config/settings.json -d /database/filebrowser.db;
|
||||
|
|
@ -1,9 +1,6 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
|
||||
# make folders
|
||||
mkdir -p /database
|
||||
|
||||
# copy config
|
||||
# Ensure configuration exists
|
||||
if [ ! -f "/config/settings.json" ]; then
|
||||
cp -a /defaults/settings.json /config/settings.json
|
||||
fi
|
||||
3
docker/s6/etc/services.d/filebrowser/run
Executable file
3
docker/s6/etc/services.d/filebrowser/run
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
|
||||
exec s6-setuidgid abc filebrowser -c /config/settings.json;
|
||||
Loading…
Add table
Add a link
Reference in a new issue