Skip to content

Commit

Permalink
⚡ - Add Metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Luisi committed Jun 8, 2024
1 parent 8e12b66 commit 34e2291
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ RUN curl -L https://github.com/nginxinc/nginx-prometheus-exporter/releases/downl
# Copy the static application files to the Nginx document root
COPY ./app /usr/share/nginx/html

# Copy the health check files
COPY health-check/liveness/index.html /usr/share/nginx/html/health-check/liveness/index.html
COPY health-check/readiness/index.html /usr/share/nginx/html/health-check/readiness/index.html

# Copy the custom Nginx configuration
COPY conf/nginx.conf /etc/nginx/nginx.conf
COPY conf/default.conf /etc/nginx/conf.d/default.conf
Expand All @@ -23,7 +27,7 @@ COPY conf/stub_status.conf /etc/nginx/conf.d/stub_status.conf
EXPOSE 80 9090

# Add a health check instruction
HEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD curl -f http://localhost/health-check/liveness || exit 1
#HEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD curl -f http://localhost/health-check/liveness || exit 1

# Start Nginx and nginx-prometheus-exporter
CMD ["sh", "-c", "nginx -g 'daemon off;' & nginx-prometheus-exporter -nginx.scrape-uri http://127.0.0.1:8080/stub_status -web.listen-address :9090"]
CMD ["sh", "-c", "nginx -g 'daemon off;' & nginx-prometheus-exporter --nginx.scrape-uri http://127.0.0.1:8080/stub_status --web.listen-address :9090"]
1 change: 0 additions & 1 deletion app/health-check/liveness/index.html

This file was deleted.

1 change: 0 additions & 1 deletion app/health-check/readiness/index.html

This file was deleted.

0 comments on commit 34e2291

Please sign in to comment.