diff --git a/apps/website/kirby/Dockerfile b/apps/website/kirby/Dockerfile new file mode 100644 index 0000000..be49a8a --- /dev/null +++ b/apps/website/kirby/Dockerfile @@ -0,0 +1,49 @@ +# Use latest offical ubuntu image +FROM ubuntu:latest + +# Set timezone +ENV TZ=Europe/Berlin + +# Set geographic area using above variable +# This is necessary, otherwise building the image doesn't work +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +# Remove annoying messages during package installation +ARG DEBIAN_FRONTEND=noninteractive + +# Install packages: web server & PHP plus extensions +RUN apt-get update && apt-get install -y \ + apache2 \ + apache2-utils \ + ca-certificates \ + php \ + libapache2-mod-php \ + php-curl \ + php-dom \ + php-gd \ + php-intl \ + php-json \ + php-mbstring \ + php-xml \ + php-zip && \ + apt-get clean && rm -rf /var/lib/apt/lists/* + +# Copy virtual host configuration from current path onto existing 000-default.conf +COPY default.conf /etc/apache2/sites-available/000-default.conf + +# Remove default content (existing index.html) +RUN rm /var/www/html/* + +# Activate Apache modules headers & rewrite +RUN a2enmod headers rewrite + +# Ensure Group Ownership for www-data every member of kirbygroup should edit files +RUN groupadd -g 1003 kirbygroup && usermod -aG kirbygroup www-data +RUN chown -R www-data:kirbygroup /var/www/html +RUN chmod -R g+rw /var/www/html && find /var/www/html -type d -exec chmod g+xs {} \; + +# Tell container to listen to port 80 at runtime +EXPOSE 80 + +# Start Apache web server +CMD [ "/usr/sbin/apache2ctl", "-DFOREGROUND" ] diff --git a/apps/website/kirby/default.conf b/apps/website/kirby/default.conf new file mode 100644 index 0000000..9c20cf5 --- /dev/null +++ b/apps/website/kirby/default.conf @@ -0,0 +1,9 @@ + + ServerName localhost + # Set the document root + DocumentRoot "/var/www/html" + + # Allow overriding the default configuration via `.htaccess` + AllowOverride All + + diff --git a/apps/website/kirby/entrypoint.sh b/apps/website/kirby/entrypoint.sh new file mode 100644 index 0000000..cc7816e --- /dev/null +++ b/apps/website/kirby/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -e -u + +[[ $USERID ]] && usermod --uid "${USERID}" www-data + +exec "$@" diff --git a/apps/website/kirby/id.env b/apps/website/kirby/id.env new file mode 100644 index 0000000..05aac46 --- /dev/null +++ b/apps/website/kirby/id.env @@ -0,0 +1 @@ +USERID=0