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..5e8ef5bd --- /dev/null +++ b/monitoring.md @@ -0,0 +1,30 @@ +# Monitoring OS2BorgerPC admin-site + +There are various ways of monitoring the application, some 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 +```