forked from BretFisher/dogvscat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stack-proxy.yml
69 lines (63 loc) · 2.23 KB
/
stack-proxy.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
57
58
59
60
61
62
63
64
65
66
67
68
69
# simple proxy example using traefik single container
# for a more full-featured solution with multi-node proxy,
# HA, consul backend, and more, see stack-proxy-global.yml
version: '3.7'
x-default-opts:
&default-opts
logging:
options:
max-size: "1m"
# driver: "gelf"
# options:
# gelf-address: "udp://127.0.0.1:5000"
services:
traefik:
<<: *default-opts
image: traefik:2.2
networks:
- proxy
volumes:
- acme:/etc/traefik/acme
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "80:80"
- "443:443"
command:
# Use your favourite settings here, but add:
- --providers.docker
- --providers.docker.swarmMode
- --providers.docker.network=proxy
- --providers.docker.watch
- --api
- --entryPoints.web.address=:80
- --entryPoints.websecure.address=:443
- --entrypoints.websecure.http.tls=true
# - --entrypoints.web.http.redirections.entryPoint.to=websecure # force HTTPS
# - --entrypoints.web.http.tls.certresolver=default
## optional LetsEncrypt settings
# - --certificatesResolvers.default.acme.email=${TRAEFIK_ACME_EMAIL}
# - --certificatesResolvers.default.acme.storage=/etc/traefik/acme/acme.json
# - --certificatesResolvers.default.acme.tlsChallenge=true
# - --certificatesResolvers.default.acme.caServer=https://acme-staging-v02.api.letsencrypt.org/directory
# - --certificatesResolvers.default.acme.caServer=https://acme-v02.api.letsencrypt.org/directory
deploy:
placement:
constraints: [node.role == manager]
# Dynamic Configuration
labels:
traefik.http.routers.api.rule: Host(`traefik.dogvs.cat`)
traefik.http.routers.api.entryPoints: websecure
traefik.http.routers.api.service: api@internal
traefik.http.routers.api.middlewares: auth
traefik.http.services.dummy.loadbalancer.server.port: 4242
# sample users/password test/test and test2/test2
traefik.http.middlewares.auth.basicauth.users: test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0
volumes:
acme:
driver: rexray/dobs
driver_opts:
size: 1
networks:
proxy:
driver: overlay
name: proxy