docker-compose教程:depends_on解决容器的依赖、启动先后的问题

version: '3'

services:
  web:
    build: .
    depends_on:
      - db
      - redis

  redis:
    image: redis

  db:
    image: postgres

注意:web 服务不会等待 redis db 「完全启动」之后才启动。

猜你喜欢

转载自blog.csdn.net/a772304419/article/details/132913304