Files
api/services/php/Dockerfile
T
Jeppe Bundgaard 8c8de541be - 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`.
2026-02-16 10:58:50 +01:00

72 lines
2.1 KiB
Docker

# Use the official PHP 8.2 image with Apache disabled
FROM php:8.2.15-fpm
# Set the working directory inside the container
WORKDIR /var/www/html
# Install Composer globally
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Install required extensions and dependencies
# 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:
## COPY services/nginx/app /var/www/html
# Set the appropriate permissions for the working directory
RUN chown -R www-data:www-data /var/www/html \
&& chmod -R 755 /var/www/html
## Composer installs are performed at container start by docker-entrypoint.sh
ENV COMPOSER_ALLOW_SUPERUSER=1
## Ensure workdir is correct
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
# Expose port 9000
EXPOSE 9000
#ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["php-fpm"]