-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
59 lines (56 loc) · 2.38 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
55
56
57
58
59
version: '3.9'
services:
traefik:
image: traefik:latest
command:
- --accesslog=true
- --log.level=INFO
- --providers.docker=true
- --providers.docker.exposedByDefault=false
- --providers.docker.constraints=Label(`traefik.constraint-label-stack`,`voting-app-client`)
- --entrypoints.votin_app_client_web.address=:80
- --entrypoints.votin_app_client_websecure.address=:443
# LetsEncrypt Staging Server
# - --certificatesResolvers.letsencrypt.acme.caServer=https://acme-staging-v02.api.letsencrypt.org/directory
- --certificatesresolvers.letsencrypt.acme.httpchallenge=true
- --certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=votin_app_client_web
- --certificatesresolvers.letsencrypt.acme.email=${EMAIL}
- --certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json
restart: unless-stopped
ports:
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./data/letsencrypt:/letsencrypt
depends_on:
- frontend
networks:
- gateway
- application
frontend:
image: ${IMAGE_FRONTEND}
restart: unless-stopped
networks:
- application
labels:
- traefik.enable=true
- traefik.constraint-label-stack=voting-app-client
- traefik.docker.network=application
- traefik.http.services.voting_app_client.loadbalancer.server.port=80
#http
- traefik.http.routers.voting_app_client_http.entrypoints=votin_app_client_web
- traefik.http.routers.voting_app_client_http.rule=Host(`${DOMAIN}`)
- traefik.http.routers.voting_app_client_http.service=voting_app_client
- traefik.http.routers.voting_app_client_http.middlewares=voting_app_client_redirect_https
# https
- traefik.http.middlewares.voting_app_client_redirect_https.redirectscheme.scheme=https
- traefik.http.middlewares.voting_app_client_redirect_https.redirectscheme.permanent=true
- traefik.http.routers.voting_app_client_https.entrypoints=votin_app_client_websecure
- traefik.http.routers.voting_app_client_https.rule=Host(`${DOMAIN}`)
- traefik.http.routers.voting_app_client_https.service=voting_app_client
- traefik.http.routers.voting_app_client_https.tls=true
- traefik.http.routers.voting_app_client_https.tls.certresolver=${CERT_RESOLVER}
networks:
gateway:
application: