forked from itchy/Dialyse-Webseite
Container fixup.
This commit is contained in:
1 parent
086db21318
commit
de178b0ceb
3 files changed
+34
-25
No files matched your search
@@ -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
@@ -1,23 +1,24 @@
|
||||
FROM php:8.5-apache
|
||||
|
||||
# Install common extensions (example)
|
||||
# RUN docker-php-ext-install
|
||||
|
||||
# Enable Apache modules if needed
|
||||
RUN a2enmod rewrite
|
||||
|
||||
# Copy application code
|
||||
COPY . /var/www/html/
|
||||
|
||||
# Disable the legacy HTTPS redirect rules from .htaccess so the container stays on plain HTTP
|
||||
# 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 \
|
||||
# && a2dismod ssl || true
|
||||
|
||||
# Set permissions
|
||||
RUN chown -R www-data:www-data /var/www/html
|
||||
|
||||
# Optional: install Composer dependencies if you have a composer.json
|
||||
# COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||
# RUN composer install --no-dev --optimize-autoloader
|
||||
|
||||
EXPOSE 80
|
||||
FROM php:8.5-apache-trixie
|
||||
|
||||
# Install system dependencies and PHP GD extension (with FreeType & JPEG/PNG support)
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
libfreetype6-dev \
|
||||
libjpeg62-turbo-dev \
|
||||
libpng-dev \
|
||||
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
||||
&& docker-php-ext-install -j"$(nproc)" gd \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 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 and harden server signature
|
||||
RUN a2enmod rewrite headers expires deflate \
|
||||
&& printf "ServerTokens Prod\nServerSignature Off\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␍
|
||||
+1
-2
@@ -30,5 +30,4 @@ header("Pragma: no-cache");
|
||||
header("Accept-Ranges: bytes");
|
||||
header("Content-type: image/png");
|
||||
ImageTtfText($img, $ttfsize, $angle, $t_x, $t_y, $color, $ttf, $captchaText);
|
||||
ImagePNG($img);
|
||||
ImageDestroy($img);
|
||||
ImagePNG($img);
|
||||
Reference in new issue
Block a user