This repository has been archived by the owner on Jul 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
52 lines (49 loc) · 2.09 KB
/
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
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
version: "2"
services:
traefik:
image: "traefik:v2.5"
container_name: "webdoky-traefik"
command:
#- "--log.level=DEBUG"
- "--api.insecure=false"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.myresolver.acme.httpchallenge=true"
- "--certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=web"
# Uncomment if need to test SSL generation
- "--certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
- "--certificatesresolvers.myresolver.acme.email=${DNS_EMAIL}"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
volumes:
- "./letsencrypt:/letsencrypt"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
# used in ACME challenge for performing HTTP challenge by certbot
whoami:
image: "traefik/whoami"
container_name: "webdoky-traefik_whoami"
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.rule=Host(`${HOST_NAME}`)"
- "traefik.http.routers.whoami.entrypoints=websecure"
- "traefik.http.routers.whoami.tls.certresolver=myresolver"
nginx:
image: flashspys/nginx-static
container_name: nginx
volumes:
- ./dist:/static
labels:
- "traefik.enable=true"
- "traefik.http.middlewares.client-https.redirectscheme.scheme=https" # register middleware
- "traefik.http.routers.client-http.entrypoints=web"
- "traefik.http.routers.client-http.rule=Host(`${HOST_NAME}`)"
- "traefik.http.routers.client-http.middlewares=client-https" # activate middleware
- "traefik.http.routers.client.entrypoints=websecure"
- "traefik.http.routers.client.rule=Host(`${HOST_NAME}`)"
- "traefik.http.routers.client.tls=true"
- "traefik.http.routers.client.tls.certresolver=myresolver"
- "traefik.port=80" # tell traefik to serve both http and https from this port in container