-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
93 lines (92 loc) · 3.03 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
version: "3.9"
services:
admin:
image: "ghcr.io/glesage/evy-admin:latest"
restart: always
ports:
- 8001:8001
labels:
- traefik.enable=true
- traefik.port=80
- traefik.http.routers.admin.rule=Host(`admin.${DOMAIN}`)
- traefik.http.routers.admin.entrypoints=https
- traefik.http.routers.admin.tls=true
- traefik.http.routers.admin.tls.certresolver=${CERT_RESOLVER}
depends_on:
- api
api:
image: "ghcr.io/glesage/evy-api:latest"
restart: always
ports:
- $API_PORT:$API_PORT
environment:
DATABASE_URL: $DATABASE_URL
labels:
- traefik.enable=true
- traefik.port=80
- traefik.http.routers.api.rule=Host(`api.${DOMAIN}`)
- traefik.http.routers.api.entrypoints=https
- traefik.http.routers.api.tls=true
- traefik.http.routers.api.tls.certresolver=${CERT_RESOLVER}
depends_on:
- db
db:
image: "postgres"
restart: always
ports:
- $PG_PORT:$PG_PORT
environment:
POSTGRES_USER: $PG_USER
POSTGRES_PASSWORD: $PG_PASS
POSTGRES_PORT: $PG_PORT
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $PG_USER"]
interval: 1s
timeout: 1s
retries: 3
traefik:
image: traefik:v2.10
command:
- --entrypoints.http.address=:80
- --entrypoints.https.address=:443
- --providers.docker=true
- --providers.file.filename=/traefik/dynamic.yml
- --api=true
- --certificatesresolvers.le.acme.tlschallenge=true
- --certificatesresolvers.le.acme.httpchallenge=true
- --certificatesresolvers.le.acme.httpchallenge.entrypoint=http
- --certificatesresolvers.le.acme.email=${EMAIL}
- --certificatesresolvers.le.acme.storage=/letsencrypt/acme.json
labels:
- traefik.enable=true
- traefik.http.routers.to-https.rule=HostRegexp(`{host:.+}`)
- traefik.http.routers.to-https.entrypoints=http
- traefik.http.routers.to-https.middlewares=to-https
- traefik.http.routers.traefik.rule=Host(`traefik.${DOMAIN}`)
- traefik.http.routers.traefik.entrypoints=https
- traefik.http.routers.traefik.middlewares=auth
- traefik.http.routers.traefik.service=api@internal
- traefik.http.routers.traefik.tls=true
- traefik.http.routers.traefik.tls.certresolver=${CERT_RESOLVER}
- traefik.http.middlewares.to-https.redirectscheme.scheme=https
- "traefik.http.middlewares.auth.basicauth.users=${TRAEFIK_USER}:${TRAEFIK_PASSWORD_HASH}"
ports:
- 80:80
- 443:443
restart: unless-stopped
networks:
- traefik
volumes:
- ~/letsencrypt:/letsencrypt
- ~/traefik/dynamic.yml:/traefik/dynamic.yml:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
whoami:
image: containous/whoami
labels:
- traefik.http.routers.https.rule=Host(`${DOMAIN}`)
- traefik.http.routers.https.entrypoints=https
- traefik.http.routers.https.tls=true
- traefik.http.routers.https.tls.certresolver=${CERT_RESOLVER}
networks:
traefik:
external: true