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:
19
docker/Dockerfile
Normal file
19
docker/Dockerfile
Normal 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
|
||||
7
docker/apache-hardening.conf
Normal file
7
docker/apache-hardening.conf
Normal 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
12
docker/php.ini
Normal 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
|
||||
Reference in New Issue
Block a user