docker-compose wordpress mysql connection refused

后端 未结 6 985
轮回少年
轮回少年 2021-01-01 12:52

I\'ve created a small docker-compose.yml which used to work like a charm to deploy small WordPress instances. It looks like this:

wordpress:
  i         


        
6条回答
  •  离开以前
    2021-01-01 13:01

    I was using your docker-compose.yml, had the same problem. Just restarting didn't fix. After nearly an hour of researching the logs, I found the problem was: wordpress service started connecting mysql service before it had fully started. Simply adding depends_on won't help.Docker Compose wait for container X before starting Y

    the work around could be start the db server before Up. When it has fully started, run docker-compose up. Or just use external service.

提交回复
热议问题