FROM --platform=linux/amd64 php:8.5.12-apache RUN apt-get update && apt-get install -y libssl-dev ca-certificates \ && docker-php-ext-install mysqli pdo pdo_mysql \ && a2enmod rewrite \ && sed -i 's/AllowOverride None/AllowOverride All/g' /etc/apache2/apache2.conf COPY . /var/www/html/ # OpenTelemetry (Distro 0.7.0 + Collector 0.163.2). Change the versions and checksums together. ARG DISTRO_VERSION=0.7.0 ARG DISTRO_SHA512_AMD64=303ae541b7893220d70683c068dd1e4aa6f69ace5e19daf5fc2455c18eeb433ddb675414d641bef64547f51422d25ab050f59819ad1dfa24cf460a9a3a68f57e ARG OTELCOL_VERSION=0.163.2 ARG OTELCOL_SHA256_AMD64=cc19dd6a1b85ca694ef16655688e597f693d0e24d2baecdd50e2db597819eeff RUN set -eu; \ deb="opentelemetry-php-distro_${DISTRO_VERSION}_amd64.deb"; \ curl -fsSL --retry 3 -o "/tmp/$deb" "https://github.com/open-telemetry/opentelemetry-php-distro/releases/download/v${DISTRO_VERSION}/$deb"; \ echo "$DISTRO_SHA512_AMD64 /tmp/$deb" | sha512sum -c -; \ dpkg -i "/tmp/$deb"; rm "/tmp/$deb"; \ curl -fsSL --retry 3 -o /tmp/otelcol.tgz "https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v${OTELCOL_VERSION}/otelcol-contrib_${OTELCOL_VERSION}_linux_amd64.tar.gz"; \ echo "$OTELCOL_SHA256_AMD64 /tmp/otelcol.tgz" | sha256sum -c -; \ tar -xzf /tmp/otelcol.tgz -C /usr/local/bin otelcol-contrib; rm /tmp/otelcol.tgz; \ mkdir -p /opt/v1-otel /etc/v1-otel; \ cp /var/www/html/ops/otel/v1-otel-hooks.php /opt/v1-otel/; \ cp /var/www/html/ops/otel/collector.yaml /etc/v1-otel/; \ cp /var/www/html/ops/otel/php/opentelemetry.ini /opt/opentelemetry/php/distro/etc/opentelemetry-distro-custom.ini; \ cp /var/www/html/ops/otel/render/apache-otel.conf /etc/apache2/conf-available/v1-otel.conf; \ cp /var/www/html/ops/otel/render/entrypoint.sh /usr/local/bin/v1-entrypoint.sh; \ chmod +x /usr/local/bin/v1-entrypoint.sh; \ a2enconf v1-otel; \ rm -rf /var/www/html/ops RUN chown -R www-data:www-data /var/www/html # Render routes traffic to $PORT (not always 80); the entrypoint handles that and starts the Collector CMD ["/usr/local/bin/v1-entrypoint.sh"]