-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose-traefik.yml
56 lines (52 loc) · 1.9 KB
/
docker-compose-traefik.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
version: "3.7"
services:
traefik.service:
image: traefik:2.2.1
container_name: traefik.service
restart: unless-stopped
command:
- --api.dashboard=true
- --api.insecure=true
- --log.level=DEBUG
- --providers.docker=true
- --providers.docker.network=traefik.network
- --providers.docker.exposedByDefault=false
- --entryPoints.web.address=:80
- --entryPoints.secureweb.address=:443
- --metrics.prometheus=true
- --providers.providersthrottleduration=10
labels:
- traefik.enable=true
- traefik.port=8080
ports:
- "80:80"
- "443:443"
- "8080:8080" # Web UI port
volumes:
- /var/run/docker.sock:/var/run/docker.sock # So Traefik can listen to Docker events
simplecoreapi_service:
build:
context: ./api
dockerfile: Dockerfile
labels:
# Expose this containter to traefik
- traefik.enable=true
# Define a service `simpleapi` and attach it to the `web` entrypoint
- traefik.http.routers.simpleapi.entrypoints=web
- traefik.http.routers.simpleapi.rule=Host(`simpleapi.service`)
- traefik.http.routers.simpleapi.service=simpleapi
- traefik.http.services.simpleapi.loadbalancer.server.scheme=http
- traefik.http.services.simpleapi.loadbalancer.server.port=80
# Define a service `secureapi` and attach it to the `wesecurewebb` entrypoint
- traefik.http.routers.secureapi.entrypoints=secureweb
- traefik.http.routers.secureapi.tls=true
- traefik.http.routers.secureapi.rule=Host(`secureapi.service`)
- traefik.http.routers.secureapi.service=secureapi
- traefik.http.services.secureapi.loadbalancer.server.scheme=http
- traefik.http.services.secureapi.loadbalancer.server.port=80
volumes:
- ~/.aspnet/https:/https:ro # local dev certificates
networks:
default:
name: traefik.network
driver: bridge