version: '3'
services:
traefik-server:
# The official v2 Traefik docker image
image: traefik:v2.6
# Enables the web UI and tells Traefik to listen to docker
command: --api.insecure=true --providers.docker
ports:
# The HTTP port
- "80:80"
# The Web UI (enabled by --api.insecure=true)
- "8030:8080"
networks:
- worknet
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
networks:
worknet:
name: worknet
安装 traefik,文件:
docker-compose.yml
:启动:
添加 service:
通过 rule 将 adminer 访问路径挂载到 traefik localhst:80/adminer 子目录下。