Skip to content

Commit

Permalink
Use binary from php-fpm-exporter image rather than github release page
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksantamaria committed Oct 31, 2024
1 parent de9fe83 commit 0470332
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions images/php/Dockerfile.fpm
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
ARG PHP_VERSION=8.3
FROM ghcr.io/dpc-sdp/bay/php-fpm-exporter:6.x AS php-fpm-exporter
FROM uselagoon/php-${PHP_VERSION}-fpm:latest

ARG BAY_CLI_VERSION=v1.1.3
ARG PHP_FPM_EXPORTER_VERSION=2.2.0

RUN mkdir /bay
COPY 01-bay.ini /usr/local/etc/php/conf.d/
COPY bay-php-config.sh /bay

# Ensure temp dir exists if required
COPY entrypoints/bay-shared-temp-files-dir-check.sh /lagoon/entrypoints
COPY entrypoints/bay-php-fpm_exporter.sh /lagoon/entrypoints
COPY entrypoints/bay-php-fpm-exporter.sh /lagoon/entrypoints

# Add common drupal config.
COPY redis-unavailable.services.yml /bay
Expand All @@ -34,8 +34,7 @@ RUN chmod +x /tmp/bay
RUN mv /tmp/bay /bin/bay

# Install php-fpm_exporter
RUN curl -s -L "https://github.com/hipages/php-fpm_exporter/releases/download/v${PHP_FPM_EXPORTER_VERSION}/php-fpm_exporter_${PHP_FPM_EXPORTER_VERSION}_$(echo ${TARGETPLATFORM:-linux/amd64} | tr '/' '_')" --output /bin/php-fpm_exporter
RUN chmod +x /bin/php-fpm_exporter
COPY --from=php-fpm-exporter /php-fpm-exporter /bin/
EXPOSE 9253

ONBUILD ARG BAY_DISABLE_FUNCTIONS=phpinfo,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,system,exec,shell_exec,passthru,phpinfo,show_source,highlight_file,popen,fopen_with_path,dbmopen,dbase_open,filepro,filepro_rowcount,filepro_retrieve,posix_mkfifo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env sh
set -euo pipefail

#/ Usage: PHP_FPM_EXPORTER_ENABLED=true ./bay-php-fpm_exporter.sh
#/ Usage: PHP_FPM_EXPORTER_ENABLED=true ./bay-php-fpm-exporter.sh
#/ Options:
#/ --help: Display this help message
usage() { grep '^#/' "$0" | cut -c4- ; exit 0 ; }
Expand All @@ -14,8 +14,8 @@ error() { echoerr "[ERROR] $*" ; }
fatal() { echoerr "[FATAL] $*" ; exit 1 ; }

if [ "${PHP_FPM_EXPORTER_ENABLED:-false}" = "true" ]; then
info starting php-fpm_exporter metrics server
php-fpm_exporter server &
info starting php-fpm-exporter metrics server
php-fpm-exporter server &
else
info php-fpm_exporter metrics server disabled
info php-fpm-exporter metrics server disabled
fi

0 comments on commit 0470332

Please sign in to comment.