-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathdocker-compose.yml
39 lines (38 loc) · 1.62 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
services:
traefik:
image: traefik:latest
command:
- --api.insecure=true
- --providers.docker
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --certificatesresolvers.letsencrypt.acme.tlschallenge=true
- --certificatesresolvers.letsencrypt.acme.email=${TRAEFIK_EMAIL}
- --certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json
ports:
- '80:80'
- '443:443'
- '8080:8080'
volumes:
- '/var/run/docker.sock:/var/run/docker.sock'
- './letsencrypt:/letsencrypt'
labels:
- 'traefik.enable=true'
- 'traefik.http.middlewares.redirect-to-nonwww.redirectregex.regex=^https?://www\\.(.+)$$'
- 'traefik.http.middlewares.redirect-to-nonwww.redirectregex.replacement=https://$$1'
- 'traefik.http.middlewares.redirect-to-nonwww.redirectregex.permanent=true'
- 'traefik.http.middlewares.gzip.compress=true'
- 'traefik.http.routers.api.rule=Host(`traefik.${TRAEFIK_DOMAIN}`)'
- 'traefik.http.routers.api.service=api@internal'
- 'traefik.http.routers.api.middlewares=auth'
- 'traefik.http.middlewares.auth.basicauth.users=${TRAEFIK_USER}:${TRAEFIK_PASSWORD}'
reddit-viewer:
build: .
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.reddit-viewer.rule=Host(`${TRAEFIK_DOMAIN}`) || Host(`www.${TRAEFIK_DOMAIN}`)'
- 'traefik.http.routers.reddit-viewer.entrypoints=websecure'
- 'traefik.http.routers.reddit-viewer.middlewares=redirect-to-nonwww,gzip'
- 'traefik.http.routers.reddit-viewer.tls.certresolver=letsencrypt'
depends_on:
- traefik