File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ LABEL Description="Lightweight container with Nginx 1.22 & PHP 8.1 based on Alpi
55# Setup document root
66WORKDIR /var/www/html
77
8+ # RUN #wget https://github.com/hipages/php-fpm_exporter/releases/download/v2.2.0/php-fpm_exporter_2.2.0_darwin_amd64 -O /usr/bin/php-fpm_exporter
9+
810# Install packages and remove default server definition
911RUN apk add --no-cache \
1012 curl \
@@ -52,12 +54,18 @@ COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
5254# Make sure files/folders needed by the processes are accessable when they run under the nobody user
5355RUN chown -R nobody.nobody /var/www/html /run /var/lib/nginx /var/log/nginx
5456
57+ COPY --from=hipages/php-fpm_exporter /php-fpm_exporter /usr/bin/php-fpm_exporter
58+ RUN chmod +x /usr/bin/php-fpm_exporter
59+
5560# Switch to use a non-root user from here on
5661USER nobody
5762
5863# Expose the port nginx is reachable on
5964EXPOSE 8080
6065
66+ # Expose php-fpm_exporter port
67+ EXPOSE 9253
68+
6169# Let supervisord start nginx & php-fpm
6270CMD ["/usr/bin/supervisord" , "-c" , "/etc/supervisor/conf.d/supervisord.conf" ]
6371
Original file line number Diff line number Diff line change @@ -21,3 +21,12 @@ stderr_logfile=/dev/stderr
2121stderr_logfile_maxbytes=0
2222autorestart=false
2323startretries=0
24+
25+ [program:php-fpm_exporter]
26+ command=php-fpm_exporter server --phpfpm.fix-process-count true --phpfpm.scrape-uri unix:///run/php-fpm.sock;/fpm-status
27+ stdout_logfile=/dev/stdout
28+ stdout_logfile_maxbytes=0
29+ stderr_logfile=/dev/stderr
30+ stderr_logfile_maxbytes=0
31+ autorestart=false
32+ startretries=0
You can’t perform that action at this time.
0 commit comments