mirror of
https://github.com/FoggedLens/deflock.git
synced 2026-02-12 15:02:45 +00:00
Add docker-compose healthcheck and /api/healthcheck (#12)
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
version: '3.8'
|
||||
|
||||
---
|
||||
services:
|
||||
deflock:
|
||||
image: public.ecr.aws/w2o0b9g0/deflock.me:latest
|
||||
ports:
|
||||
- 8080:8080
|
||||
#restart: always
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: curl --fail http://localhost:8080/api/healthcheck || exit 1
|
||||
interval: 30s # Time between health checks
|
||||
timeout: 10s # Time to wait for a response
|
||||
retries: 3 # Number of retries before marking as unhealthy
|
||||
start_period: 10s # Time to wait before starting health checks
|
||||
stdin_open: true
|
||||
|
||||
@@ -78,6 +78,11 @@ object ShotgunServer {
|
||||
complete(HttpEntity(ContentTypes.`text/html(UTF-8)`, "<h1>Say hello to Pekko HTTP</h1><p><b>Code: " + code.getOrElse("None") + "</b></p>"))
|
||||
}
|
||||
}
|
||||
},
|
||||
path("healthcheck") {
|
||||
get {
|
||||
complete(HttpResponse(StatusCodes.OK, entity = "Service is healthy"))
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user