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
5
5
# Setup document root
6
6
WORKDIR /var/www/html
7
7
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
+
8
10
# Install packages and remove default server definition
9
11
RUN apk add --no-cache \
10
12
curl \
@@ -52,12 +54,18 @@ COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
52
54
# Make sure files/folders needed by the processes are accessable when they run under the nobody user
53
55
RUN chown -R nobody.nobody /var/www/html /run /var/lib/nginx /var/log/nginx
54
56
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
+
55
60
# Switch to use a non-root user from here on
56
61
USER nobody
57
62
58
63
# Expose the port nginx is reachable on
59
64
EXPOSE 8080
60
65
66
+ # Expose php-fpm_exporter port
67
+ EXPOSE 9253
68
+
61
69
# Let supervisord start nginx & php-fpm
62
70
CMD ["/usr/bin/supervisord" , "-c" , "/etc/supervisor/conf.d/supervisord.conf" ]
63
71
Original file line number Diff line number Diff line change @@ -21,3 +21,12 @@ stderr_logfile=/dev/stderr
21
21
stderr_logfile_maxbytes=0
22
22
autorestart=false
23
23
startretries=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