mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
improved docker startup time
This commit is contained in:
parent
c72791bd21
commit
3b912a0de1
@ -19,18 +19,22 @@ initialize() {
|
||||
map_uidgid
|
||||
|
||||
for dir in export data data/index media media/documents media/documents/originals media/documents/thumbnails; do
|
||||
if [[ ! -d "../$dir" ]]
|
||||
then
|
||||
echo "creating directory ../$dir"
|
||||
if [[ ! -d "../$dir" ]]; then
|
||||
echo "Creating directory ../$dir"
|
||||
mkdir ../$dir
|
||||
fi
|
||||
done
|
||||
|
||||
echo "creating directory /tmp/paperless"
|
||||
echo "Creating directory /tmp/paperless"
|
||||
mkdir -p /tmp/paperless
|
||||
|
||||
set +e
|
||||
CURRENT_USER=$(stat -c '%U' ../)
|
||||
CURRENT_GROUP=$(stat -c '%G' ../)
|
||||
if [[ ${CURRENT_USER} != "paperless" || ${CURRENT_GROUP} != "paperless" ]] ; then
|
||||
echo "Adjusting permissions of paperless files. This may take a while."
|
||||
chown -R paperless:paperless ../
|
||||
fi
|
||||
chown -R paperless:paperless /tmp/paperless
|
||||
set -e
|
||||
|
||||
@ -56,18 +60,18 @@ install_languages() {
|
||||
# continue
|
||||
#fi
|
||||
|
||||
if dpkg -s $pkg &> /dev/null; then
|
||||
echo "package $pkg already installed!"
|
||||
if dpkg -s $pkg &>/dev/null; then
|
||||
echo "Package $pkg already installed!"
|
||||
continue
|
||||
fi
|
||||
|
||||
if ! apt-cache show $pkg &> /dev/null; then
|
||||
echo "package $pkg not found! :("
|
||||
if ! apt-cache show $pkg &>/dev/null; then
|
||||
echo "Package $pkg not found! :("
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "Installing package $pkg..."
|
||||
if ! apt-get -y install "$pkg" &> /dev/null; then
|
||||
if ! apt-get -y install "$pkg" &>/dev/null; then
|
||||
echo "Could not install $pkg"
|
||||
exit 1
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user