Implement experimental IIPServer support

This commit is contained in:
Tom Wiesing 2023-11-11 10:37:56 +01:00
parent 5d84301361
commit 10b93ddbe8
No known key found for this signature in database
9 changed files with 51 additions and 4 deletions

View file

@ -13,6 +13,7 @@ FROM $BARREL_BASE_IMAGE
WORKDIR /var/www
# install and enable the various required php extensions and dropbear ssh server
ARG IIP_SERVER_ENABLED=
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
curl \
openssh-server \
@ -32,6 +33,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
unzip \
vim \
zip \
$([ "$IIP_SERVER_ENABLED" = "1" ] && echo iipimage-server) \
&& \
docker-php-source extract && \
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" && \
@ -101,11 +103,15 @@ ENV CONTENT_SECURITY_POLICY=${CONTENT_SECURITY_POLICY}
RUN rm /etc/apache2/sites-available/*.conf && \
rm /etc/apache2/sites-enabled/*.conf
# Then add the WissKI site
# Then add all the configs
ADD apache.d/conf/ports.conf /etc/apache2/ports.conf
ADD apache.d/sites-available/wisski.conf /etc/apache2/sites-available/wisski.conf
# And enable it
# this file is technically only needed for iipserv is enabled
# but we add it in either case, as it's not enabled.
ADD apache.d/mods-available/iipsrv.conf /etc/apache2/mods-available/iipsrv.conf
# enable it
RUN a2ensite wisski
# volumes for composer

View file

@ -0,0 +1,25 @@
# Create a directory for the iipsrv binary
ScriptAlias /fcgi-bin/ "/usr/lib/iipimage-server/"
# Set the options on that directory
<Location "/fcgi-bin/">
AllowOverride None
Options None
Require all granted
# Set the module handler
AddHandler fcgid-script .fcgi
</Location>
# Set our environment variables for the IIP server
FcgidInitialEnv VERBOSITY "1"
FcgidInitialEnv LOGFILE "/dev/stderr"
FcgidInitialEnv MAX_IMAGE_CACHE_SIZE "10"
FcgidInitialEnv JPEG_QUALITY "90"
FcgidInitialEnv MAX_CVT "5000"
FcgidInitialEnv MEMCACHED_SERVERS "localhost"
# Define the idle timeout as unlimited and the number of
# processes we want
FcgidIdleTimeout 0
FcgidMaxProcessesPerClass 1

View file

@ -8,6 +8,7 @@ services:
BARREL_BASE_IMAGE: ${BARREL_BASE_IMAGE}
OPCACHE_MODE: ${OPCACHE_MODE}
CONTENT_SECURITY_POLICY: ${CONTENT_SECURITY_POLICY}
IIP_SERVER_ENABLED: ${IIP_SERVER_ENABLED}
logging:
driver: none

View file

@ -32,6 +32,7 @@ func (barrel *Barrel) Stack() component.StackWithResources {
"RUNTIME_DIR": barrel.Malt.Config.Paths.RuntimeDir(),
"BARREL_BASE_IMAGE": barrel.GetDockerBaseImage(),
"IIP_SERVER_ENABLED": barrel.GetIIPServerEnabled(),
"OPCACHE_MODE": barrel.OpCacheMode(),
"CONTENT_SECURITY_POLICY": barrel.ContentSecurityPolicy,
},