-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
54 lines (53 loc) · 2.21 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
53
54
version: "3"
services:
traefik:
image: "traefik:v2.4"
container_name: traefik
restart: always
command:
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.tls-resolver.acme.httpchallenge=true"
- "--certificatesresolvers.tls-resolver.acme.httpchallenge.entrypoint=web"
- "--certificatesresolvers.tls-resolver.acme.email=info@sts.wtf"
- "--certificatesresolvers.tls-resolver.acme.storage=/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /root/stswiki/letsencrypt:/letsencrypt
labels:
- "traefik.enable=true"
# Global redirection: http to https
- 'traefik.http.routers.http-catchall.rule=HostRegexp(`{host:(www\.)?.+}`)'
- "traefik.http.routers.http-catchall.entrypoints=web"
- "traefik.http.routers.http-catchall.middlewares=wwwtohttps"
# Global redirection: https (www.) to https
- 'traefik.http.routers.wwwsecure-catchall.rule=HostRegexp(`{host:(www\.).+}`)'
- "traefik.http.routers.wwwsecure-catchall.entrypoints=websecure"
- "traefik.http.routers.wwwsecure-catchall.tls=true"
- "traefik.http.routers.wwwsecure-catchall.middlewares=wwwtohttps"
# middleware: http(s)://(www.) to https://
- 'traefik.http.middlewares.wwwtohttps.redirectregex.regex=^https?://(?:www\.)?(.+)'
- 'traefik.http.middlewares.wwwtohttps.redirectregex.replacement=https://$${1}'
- 'traefik.http.middlewares.wwwtohttps.redirectregex.permanent=true'
stswiki:
image: kugel/stswiki
container_name: stswiki
restart: always
depends_on:
- traefik
env_file:
- secrets.env
environment:
- STS_WIKI_CLIENT_ID=VDVCTHBt5AcM4rRLUJR5
- STS_WIKI_ORGANIZATION=sts
labels:
- "traefik.enable=true"
- "traefik.http.routers.stswiki.rule=Host(`wiki.sts.wtf`) || Host(`www.wiki.sts.wtf`)"
- "traefik.http.routers.stswiki.entrypoints=websecure"
- "traefik.http.routers.stswiki.tls=true"
- "traefik.http.routers.stswiki.tls.certresolver=tls-resolver"