初めに Docker を用いた開発環境が主流になってきているが、起動順序を意識されていないことが多くまれに起動に失敗する。起動順序の制御方法を Docker Compose の公式ドキュメントと Compose Specification と実装を参照し、起動順序による起動の失敗が起きない環境の設定方法をまとめる。 公式ドキュメントを読む まずは公式ドキュメントの(Control startup and shutdown order in Compose)を参照する。 ドキュメントには下記のように記載があり depends_on オプションのことが記載されている。 You can control the order of service startup and shutdown with the depends_on option. Compose always starts and st