まえがき この記事は、"Dockerでコンテナ間で通信できない"というタイトルでしたが、 コメントなどのおかげで改善されたので記事を修正しました。 ありがとうございます。 docker-composeのコンテナ間は、デフォルトだとコンテナ名で接続できる 今回は、WordPress開発環境を作りたかったので以下のdocker-compose.ymlを用意した。 version: '3.4' services: mysql: #<-コンテナとしてこちらの"mysql"も指定できる image: mysql:5.7 command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_bin environment: MYSQL_ROOT_PASSWORD: root_dumy MYSQL_DATABASE: word