mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
adapted docker-entrypoint script for alpine docker image (mainly how to
install additional OCR languages)
This commit is contained in:
parent
68cdeb7b3d
commit
7e49d047b0
@ -9,7 +9,7 @@ map_uidgid() {
|
|||||||
USERMAP_UID=${USERMAP_UID:-$USERMAP_ORIG_UID}
|
USERMAP_UID=${USERMAP_UID:-$USERMAP_ORIG_UID}
|
||||||
if [[ ${USERMAP_UID} != "${USERMAP_ORIG_UID}" || ${USERMAP_GID} != "${USERMAP_ORIG_GID}" ]]; then
|
if [[ ${USERMAP_UID} != "${USERMAP_ORIG_UID}" || ${USERMAP_GID} != "${USERMAP_ORIG_GID}" ]]; then
|
||||||
echo "Mapping UID and GID for paperless:paperless to $USERMAP_UID:$USERMAP_GID"
|
echo "Mapping UID and GID for paperless:paperless to $USERMAP_UID:$USERMAP_GID"
|
||||||
groupmod -g "${USERMAP_GID}" paperless
|
addgroup -g "${USERMAP_GID}" paperless
|
||||||
sed -i -e "s|:${USERMAP_ORIG_UID}:${USERMAP_GID}:|:${USERMAP_UID}:${USERMAP_GID}:|" /etc/passwd
|
sed -i -e "s|:${USERMAP_ORIG_UID}:${USERMAP_GID}:|:${USERMAP_UID}:${USERMAP_GID}:|" /etc/passwd
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -56,25 +56,24 @@ install_languages() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Update apt-lists
|
|
||||||
apt-get update
|
|
||||||
|
|
||||||
# Loop over languages to be installed
|
# Loop over languages to be installed
|
||||||
for lang in "${langs[@]}"; do
|
for lang in "${langs[@]}"; do
|
||||||
pkg="tesseract-ocr-$lang"
|
pkg="tesseract-ocr-data-$lang"
|
||||||
if dpkg -s "$pkg" > /dev/null 2>&1; then
|
|
||||||
|
# English is installed by default
|
||||||
|
if [ "$lang" == "eng" ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
if apk info -e "$pkg" > /dev/null 2>&1; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
if ! apk info "$pkg" > /dev/null 2>&1; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! apt-cache show "$pkg" > /dev/null 2>&1; then
|
apk --no-cache --update add "$pkg"
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
apt-get install "$pkg"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# Remove apt lists
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user