Docker Compose 是定义和运行多容器 Docker 应用程序的工具 。 使用 Compe, 您将使用 YAML 文件来配置应用程序的服务 。 然后,只要有一个单项命令,你就从配置中创建并启动所有服务。
此时此刻,我使用多克·康波斯 在我的服务器上运行一些服务。
这儿就是 docker-compose.yml 我用文件运行这些服务 :
services:
mostlylucid:
image: scottgal/mostlylucid:latest
labels:
- "com.centurylinklabs.watchtower.enable=true"
cloudflared:
image: cloudflare/cloudflared:latest
command: tunnel --no-autoupdate run --token ${CLOUDFLARED_TOKEN}
env_file:
- .env
watchtower:
image: containrrr/watchtower
container_name: watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- WATCHTOWER_CLEANUP=true
- WATCHTOWER_LABEL_ENABLE=true
command: --interval 300 # Check for updates every 300 seconds (5 minutes)
© 2026 Scott Galloway — Unlicense — All content and source code on this site is free to use, copy, modify, and sell.