-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
201 lines (192 loc) · 6.87 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
version: '3'
services:
traefik:
image: traefik:v2.9
ports:
- 443:443
- 80:80
- 8080:8080
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
- ./proxy/traefik.yml:/traefik.yml
- ./proxy/certs.yml:/certs.yml
- /etc/ssl/certs:/certs
- ./proxy/acme.json:/acme.json
- ./proxy/acme-http.json:/acme-http.json
environment:
- CLOUDFLARE_DNS_API_TOKEN=${CLOUDFLARE_DNS_API_TOKEN}
command:
- '--log.level=DEBUG'
logging:
driver: 'json-file'
options:
max-size: '1m'
max-file: '5'
labels:
# - "traefik.http.routers.dashboard.rule=(PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
# - "traefik.http.routers.dashboard.tls=true"
# - "traefik.http.routers.dashboard.entrypoints=websecure"
# - "traefik.http.routers.dashboard.service=api@internal"
- 'traefik.http.routers.priority=1'
cms-landing:
image: ghcr.io/patrickdappollonio/docker-http-server:v2
command: --path /html --title "ELab CMS Directory"
volumes:
- ./_site/index.html:/html/index.html
logging:
driver: none
labels:
traefik.http.routers.cms-landing.rule: PathPrefix(`/`)
traefik.http.routers.cms-landing.tls: true
traefik.http.routers.cms-landing.entrypoints: websecure
cms-sjm:
build:
context: .
dockerfile: Dockerfile
target: cms-runner
args:
- APP_NAME=sjm
- PORT=3001
env_file:
- ./apps/cms/.env
environment:
- PORT=3001
restart: on-failure
logging:
driver: 'json-file'
options:
max-size: '1m'
max-file: '1'
labels:
- 'traefik.http.routers.api-sjm.rule=PathPrefix(`/sjm/api/graphql`)'
- 'traefik.http.routers.api-sjm.tls=true'
- 'traefik.http.routers.api-sjm.entrypoints=websecure'
- 'traefik.http.routers.api-sjm.service=cms-sjm-el-next'
- 'traefik.http.routers.cms-sjm.rule=PathPrefix(`/sjm`)'
- 'traefik.http.routers.cms-sjm.tls=true'
- 'traefik.http.routers.cms-sjm.entrypoints=websecure'
- 'traefik.http.routers.cms-sjm.service=cms-sjm-el-next'
- 'traefik.http.routers.cms-sjm.middlewares=traefik-forward-auth,error-pages'
- 'traefik.http.services.cms-sjm-el-next.loadbalancer.server.port=3001'
cms-elab:
build:
context: .
dockerfile: Dockerfile
target: cms-runner
args:
- APP_NAME=elab
- PORT=3002
env_file:
- ./apps/cms/.env
environment:
# - APP_NAME=elab
- PORT=3002
restart: on-failure
labels:
- 'traefik.http.routers.api-elab.rule=PathPrefix(`/elab/api/graphql`)'
- 'traefik.http.routers.api-elab.tls=true'
- 'traefik.http.routers.api-elab.entrypoints=websecure'
- 'traefik.http.routers.api-elab.service=cms-elab-el-next'
- 'traefik.http.routers.cms-elab.rule=PathPrefix(`/elab`)'
- 'traefik.http.routers.cms-elab.tls=true'
- 'traefik.http.routers.cms-elab.entrypoints=websecure'
- 'traefik.http.routers.cms-elab.service=cms-elab-el-next'
- 'traefik.http.routers.cms-elab.middlewares=traefik-forward-auth,error-pages'
- 'traefik.http.services.cms-elab-el-next.loadbalancer.server.port=3002'
qa-elab:
build:
context: .
dockerfile: Dockerfile
target: qa-image
args:
APP: elab
PORT: 8083
CMS_ENDPOINT: cms-elab:3002
restart: on-failure
logging:
driver: 'json-file'
options:
max-size: '1m'
max-file: '1'
labels:
- 'traefik.http.routers.qa-elab-http.entrypoints=web'
- 'traefik.http.routers.qa-elab-http.rule=Host(`qa.elab.emerson.edu`)'
- 'traefik.http.routers.qa-elab.entrypoints=websecure'
- 'traefik.http.routers.qa-elab.rule=Host(`qa.elab.emerson.edu`)'
- 'traefik.http.routers.qa-elab.tls=true'
- 'traefik.http.routers.qa-elab.service=qa-elab-el-next'
- 'traefik.http.services.qa-elab-el-next.loadbalancer.server.port=8083'
# - 'traefik.http.routers.qa-elab.tls.certresolver=le-http'
qa-sjm:
build:
context: .
dockerfile: Dockerfile
target: qa-image
args:
APP: sjm
PORT: 8082
CMS_ENDPOINT: cms-sjm:3001
restart: on-failure
logging:
driver: 'json-file'
options:
max-size: '1m'
max-file: '1'
labels:
- 'traefik.http.routers.qa-sjm-http.entrypoints=web'
- 'traefik.http.routers.qa-sjm-http.rule=Host(`qa.sjmsymposium.org`)'
- 'traefik.http.routers.qa-sjm.entrypoints=websecure'
- 'traefik.http.routers.qa-sjm.rule=Host(`qa.sjmsymposium.org`)'
- 'traefik.http.routers.qa-sjm.tls=true'
- 'traefik.http.routers.qa-sjm.service=qa-sjm-el-next'
- 'traefik.http.services.qa-sjm-el-next.loadbalancer.server.port=8082'
- 'traefik.http.routers.qa-sjm.tls.certresolver=letsencrypt'
api:
build:
context: .
dockerfile: Dockerfile
target: api
env_file:
- ./apps/api/.env
environment:
- PORT=8000
logging:
driver: 'json-file'
options:
max-size: '1m'
max-file: '1'
labels:
- 'traefik.http.routers.api.rule=PathPrefix(`/api`)'
- 'traefik.http.routers.api.tls=true'
- 'traefik.http.routers.api.entrypoints=websecure'
- 'traefik.http.routers.api.service=api-el-next'
- 'traefik.http.services.api-el-next.loadbalancer.server.port=8000'
- 'traefik.http.middlewares.api-stripprefix.stripprefix.prefixes=/api'
- 'traefik.http.routers.api.middlewares=api-stripprefix'
traefik-forward-auth:
image: thomseddon/traefik-forward-auth:latest
env_file: ./apps/cms/.auth.env
logging:
driver: none
labels:
- 'traefik.http.middlewares.traefik-forward-auth.forwardauth.address=http://traefik-forward-auth:4181'
- 'traefik.http.middlewares.traefik-forward-auth.forwardauth.authResponseHeaders=X-Forwarded-User'
- 'traefik.http.services.traefik-forward-auth.loadbalancer.server.port=4181'
- 'traefik.http.routers.traefik-forward-auth.rule=PathPrefix(`/_oauth`)'
- 'traefik.http.routers.traefik-forward-auth.tls=true'
- 'traefik.http.routers.traefik-forward-auth.entrypoints=websecure'
error-pages:
image: ghcr.io/patrickdappollonio/docker-http-server:v2
command: --path /html --port 5001
volumes:
- ./_site:/html
labels:
traefik.enable: 'true'
traefik.http.services.error-pages-el-next.loadbalancer.server.port: 5001
traefik.http.routers.error-pages.entrypoints: websecure
traefik.http.routers.error-pages.rule: HostRegexp(`error-pages.cms.elab.emerson.edu`)
traefik.http.routers.error-pages.priority: 1
traefik.http.middlewares.error-pages.errors.status: 400-599
traefik.http.middlewares.error-pages.errors.service: error-pages-el-next
traefik.http.middlewares.error-pages.errors.query: /error.html