0

i have been trying to fine tune the docker compose settings but i am not satisfied with the result and the docs are so unspecific for the healthcheck and update_config options.

The scenario are react apps which need to run build and start during entrypoint execution. The builds can not be done on Dockerfile because then i would need to tag redundant images for each environment (amongst other inconveniences)

Because of the build and run steps the container is deployed and after the healthcheck will give a positive from node server it takes about 30 secs.

Now in a rollig update zero downtime scenario what settings would i use? The thing is i dont need more then 1 replica. The ideal config option would be wait_rolling_update_delay or something that would provoke docker to replace containers never before this wait time. i am playing around with the healthcheck.start_period but i am not seeing a difference.

deploy:
  mode: replicated
  replicas: 1
  placement:
    constraints:
      - node.role == worker
  labels:
    - "APP=name"
    - "traefik.http.services.name.loadbalancer.server.port=1338"
  restart_policy:
    condition: any
    delay: 10s
    max_attempts: 3
    window: 60s
  update_config:
    parallelism: 1
    delay: 10s
    monitor: 10s
    order: start-first
    failure_action: rollback
healthcheck:
  test: "curl --silent --fail http://localhost:1338/_health || exit 1"
  interval: 10s
  timeout: 120s
  retries: 10
  start_period: 120s
setcookie
  • 579
  • 1
  • 6
  • 12

0 Answers0