- Update Nginx logging with structured JSON and standard combined format for Elastic integration.

- Add new upstream PHP-FPM servers to Nginx configuration for enhanced load balancing.
- Introduce Elastic APM PHP agent in `php.ini` and update Dockerfile for better dependency management.
- Secure Kibana and Elasticsearch connections in Metricbeat/Filebeat configurations with credentials.
- Remove unused PHP dependencies from `composer.json` and `composer.lock`.
This commit is contained in:
Jeppe Bundgaard
2026-02-16 10:58:50 +01:00
parent 8d8137852f
commit 8c8de541be
9 changed files with 216 additions and 1566 deletions
+42 -24
View File
@@ -1,6 +1,5 @@
# Use the official PHP 8.2 image with Apache disabled
FROM php:8.2-fpm
FROM php:8.2.15-fpm
# Set the working directory inside the container
WORKDIR /var/www/html
@@ -9,25 +8,44 @@ COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Install required extensions and dependencies
# - Include libssl-dev and ca-certificates to guarantee PHP openssl extension and TLS trust store
RUN apt-get update && apt-get install -y \
libpng-dev \
libonig-dev \
libxml2-dev \
libmagickwand-dev \
imagemagick \
pkg-config \
zip \
git \
curl \
libzip-dev \
libssl-dev \
ca-certificates \
default-mysql-client \
&& update-ca-certificates \
&& docker-php-ext-install mbstring exif pcntl bcmath gd pdo_mysql mysqli zip openssl \
&& pecl install imagick \
&& docker-php-ext-enable imagick
# Install required extensions and dependencies
# Install required extensions and dependencies
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
$PHPIZE_DEPS \
libpng-dev \
libjpeg62-turbo-dev \
libfreetype6-dev \
libxml2-dev \
libonig-dev \
libmagickwand-dev \
libmagickcore-dev \
imagemagick \
pkg-config \
zip \
unzip \
git \
curl \
libzip-dev \
libssl-dev \
ca-certificates \
mariadb-client; \
update-ca-certificates; \
docker-php-ext-configure gd --with-freetype --with-jpeg; \
docker-php-ext-install -j"$(nproc)" \
mbstring \
exif \
pcntl \
bcmath \
gd \
pdo_mysql \
mysqli \
zip; \
pecl install imagick-3.7.0; \
docker-php-ext-enable imagick; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $PHPIZE_DEPS; \
rm -rf /var/lib/apt/lists/*
## Do not copy application code at build time; it will be bind-mounted by docker-compose
## If you wish to build a self-contained image, uncomment the next line and adjust the path:
@@ -44,11 +62,11 @@ ENV COMPOSER_ALLOW_SUPERUSER=1
WORKDIR /var/www/html
# Copy and enable entrypoint that installs Composer deps on first run
COPY services/php/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
#COPY services/php/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
#RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Expose port 9000
EXPOSE 9000
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
#ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["php-fpm"]