Updated Docker entrypoint (#1984)

This commit is contained in:
Chris Plaatjes 2023-05-11 19:19:20 -04:00 committed by GitHub
parent 470d3a5587
commit e64a0684f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View File

@ -17,6 +17,7 @@ FROM ubuntu:focal
COPY --from=copytask /Kavita /kavita COPY --from=copytask /Kavita /kavita
COPY --from=copytask /files/wwwroot /kavita/wwwroot COPY --from=copytask /files/wwwroot /kavita/wwwroot
COPY API/config/appsettings.json /tmp/config/appsettings.json
#Installs program dependencies #Installs program dependencies
RUN apt-get update \ RUN apt-get update \

View File

@ -15,13 +15,16 @@
# useradd -o -u "$PUID" -g "$PGID" -d /kavita kavita # useradd -o -u "$PUID" -g "$PGID" -d /kavita kavita
#fi #fi
#Checks if the config file exists, and creates it if it does not
if [ ! -f "/kavita/config/appsettings.json" ]; then if [ ! -f "/kavita/config/appsettings.json" ]; then
echo "Kavita configuration file does not exist, creating..." echo "Kavita configuration file does not exist, copying from temp..."
echo '{ cp /tmp/config/appsettings.json /kavita/config/appsettings.json
"TokenKey": "super secret unguessable key", if [ -f "/kavita/config/appsettings.json" ]; then
"Port": 5000, echo "Copy completed successfully, starting app..."
"IpAddresses": "" else
}' >> /kavita/config/appsettings.json echo "Copy failed, check folder permissions. Exiting..."
exit
fi
fi fi
chmod +x Kavita chmod +x Kavita