Skip to content

Commit 725c4a9

Browse files
sunekochhansenhenrikmagni
authored andcommitted
issue #48 - examples on monitoring the application
1 parent 64f4885 commit 725c4a9

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

compose.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ services:
8686
tty: true
8787
container_name: bpc_admin_site_django
8888
privileged: true
89+
restart: always
90+
healthcheck:
91+
test: ["CMD", "curl", "-f", "http://localhost:9999"]
92+
interval: 30s
93+
timeout: 10s
94+
retries: 3
95+
start_period: 5s
8996
cron-service:
9097
build:
9198
context: .

monitoring.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Monitoring OS2BorgerPC admin-site
2+
3+
There are various ways of monitoring the application, som are:
4+
1) health check
5+
2) viewing logs
6+
3) viewing resource usage
7+
8+
Below are examples on how this can be done for the provided docker-compose testing setup that can be used as inspiration.
9+
10+
## Health check
11+
This section in the compose.yaml shows how to implement a health check for a docker-compose setup.
12+
```
13+
restart: always
14+
healthcheck:
15+
test: ["CMD", "curl", "-f", "http://localhost:9999"]
16+
interval: 30s
17+
timeout: 10s
18+
retries: 3
19+
start_period: 5s
20+
```
21+
22+
## Viewing logs
23+
```
24+
docker logs bpc_admin_site_django
25+
```
26+
27+
## Viewing resource usage
28+
```
29+
docker stats bpc_admin_site_django
30+
```

0 commit comments

Comments
 (0)