-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
46 lines (43 loc) · 1.57 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
version: '3.5'
services:
app:
build:
context: .
dockerfile: Dockerfile.app
deploy:
labels:
- "traefik.enable=true"
- "traefik.http.routers.giftapp.rule=Host(`gifts.example.com`)"
- "traefik.http.routers.giftapp.entrypoints=websecure"
- "traefik.http.routers.giftapp.tls.certresolver=le"
- "traefik.http.routers.giftapp.middlewares=redirect-to-https"
- "traefik.http.services.giftapp.loadbalancer.server.port=8000"
static:
build:
context: .
dockerfile: Dockerfile.static
deploy:
labels:
- "traefik.enable=true"
- "traefik.http.routers.giftstatic.rule=Host(`gifts.example.com`) && PathPrefix(`/static/`)"
- "traefik.http.routers.giftstatic.entrypoints=websecure"
- "traefik.http.routers.giftstatic.tls.certresolver=le"
- "traefik.http.routers.giftstatic.middlewares=redirect-to-https"
- "traefik.http.services.giftstatic.loadbalancer.server.port=80"
traefik:
image: "traefik:v2.5"
command:
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entryPoints.web.address=:80"
- "--entryPoints.websecure.address=:443"
- "--certificatesresolvers.le.acme.storage=/store/acme.json"
- "--certificatesresolvers.le.acme.tlschallenge=true"
- "--providers.file.filename=/store/config.yaml"
ports:
- "80:80"
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./store:/store"