Skip to content

Commit

Permalink
Zero time restart (#2214)
Browse files Browse the repository at this point in the history
* added healthcheck for traefik @devops
* set a pretty tight healthcheck
* change swarm polling interval to 1s
* add retry middleware
  • Loading branch information
sanderegg authored Mar 19, 2021
1 parent ab36b42 commit b9ba559
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion services/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,14 @@ services:
- traefik.http.middlewares.${SWARM_STACK_NAME_NO_HYPHEN}_sslheader.headers.customrequestheaders.X-Forwarded-Proto=http
- traefik.enable=true
- traefik.http.services.${SWARM_STACK_NAME}_webserver.loadbalancer.server.port=8080
- traefik.http.services.${SWARM_STACK_NAME}_webserver.loadbalancer.healthcheck.path=/v0/health
- traefik.http.services.${SWARM_STACK_NAME}_webserver.loadbalancer.healthcheck.interval=1000ms
- traefik.http.services.${SWARM_STACK_NAME}_webserver.loadbalancer.healthcheck.timeout=75ms
- traefik.http.middlewares.${SWARM_STACK_NAME}_webserver_retry.retry.attempts=3
- traefik.http.routers.${SWARM_STACK_NAME}_webserver.rule=hostregexp(`{host:.+}`)
- traefik.http.routers.${SWARM_STACK_NAME}_webserver.entrypoints=http
- traefik.http.routers.${SWARM_STACK_NAME}_webserver.priority=1
- traefik.http.routers.${SWARM_STACK_NAME}_webserver.middlewares=${SWARM_STACK_NAME}_gzip@docker, ${SWARM_STACK_NAME_NO_HYPHEN}_sslheader@docker
- traefik.http.routers.${SWARM_STACK_NAME}_webserver.middlewares=${SWARM_STACK_NAME}_gzip@docker, ${SWARM_STACK_NAME_NO_HYPHEN}_sslheader@docker, ${SWARM_STACK_NAME}_webserver_retry
networks:
- default
- interactive_services_subnet
Expand Down Expand Up @@ -324,6 +328,9 @@ services:
command:
- "--api=true"
- "--api.dashboard=true"
- "--ping=true"
- "--entryPoints.ping.address=:9082"
- "--ping.entryPoint=ping"
- "--log.level=WARNING"
- "--accesslog=false"
- "--metrics.prometheus=true"
Expand All @@ -340,6 +347,8 @@ services:
- "--providers.docker.endpoint=unix:///var/run/docker.sock"
- "--providers.docker.network=${SWARM_STACK_NAME}_default"
- "--providers.docker.swarmMode=true"
# https://github.com/traefik/traefik/issues/7886
- "--providers.docker.swarmModeRefreshSeconds=1"
- "--providers.docker.exposedByDefault=false"
- "--providers.docker.constraints=Label(`io.simcore.zone`, `${TRAEFIK_SIMCORE_ZONE}`)"
- "--tracing=true"
Expand All @@ -365,6 +374,12 @@ services:
networks:
- default
- interactive_services_subnet
healthcheck:
test: wget --quiet --tries=1 --spider http://localhost:9082/ping || exit 1
interval: 3s
timeout: 1s
retries: 3
start_period: 1s

volumes:
input: {}
Expand Down

0 comments on commit b9ba559

Please sign in to comment.