add healthcheck examples

This commit is contained in:
Niccolo Borgioli 2023-06-23 10:15:31 +02:00
parent 97741ed73f
commit 22d4efb03e
No known key found for this signature in database
GPG Key ID: D93C615F75EE4F0B
3 changed files with 27 additions and 2 deletions

View File

@ -78,7 +78,9 @@ of the notes even if it tried to.
## Deployment
`https` is required otherwise browsers will not support the cryptographic functions.
> `https` is required otherwise browsers will not support the cryptographic functions.
> There is a health endpoint available at `/api/health/`. It returns either 200 or 503.
### Docker
@ -94,7 +96,7 @@ services:
image: redis:7-alpine
# Set a size limit. See link below on how to customise.
# https://redis.io/docs/manual/eviction/
command: redis-server --maxmemory 1gb --maxmemory-policy allkeys-lru
# command: redis-server --maxmemory 1gb --maxmemory-policy allkeys-lru
app:
image: cupcakearmy/cryptgeon:latest
@ -105,6 +107,14 @@ services:
SIZE_LIMIT: 4 MiB
ports:
- 80:8000
# Optional health checks
# healthcheck:
# test: ["CMD", "curl", "--fail", "http://127.0.0.1:8000/api/live/"]
# interval: 1m
# timeout: 3s
# retries: 2
# start_period: 5s
```
### NGINX Proxy

View File

@ -16,3 +16,10 @@ services:
- redis
ports:
- 1234:8000
healthcheck:
test: ["CMD", "curl", "--fail", "http://127.0.0.1:8000/api/live/"]
interval: 1m
timeout: 3s
retries: 2
start_period: 5s

View File

@ -16,3 +16,11 @@ services:
SIZE_LIMIT: 4 MiB
ports:
- 80:8000
# Optional health checks
# healthcheck:
# test: ["CMD", "curl", "--fail", "http://127.0.0.1:8000/api/live/"]
# interval: 1m
# timeout: 3s
# retries: 2
# start_period: 5s