configuration-templates/Traefik Proxy/docker-compose.yml

33 lines
794 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

version: '3'
networks:
web:
name: web
driver: bridge
# 如果使用本 Compose 配置文件启动 Traefik那么在其他 Compose 文件中只需要这样声明:
#
# networks:
# web:
# name: web
# external: true
#
# 然后让需要使用 Traefik 路由的容器加入 web 网络,并在 labels 中添加如下声明(基本的):
# labels:
# - traefik.enable=true
# - traefik.http.routers.jenkins.rule=Host(`<Route Domain>`)
services:
traefik:
# 使用前请更新至最新版.
image: traefik:v2.9
container_name: traefik
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.yml:/etc/traefik/traefik.yml
- ./traefik/acme/:/etc/traefik/acme
networks:
- web