帮我写一个控制10个docker容器启动的Docker Compose文件并且判断每个容器都成功启动
时间: 2024-05-24 18:13:01 浏览: 15
version: '3'
services:
container1:
image: image1
restart: always
container2:
image: image2
restart: always
container3:
image: image3
restart: always
container4:
image: image4
restart: always
container5:
image: image5
restart: always
container6:
image: image6
restart: always
container7:
image: image7
restart: always
container8:
image: image8
restart: always
container9:
image: image9
restart: always
container10:
image: image10
restart: always
# 检查每个容器启动是否成功
healthcheck:
test: ["CMD-SHELL", "curl --fail http://localhost:port || exit 1"]
interval: 30s
timeout: 10s
retries: 5
# 版本检查
version: "3.8"
# 网络配置
networks:
default:
driver: bridge
# 卷配置
volumes:
data: {}
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)