mirror of https://github.com/pixelfed/pixelfed
a bit of refactoring
parent
7b3e11012f
commit
7dcca09c65
@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
set -ex -o errexit -o nounset -o pipefail
|
||||
|
||||
# Ensure we keep apt cache around in a Docker environment
|
||||
rm -f /etc/apt/apt.conf.d/docker-clean
|
||||
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache
|
||||
|
||||
# Don't install recommended packages by default
|
||||
echo 'APT::Install-Recommends "false";' >>/etc/apt/apt.conf
|
||||
|
||||
# Don't install suggested packages by default
|
||||
echo 'APT::Install-Suggests "false";' >>/etc/apt/apt.conf
|
||||
|
||||
# Standard packages
|
||||
declare -ra standardPackages=(
|
||||
apt-utils
|
||||
ca-certificates
|
||||
gettext-base
|
||||
git
|
||||
gnupg1
|
||||
gosu
|
||||
libcurl4-openssl-dev
|
||||
libzip-dev
|
||||
locales
|
||||
locales-all
|
||||
nano
|
||||
procps
|
||||
unzip
|
||||
zip
|
||||
software-properties-common
|
||||
)
|
||||
|
||||
# Image Optimization
|
||||
declare -ra imageOptimization=(
|
||||
gifsicle
|
||||
jpegoptim
|
||||
optipng
|
||||
pngquant
|
||||
)
|
||||
|
||||
# Image Processing
|
||||
declare -ra imageProcessing=(
|
||||
libjpeg62-turbo-dev
|
||||
libmagickwand-dev
|
||||
libpng-dev
|
||||
)
|
||||
|
||||
# Required for GD
|
||||
declare -ra gdDependencies=(
|
||||
libwebp-dev
|
||||
libwebp6
|
||||
libxpm-dev
|
||||
libxpm4
|
||||
)
|
||||
|
||||
# Video Processing
|
||||
declare -ra videoProcessing=(
|
||||
ffmpeg
|
||||
)
|
||||
|
||||
# Database
|
||||
declare -ra databaseDependencies=(
|
||||
libpq-dev
|
||||
libsqlite3-dev
|
||||
)
|
||||
|
||||
apt-get update
|
||||
|
||||
apt-get upgrade -y
|
||||
|
||||
apt-get install -y \
|
||||
${standardPackages[*]} \
|
||||
${imageOptimization[*]} \
|
||||
${imageProcessing[*]} \
|
||||
${gdDependencies[*]} \
|
||||
${videoProcessing[*]} \
|
||||
${databaseDependencies[*]} \
|
||||
${APT_PACKAGES_EXTRA}
|
||||
|
||||
locale-gen
|
||||
update-locale
|
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
set -ex -o errexit -o nounset -o pipefail
|
||||
|
||||
# Grab the PHP source code so we can compile against it
|
||||
docker-php-source extract
|
||||
|
||||
# PHP GD extensions
|
||||
docker-php-ext-configure gd \
|
||||
--with-freetype \
|
||||
--with-jpeg \
|
||||
--with-webp \
|
||||
--with-xpm
|
||||
|
||||
# Optional script folks can copy into their image to do any [docker-php-ext-configure] work before the [docker-php-ext-install]
|
||||
# this can also overwirte the [gd] configure above by simply running it again
|
||||
if [[ -f /install/php-extension-configure.sh ]]; then
|
||||
if [ !-x "$f" ]; then
|
||||
echo >&2 "ERROR: found /install/php-extension-configure.sh but its not executable - please [chmod +x] the file!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
/install/php-extension-configure.sh
|
||||
fi
|
||||
|
||||
# Install pecl extensions
|
||||
pecl install ${PHP_PECL_EXTENSIONS} ${PHP_PECL_EXTENSIONS_EXTRA}
|
||||
|
||||
# PHP extensions (dependencies)
|
||||
docker-php-ext-install -j$(nproc) ${PHP_EXTENSIONS} ${PHP_EXTENSIONS_EXTRA} ${PHP_EXTENSIONS_DATABASE}
|
||||
|
||||
# Enable all extensions
|
||||
docker-php-ext-enable ${PHP_PECL_EXTENSIONS} ${PHP_PECL_EXTENSIONS_EXTRA} ${PHP_EXTENSIONS} ${PHP_EXTENSIONS_EXTRA} ${PHP_EXTENSIONS_DATABASE}
|
Loading…
Reference in New Issue