16 lines
716 B
Docker
16 lines
716 B
Docker
FROM php:8.5-apache-trixie
|
|
|
|
# Use official production php.ini and configure timezone & security settings
|
|
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
|
|
&& printf "date.timezone = Europe/Berlin\nexpose_php = Off\nsession.cookie_httponly = 1\nsession.use_strict_mode = 1\n" > "$PHP_INI_DIR/conf.d/99-custom.ini"
|
|
|
|
# Enable Apache modules (including HTTP/2) and harden server signature
|
|
RUN a2enmod rewrite headers expires deflate http2 \
|
|
&& printf "ServerTokens Prod\nServerSignature Off\nProtocols h2 h2c http/1.1\n" > /etc/apache2/conf-available/security-hardening.conf \
|
|
&& a2enconf security-hardening
|
|
|
|
# Copy application code
|
|
COPY --chown=www-data:www-data . /var/www/html/
|
|
|
|
EXPOSE 80
|