Skip to content

Commit

Permalink
issue #48 - examples on monitoring the application
Browse files Browse the repository at this point in the history
  • Loading branch information
sunekochhansen committed Nov 22, 2024
1 parent 810bcbb commit 2322ce3
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
7 changes: 7 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,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:
image: os2borgerpcadmin
volumes:
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, 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
```

0 comments on commit 2322ce3

Please sign in to comment.