Skip to content

Commit 2322ce3

Browse files
issue #48 - examples on monitoring the application
1 parent 810bcbb commit 2322ce3

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

compose.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ services:
8383
tty: true
8484
container_name: bpc_admin_site_django
8585
privileged: true
86+
restart: always
87+
healthcheck:
88+
test: ["CMD", "curl", "-f", "http://localhost:9999"]
89+
interval: 30s
90+
timeout: 10s
91+
retries: 3
92+
start_period: 5s
8693
cron-service:
8794
image: os2borgerpcadmin
8895
volumes:

monitoring.md

+30
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)