From 725c4a9da13d736d4298880b3ab135e8b2da1a72 Mon Sep 17 00:00:00 2001 From: Sune Koch Hansen Date: Fri, 22 Nov 2024 14:57:30 +0100 Subject: [PATCH 1/2] issue #48 - examples on monitoring the application --- compose.yaml | 7 +++++++ monitoring.md | 30 ++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 monitoring.md diff --git a/compose.yaml b/compose.yaml index fcad4dc2..ee46e8ea 100644 --- a/compose.yaml +++ b/compose.yaml @@ -86,6 +86,13 @@ services: tty: true container_name: bpc_admin_site_django privileged: true + restart: always + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9999"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s cron-service: build: context: . diff --git a/monitoring.md b/monitoring.md new file mode 100644 index 00000000..80551c7b --- /dev/null +++ b/monitoring.md @@ -0,0 +1,30 @@ +# Monitoring OS2BorgerPC admin-site + +There are various ways of monitoring the application, som are: +1) health check +2) viewing logs +3) viewing resource usage + +Below are examples on how this can be done for the provided docker-compose testing setup that can be used as inspiration. + +## Health check +This section in the compose.yaml shows how to implement a health check for a docker-compose setup. +``` +restart: always +healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9999"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s +``` + +## Viewing logs +``` +docker logs bpc_admin_site_django +``` + +## Viewing resource usage +``` +docker stats bpc_admin_site_django +``` \ No newline at end of file From 9ca0a3a79b1e1ebe096b2f92388d8f2b890830c3 Mon Sep 17 00:00:00 2001 From: sunekochhansen <34162776+sunekochhansen@users.noreply.github.com> Date: Tue, 4 Feb 2025 13:18:03 +0100 Subject: [PATCH 2/2] rettelser efter review --- monitoring.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monitoring.md b/monitoring.md index 80551c7b..5e8ef5bd 100644 --- a/monitoring.md +++ b/monitoring.md @@ -1,6 +1,6 @@ # Monitoring OS2BorgerPC admin-site -There are various ways of monitoring the application, som are: +There are various ways of monitoring the application, some are: 1) health check 2) viewing logs 3) viewing resource usage @@ -27,4 +27,4 @@ docker logs bpc_admin_site_django ## Viewing resource usage ``` docker stats bpc_admin_site_django -``` \ No newline at end of file +```