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

Aberta
#351 0 comentários 2 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
35/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
docker, docker-compose, mysql

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
JavaScript
Estrelas
3.1k
Forks
6.3k
Métricas de merge de PRs
Nenhum PR com merge em 30d

Preparar o ambiente

  • Inclui um Dockerfile ou arquivo Docker Compose
  • Sem modelo de pull request
  • Sem guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de docker/getting-started

Todas as issues de docker/getting-started

Issues semelhantes

Mais issues de JavaScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.