[add] docker build
This commit is contained in:
30
docker-root/etc/cont-init.d/10-fix_folders
Normal file
30
docker-root/etc/cont-init.d/10-fix_folders
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
# test write access to download and config folder and test internet connectivity
|
||||
printf '[cont-init.d] Fixing Folder Permissions - Config Folder\n'
|
||||
|
||||
chown -R abc:abc /config
|
||||
|
||||
printf '[cont-init.d] Fixing Folder Permissions - Temp Folder\n'
|
||||
|
||||
mkdir /tmp/deemix-imgs/
|
||||
chown -R abc:abc /tmp/deemix-imgs/
|
||||
|
||||
# find all folders in the download folder and own them to the container user. This will not change files but should run quicker on big collections.
|
||||
if [ ! -z ${DISABLE_OWNERSHIP_CHECK} ]; then
|
||||
printf '[cont-init.d] Download Folder Ownership Check disabled by Environment Variable\n'
|
||||
else
|
||||
printf '[cont-init.d] Fixing Folder Permissions - Downloads Folder\n'
|
||||
find /downloads -type d -exec chown abc:abc {} +
|
||||
fi
|
||||
|
||||
|
||||
# add executability to server
|
||||
chmod +x /deemix-server
|
||||
|
||||
# Fix misconfigured download locations. The container's download map is always /downloads.
|
||||
if [ -f "/config/config.json" ]; then
|
||||
jq '.downloadLocation = "/downloads"' /config/config.json > tmp.$$.json && mv tmp.$$.json /config/config.json
|
||||
chown abc:abc /config/config.json
|
||||
fi
|
||||
|
||||
9
docker-root/etc/cont-init.d/15-checks
Normal file
9
docker-root/etc/cont-init.d/15-checks
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
# test write access to download and config folder and test internet connectivity
|
||||
printf '[cont-init.d] Testing Access\n' && \
|
||||
printf '%-50s %2s %-5s \n' "[cont-init.d] Container Builddate" ":" "$BUILDDATEENV" && \
|
||||
if [ -w "/downloads" ]; then printf '%-50s %2s %-5s \n' "[cont-init.d] Download Folder Write Access" ":" "Success"; else printf '%-50s %2s %-5s \n' "[cont-init.d] Download Folder Write Access" ":" "Failure"; fi && \
|
||||
if [ -w "/config" ]; then printf '%-50s %2s %-5s \n' "[cont-init.d] Config Folder Write Access" ":" "Success"; else printf '%-50s %2s %-5s \n' "[cont-init.d] Config Folder Write Access" ":" "Failure"; fi && \
|
||||
until curl --fail -sf www.deezer.com; do printf '%-50s %2s %-5s \n' "[cont-init.d] Internet Access" ":" "Failure. Trying again in 5 seconds"; sleep 5; done
|
||||
printf '%-50s %2s %-5s \n' "[cont-init.d] Internet Access" ":" "Success"
|
||||
26
docker-root/etc/services.d/deemix/run
Normal file
26
docker-root/etc/services.d/deemix/run
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
UMASK_SET=${UMASK_SET:-022}
|
||||
umask "$UMASK_SET"
|
||||
|
||||
cd /
|
||||
|
||||
# Check if an alternative port was defined, set it to it or default
|
||||
if [ ! -z ${INTPORT} ]; then
|
||||
port=$INTPORT
|
||||
else
|
||||
port=6595
|
||||
fi
|
||||
|
||||
# Check if the ARL environment var is set to anything. This enables legacy behavior
|
||||
if [ ! -z ${ARL} ]; then
|
||||
export DEEMIX_SINGLE_USER=true
|
||||
fi
|
||||
|
||||
export DEEMIX_DATA_DIR=/config/
|
||||
export DEEMIX_MUSIC_DIR=/downloads/
|
||||
export DEEMIX_SERVER_PORT=$port
|
||||
export DEEMIX_HOST=0.0.0.0
|
||||
|
||||
echo "[services.d] Starting Deemixer"
|
||||
s6-setuidgid abc /deemix-server
|
||||
Reference in New Issue
Block a user