Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: .
Expand Down
30 changes: 30 additions & 0 deletions monitoring.md
Original file line number Diff line number Diff line change
@@ -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
```