Timeout before mysql container is launched (docker-compose section of the tutorial)

未关闭
#351 0 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
docker, docker-compose, mysql

调研方向

Read the docker-compose section of the tutorial and the linked commit that introduced the 10-second timeout. Compare the wait-port and depends_on healthcheck suggestions, then verify that the app waits for MySQL to become ready without timing out on slower machines.

由索引模型根据 Issue 内容生成。

描述

Since this commit which add a 10s timeout an older issue is back.

The timeout was removed because it was creating a problem with slow/busy machine which wasn't able to have the mysql container ready before the timeout (which was 15s at that time). In my case I have experiencing the same issue, my mysql container take a bit more than 2min to be fully ready.

Suggestions

Put a much longer timeout, using wait-port or the depends_on condition with the healthcheck instruction in the docker-compose.yaml for example:

  app:
    ...
    depends_on:
      mysql:
        condition: service_healthy
  mysql:
    ...
    healthcheck:
      test: mysqladmin ping -h 127.0.0.1 -u $$MYSQL_USER --password=$$MYSQL_PASSWORD
      start_period: 5s
      interval: 5s
      timeout: 5s
      retries: 40

(This will take a bit more time than the wait-port solution because the app container will wait the mysql container to be fully ready before starting)

PS: Also wondering how this can take 2min for me (with 8Go RAM and an i5-4210H CPU @ 2.90GHz × 4) when for other people it's look like to take less than 10s.

主要语言
JavaScript
星标
3.1k
派生
6.3k
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

docker/getting-started 的其他 Issue

查看 docker/getting-started 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。