Add Docker Compose setup for local development

PHP 8.3/Apache + MariaDB 11.4 with the repo bind-mounted as web root.
Apache denies dotfiles (.env, .git), the docker files and /install-dev
(installation runs via CLI as www-data, see docker-compose.yml).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
DanielS
2026-11-11 00:20:03 +01:00
parent ec79686a7d
commit e32cd8f6ed
6 changed files with 93 additions and 1 deletions

19
docker/Dockerfile Normal file
View File

@@ -0,0 +1,19 @@
FROM php:8.3-apache
# PHP extensions required by QloApps (see README "Requirements")
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libfreetype6-dev libjpeg62-turbo-dev libpng-dev libwebp-dev \
libzip-dev libxml2-dev libicu-dev unzip \
&& docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
&& docker-php-ext-install -j"$(nproc)" pdo_mysql mysqli gd zip soap intl opcache \
&& a2enmod rewrite headers \
&& rm -rf /var/lib/apt/lists/*
COPY php.ini /usr/local/etc/php/conf.d/qloapps.ini
COPY apache-hardening.conf /etc/apache2/conf-enabled/zz-hardening.conf
# QloApps' .htaccess files need AllowOverride
RUN sed -ri 's!AllowOverride None!AllowOverride All!g' /etc/apache2/apache2.conf
WORKDIR /var/www/html

View File

@@ -0,0 +1,7 @@
# The repo is bind-mounted as web root: never serve dotfiles (.env, .git, ...) or docker files.
RedirectMatch 404 "/\.(?!well-known/)"
RedirectMatch 404 "^/(docker/|docker-compose\.yml)"
# Installation is done via CLI (see docker-compose.yml); a web re-install would wipe the database.
RedirectMatch 404 "^/install-dev"
ServerTokens Prod
ServerSignature Off

12
docker/php.ini Normal file
View File

@@ -0,0 +1,12 @@
memory_limit = 256M
upload_max_filesize = 16M
post_max_size = 20M
max_execution_time = 500
max_input_vars = 5000
allow_url_fopen = On
date.timezone = Europe/Berlin
expose_php = Off
; Development: re-read changed PHP files immediately
opcache.validate_timestamps = 1
opcache.revalidate_freq = 0