forked from AhmadRafiee/DevOps_Certification
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yml
59 lines (56 loc) · 2.12 KB
/
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
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
version: '3.8'
networks:
web_net:
external: true
volumes:
traefik-acme:
name: traefik-acme
services:
traefik:
image: traefik:v2.10.4
restart: always
container_name: traefik
command:
- "--log.level=ERROR"
- "--log.filepath=/log-file.log"
- "--log.format=json"
- "--api=true"
- "--ping=true"
- "--accesslog=true"
- "--accesslog.fields.names.StartUTC=drop"
- "--accesslog.bufferingsize=250"
- "--api.insecure=true"
- "--providers.docker.endpoint=unix:///var/run/docker.sock"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=web_net"
- "--entrypoints.http.address=:80"
- "--entrypoints.https.address=:443"
- "--metrics.prometheus=true"
- "--entryPoints.metrics.address=:8082"
- "--metrics.prometheus.entryPoint=metrics"
- "--certificatesresolvers.mycert.acme.email=${ACME_EMAIL}"
- "--certificatesresolvers.mycert.acme.storage=/acme/acme.json"
- "--certificatesresolvers.mycert.acme.tlschallenge=true"
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- traefik-acme:/acme
labels:
- "traefik.enable=true"
- "traefik.docker.network=web_net"
- "traefik.http.routers.traefik.entrypoints=http"
- "traefik.http.routers.traefik.rule=Host(`${SUB}.${DOMAIN_ADDR}`)"
- "traefik.http.middlewares.web-auth.basicauth.users=${WEB_AUTH_USER}:${WEB_AUTH_PASS}"
- "traefik.http.routers.traefik.middlewares=https-redirect"
- "traefik.http.middlewares.https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.traefik-secure.entrypoints=https"
- "traefik.http.routers.traefik-secure.rule=Host(`${SUB}.${DOMAIN_ADDR}`)"
- "traefik.http.routers.traefik-secure.tls=true"
- "traefik.http.routers.traefik-secure.tls.options=default"
- "traefik.http.routers.traefik-secure.middlewares=web-auth"
- "traefik.http.routers.traefik-secure.tls.certresolver=mycert"
- "traefik.http.services.traefik.loadbalancer.server.port=8080"
networks:
- web_net