Container fixup.

This commit is contained in:
chriz committed 2026-10-19 22:10:32 +02:00
1 parent 086db21318
commit de178b0ceb
3 files changed
+34 -25

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
.git
.gitignore
.dockerignore
Dockerfile
img/gallery/backup_orig/
img/logo_dialysezentrum_orig.png
files/flyer_template.html
files/flyer_map.png
+24 -23
View File
@@ -1,23 +1,24 @@
FROM php:8.5-apache FROM php:8.5-apache-trixie
# Install common extensions (example) # Install system dependencies and PHP GD extension (with FreeType & JPEG/PNG support)
# RUN docker-php-ext-install RUN apt-get update && apt-get install -y --no-install-recommends \
libfreetype6-dev \
# Enable Apache modules if needed libjpeg62-turbo-dev \
RUN a2enmod rewrite libpng-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
# Copy application code && docker-php-ext-install -j"$(nproc)" gd \
COPY . /var/www/html/ && rm -rf /var/lib/apt/lists/*
# Disable the legacy HTTPS redirect rules from .htaccess so the container stays on plain HTTP # Use official production php.ini and configure timezone & security settings
# RUN sed -i '/RewriteCond %{HTTP_HOST} !^www\\.dialyse-berlin\\.net \[NC\]/,+2d; /RewriteCond %{HTTP_HOST} ^www\\.dialyse-berlin\\.net \[NC\]/,+2d' /var/www/html/.htaccess || true \ RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
# && a2dismod ssl || true && 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"
# Set permissions # Enable Apache modules and harden server signature
RUN chown -R www-data:www-data /var/www/html RUN a2enmod rewrite headers expires deflate \
&& printf "ServerTokens Prod\nServerSignature Off\n" > /etc/apache2/conf-available/security-hardening.conf \
# Optional: install Composer dependencies if you have a composer.json && a2enconf security-hardening
# COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# RUN composer install --no-dev --optimize-autoloader # Copy application code
COPY --chown=www-data:www-data . /var/www/html/
EXPOSE 80
EXPOSE 80␍
+1 -2
View File
@@ -30,5 +30,4 @@ header("Pragma: no-cache");
header("Accept-Ranges: bytes"); header("Accept-Ranges: bytes");
header("Content-type: image/png"); header("Content-type: image/png");
ImageTtfText($img, $ttfsize, $angle, $t_x, $t_y, $color, $ttf, $captchaText); ImageTtfText($img, $ttfsize, $angle, $t_x, $t_y, $color, $ttf, $captchaText);
ImagePNG($img); ImagePNG($img);
ImageDestroy($img);