Add healthchecks (#437)
This commit is contained in:
@@ -990,6 +990,10 @@ func onBootstrapHandler() func(se *core.BootstrapEvent) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func registerRoutes(se *core.ServeEvent, client meilisearch.ServiceManager) {
|
func registerRoutes(se *core.ServeEvent, client meilisearch.ServiceManager) {
|
||||||
|
se.Router.GET("/health", func(e *core.RequestEvent) error {
|
||||||
|
return e.JSON(http.StatusOK, map[string]string{"status": "ok"})
|
||||||
|
})
|
||||||
|
|
||||||
se.Router.GET("/public/search/token", func(e *core.RequestEvent) error {
|
se.Router.GET("/public/search/token", func(e *core.RequestEvent) error {
|
||||||
searchRules := map[string]interface{}{
|
searchRules := map[string]interface{}{
|
||||||
"lists": map[string]string{
|
"lists": map[string]string{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ services:
|
|||||||
image: getmeili/meilisearch:v1.11.3
|
image: getmeili/meilisearch:v1.11.3
|
||||||
environment:
|
environment:
|
||||||
<<: *cenv
|
<<: *cenv
|
||||||
MEILI_NO_ANALYTICS: true
|
MEILI_NO_ANALYTICS: "true"
|
||||||
ports:
|
ports:
|
||||||
- 7700:7700
|
- 7700:7700
|
||||||
networks:
|
networks:
|
||||||
@@ -41,6 +41,12 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/pb_data:/pb_data
|
- ./data/pb_data:/pb_data
|
||||||
|
healthcheck:
|
||||||
|
test: wget --spider -q http://localhost:8090/health || exit 1
|
||||||
|
interval: 15s
|
||||||
|
retries: 10
|
||||||
|
start_period: 20s
|
||||||
|
timeout: 10s
|
||||||
web:
|
web:
|
||||||
container_name: wanderer-web
|
container_name: wanderer-web
|
||||||
image: flomp/wanderer-web
|
image: flomp/wanderer-web
|
||||||
@@ -48,13 +54,13 @@ services:
|
|||||||
search:
|
search:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
db:
|
db:
|
||||||
condition: service_started
|
condition: service_healthy
|
||||||
environment:
|
environment:
|
||||||
<<: *cenv
|
<<: *cenv
|
||||||
ORIGIN: http://localhost:3000
|
ORIGIN: http://localhost:3000
|
||||||
BODY_SIZE_LIMIT: Infinity
|
BODY_SIZE_LIMIT: Infinity
|
||||||
PUBLIC_POCKETBASE_URL: http://db:8090
|
PUBLIC_POCKETBASE_URL: http://db:8090
|
||||||
PUBLIC_DISABLE_SIGNUP: false
|
PUBLIC_DISABLE_SIGNUP: "false"
|
||||||
UPLOAD_FOLDER: /app/uploads
|
UPLOAD_FOLDER: /app/uploads
|
||||||
UPLOAD_USER:
|
UPLOAD_USER:
|
||||||
UPLOAD_PASSWORD:
|
UPLOAD_PASSWORD:
|
||||||
@@ -67,6 +73,12 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- wanderer
|
- wanderer
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
healthcheck:
|
||||||
|
test: curl --fail http://localhost:3000/ || exit 1
|
||||||
|
interval: 15s
|
||||||
|
retries: 10
|
||||||
|
start_period: 20s
|
||||||
|
timeout: 10s
|
||||||
# valhalla:
|
# valhalla:
|
||||||
# image: ghcr.io/gis-ops/docker-valhalla/valhalla:latest
|
# image: ghcr.io/gis-ops/docker-valhalla/valhalla:latest
|
||||||
# ports:
|
# ports:
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ services:
|
|||||||
image: getmeili/meilisearch:v1.11.3
|
image: getmeili/meilisearch:v1.11.3
|
||||||
environment:
|
environment:
|
||||||
<<: *cenv
|
<<: *cenv
|
||||||
MEILI_NO_ANALYTICS: true
|
MEILI_NO_ANALYTICS: "true"
|
||||||
ports:
|
ports:
|
||||||
- 7700:7700
|
- 7700:7700
|
||||||
networks:
|
networks:
|
||||||
@@ -98,6 +98,12 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/pb_data:/pb_data
|
- ./data/pb_data:/pb_data
|
||||||
|
healthcheck:
|
||||||
|
test: wget --spider -q http://localhost:8090/health || exit 1
|
||||||
|
interval: 15s
|
||||||
|
retries: 10
|
||||||
|
start_period: 20s
|
||||||
|
timeout: 10s
|
||||||
|
|
||||||
web:
|
web:
|
||||||
container_name: wanderer-web
|
container_name: wanderer-web
|
||||||
@@ -106,17 +112,17 @@ services:
|
|||||||
search:
|
search:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
db:
|
db:
|
||||||
condition: service_started
|
condition: service_healthy
|
||||||
environment:
|
environment:
|
||||||
<<: *cenv
|
<<: *cenv
|
||||||
ORIGIN: http://localhost:3000
|
ORIGIN: http://localhost:3000
|
||||||
BODY_SIZE_LIMIT: Infinity
|
BODY_SIZE_LIMIT: Infinity
|
||||||
PUBLIC_POCKETBASE_URL: http://db:8090
|
PUBLIC_POCKETBASE_URL: http://db:8090
|
||||||
PUBLIC_DISABLE_SIGNUP: false
|
PUBLIC_DISABLE_SIGNUP: "false"
|
||||||
UPLOAD_FOLDER: /app/uploads
|
UPLOAD_FOLDER: /app/uploads
|
||||||
UPLOAD_USER:
|
UPLOAD_USER:
|
||||||
UPLOAD_PASSWORD:
|
UPLOAD_PASSWORD:
|
||||||
PUBLIC_VALHALLA_URL: https://valhalla.openstreetmap1.de
|
PUBLIC_VALHALLA_URL: https://valhalla1.openstreetmap.de
|
||||||
PUBLIC_NOMINATIM_URL: https://nominatim.openstreetmap.org
|
PUBLIC_NOMINATIM_URL: https://nominatim.openstreetmap.org
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/uploads:/app/uploads
|
- ./data/uploads:/app/uploads
|
||||||
@@ -125,6 +131,12 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- wanderer
|
- wanderer
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
healthcheck:
|
||||||
|
test: curl --fail http://localhost:3000/ || exit 1
|
||||||
|
interval: 15s
|
||||||
|
retries: 10
|
||||||
|
start_period: 20s
|
||||||
|
timeout: 10s
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
wanderer:
|
wanderer:
|
||||||
|
|||||||
Reference in New Issue
Block a user