Skip to content

Commit

Permalink
feat: add healthcheck config and traefik
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Jun 2, 2022
1 parent 9cc86e8 commit 3676d2b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
APP_DEBUG=1
APP_CACHE=0
APP_NAMESPACE=dev
APP_VERSION=0.1.0
APP_UNSPLASH_CLIENT_ID=
APP_HEALTH_CHECK_TOKEN=
APP_TIMEZONE=Europe/Paris
USER_UID=1000

Expand Down
2 changes: 1 addition & 1 deletion config/packages/api_platform.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
api_platform:
title: "Roadiz development app"
description: "Roadiz development app"
version: '0.1.0'
version: '%env(string:APP_VERSION)%'
enable_swagger_ui: false
enable_re_doc: true
graphql:
Expand Down
2 changes: 2 additions & 0 deletions config/packages/roadiz_core.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
roadiz_core:
appNamespace: '%env(string:APP_NAMESPACE)%'
appVersion: '%env(string:APP_VERSION)%'
healthCheckToken: '%env(string:APP_HEALTH_CHECK_TOKEN)%'
staticDomainName: ~
useNativeJsonColumnType: true
security:
Expand Down
10 changes: 9 additions & 1 deletion config/packages/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@ security:
success_handler: lexik_jwt_authentication.handler.authentication_success
failure_handler: lexik_jwt_authentication.handler.authentication_failure
jwt: ~

# disables session creation for assets and healthcheck controllers
assets:
pattern: ^/assets
stateless: true
security: false
healthCheck:
pattern: ^/health-check$
stateless: true
security: false
main:
lazy: true
provider: all_users
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ services:
- "traefik.http.services.${APP_NAMESPACE}.loadbalancer.server.scheme=http"
- "traefik.http.services.${APP_NAMESPACE}.loadbalancer.server.port=80"
- "traefik.http.services.${APP_NAMESPACE}.loadbalancer.passhostheader=true"
- "traefik.http.services.${APP_NAMESPACE}.loadbalancer.healthcheck.path=/health-check"
- "traefik.http.services.${APP_NAMESPACE}.loadbalancer.healthcheck.interval=5s"
- "traefik.http.services.${APP_NAMESPACE}.loadbalancer.healthcheck.timeout=3s"
- "traefik.http.services.${APP_NAMESPACE}.loadbalancer.healthcheck.headers.x-health-check=${APP_HEALTH_CHECK_TOKEN}"
# Listen HTTP
- "traefik.http.routers.${APP_NAMESPACE}.entrypoints=http"
- "traefik.http.routers.${APP_NAMESPACE}.rule=Host(${HOSTNAME})"
Expand Down

0 comments on commit 3676d2b

Please sign in to comment.