1
0
Fork 0

more cleanup

This commit is contained in:
Christian Winther 2024-01-15 18:53:54 +00:00
parent 685f62a5d0
commit 903aeb7608
2 changed files with 15 additions and 23 deletions

View File

@ -10,11 +10,11 @@
entrypoint-set-script-name "${BASH_SOURCE[0]}" entrypoint-set-script-name "${BASH_SOURCE[0]}"
: "${MAX_PHOTO_SIZE:-}"
: "${MAX_ALBUM_LENGTH:-}"
load-config-files load-config-files
: "${MAX_PHOTO_SIZE:=}"
: "${MAX_ALBUM_LENGTH:=}"
# We assign a 1MB buffer to the just-in-time calculated max post size to allow for fields and overhead # We assign a 1MB buffer to the just-in-time calculated max post size to allow for fields and overhead
: "${POST_MAX_SIZE_BUFFER:=1M}" : "${POST_MAX_SIZE_BUFFER:=1M}"
log-info "POST_MAX_SIZE_BUFFER is set to [${POST_MAX_SIZE_BUFFER}]" log-info "POST_MAX_SIZE_BUFFER is set to [${POST_MAX_SIZE_BUFFER}]"

View File

@ -1,9 +1,6 @@
#!/bin/bash #!/bin/bash
set -ex -o errexit -o nounset -o pipefail set -ex -o errexit -o nounset -o pipefail
: "${APT_PACKAGES_EXTRA:=""}"
: "${DOTENV_LINTER_VERSION:=""}"
# Ensure we keep apt cache around in a Docker environment # Ensure we keep apt cache around in a Docker environment
rm -f /etc/apt/apt.conf.d/docker-clean rm -f /etc/apt/apt.conf.d/docker-clean
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache
@ -14,8 +11,10 @@ echo 'APT::Install-Recommends "false";' >>/etc/apt/apt.conf
# Don't install suggested packages by default # Don't install suggested packages by default
echo 'APT::Install-Suggests "false";' >>/etc/apt/apt.conf echo 'APT::Install-Suggests "false";' >>/etc/apt/apt.conf
declare -a packages=()
# Standard packages # Standard packages
declare -ra standardPackages=( packages+=(
apt-utils apt-utils
ca-certificates ca-certificates
curl curl
@ -36,7 +35,7 @@ declare -ra standardPackages=(
) )
# Image Optimization # Image Optimization
declare -ra imageOptimization=( packages+=(
gifsicle gifsicle
jpegoptim jpegoptim
optipng optipng
@ -44,14 +43,14 @@ declare -ra imageOptimization=(
) )
# Image Processing # Image Processing
declare -ra imageProcessing=( packages+=(
libjpeg62-turbo-dev libjpeg62-turbo-dev
libmagickwand-dev libmagickwand-dev
libpng-dev libpng-dev
) )
# Required for GD # Required for GD
declare -ra gdDependencies=( packages+=(
libwebp-dev libwebp-dev
libwebp6 libwebp6
libxpm-dev libxpm-dev
@ -59,33 +58,26 @@ declare -ra gdDependencies=(
) )
# Video Processing # Video Processing
declare -ra videoProcessing=( packages+=(
ffmpeg ffmpeg
) )
# Database # Database
declare -ra databaseDependencies=( packages+=(
libpq-dev libpq-dev
libsqlite3-dev libsqlite3-dev
mariadb-client mariadb-client
postgresql-client postgresql-client
) )
readarray -d ' ' -t -O "${#packages[@]}" packages < <(echo -n "${APT_PACKAGES_EXTRA:-}")
apt-get update apt-get update
apt-get upgrade -y apt-get upgrade -y
apt-get install -y "${packages[@]}"
apt-get install -y \
"${standardPackages[@]}" \
"${imageOptimization[@]}" \
"${imageProcessing[@]}" \
"${gdDependencies[@]}" \
"${videoProcessing[@]}" \
"${databaseDependencies[@]}" \
"${APT_PACKAGES_EXTRA}"
locale-gen locale-gen
update-locale update-locale
# Install dotenv linter (https://github.com/dotenv-linter/dotenv-linter) # Install dotenv linter (https://github.com/dotenv-linter/dotenv-linter)
curl -sSfL https://raw.githubusercontent.com/dotenv-linter/dotenv-linter/master/install.sh | sh -s -- -b /usr/local/bin "${DOTENV_LINTER_VERSION}" curl -sSfL https://raw.githubusercontent.com/dotenv-linter/dotenv-linter/master/install.sh | sh -s -- -b /usr/local/bin "${DOTENV_LINTER_VERSION:-}"