forked from JensKnipper/traefik-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
28 lines (25 loc) · 958 Bytes
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
version: '3'
services:
traefik:
image: traefik:v2.2
command:
- "--providers.docker"
- "--entrypoints.web.address=:80"
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
labels:
- "traefik.http.routers.redirect-router.entrypoints=web"
- "traefik.http.routers.redirect-router.rule=Host(`blog.localhost`)"
- "traefik.http.routers.redirect-router.middlewares=redirect-regex"
- "traefik.http.middlewares.redirect-regex.redirectregex.regex=^https?://blog.localhost/(.*)"
- "traefik.http.middlewares.redirect-regex.redirectregex.replacement=http://localhost/blog/$${1}"
- "traefik.http.middlewares.redirect-regex.redirectregex.permanent=false"
website:
image: nginx:latest
volumes:
- ./website:/usr/share/nginx/html
labels:
- "traefik.http.routers.website.entrypoints=web"
- "traefik.http.routers.website.rule=Host(`localhost`)"