@@ -4,7 +4,7 @@ services:
4
4
proxy :
5
5
image : traefik:v2.2
6
6
networks :
7
- - ${TRAEFIK_PUBLIC_NETWORK}
7
+ - ${TRAEFIK_PUBLIC_NETWORK?Variable not set }
8
8
- default
9
9
volumes :
10
10
- /var/run/docker.sock:/var/run/docker.sock
@@ -13,7 +13,7 @@ services:
13
13
- --providers.docker
14
14
# Add a constraint to only use services with the label for this stack
15
15
# from the env var TRAEFIK_TAG
16
- - --providers.docker.constraints=Label(`traefik.constraint-label-stack`, `${TRAEFIK_TAG}`)
16
+ - --providers.docker.constraints=Label(`traefik.constraint-label-stack`, `${TRAEFIK_TAG?Variable not set }`)
17
17
# Do not expose all Docker services, only the ones explicitly exposed
18
18
- --providers.docker.exposedbydefault=false
19
19
# Enable Docker Swarm mode
@@ -32,41 +32,41 @@ services:
32
32
# Enable Traefik for this service, to make it available in the public network
33
33
- traefik.enable=true
34
34
# Use the traefik-public network (declared below)
35
- - traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK}
35
+ - traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK?Variable not set }
36
36
# Use the custom label "traefik.constraint-label=traefik-public"
37
37
# This public Traefik will only use services with this label
38
- - traefik.constraint-label=${TRAEFIK_PUBLIC_TAG}
38
+ - traefik.constraint-label=${TRAEFIK_PUBLIC_TAG?Variable not set }
39
39
# traefik-http set up only to use the middleware to redirect to https
40
- - traefik.http.middlewares.${STACK_NAME}-https-redirect.redirectscheme.scheme=https
41
- - traefik.http.middlewares.${STACK_NAME}-https-redirect.redirectscheme.permanent=true
40
+ - traefik.http.middlewares.${STACK_NAME?Variable not set }-https-redirect.redirectscheme.scheme=https
41
+ - traefik.http.middlewares.${STACK_NAME?Variable not set }-https-redirect.redirectscheme.permanent=true
42
42
# Handle host with and without "www" to redirect to only one of them
43
43
# Uses environment variable DOMAIN
44
44
# To disable www redirection remove the Host() you want to discard, here and
45
45
# below for HTTPS
46
- - traefik.http.routers.${STACK_NAME}-proxy-http.rule=Host(`${DOMAIN}`) || Host(`www.${DOMAIN}`)
47
- - traefik.http.routers.${STACK_NAME}-proxy-http.entrypoints=http
46
+ - traefik.http.routers.${STACK_NAME?Variable not set }-proxy-http.rule=Host(`${DOMAIN?Variable not set }`) || Host(`www.${DOMAIN?Variable not set }`)
47
+ - traefik.http.routers.${STACK_NAME?Variable not set }-proxy-http.entrypoints=http
48
48
# traefik-https the actual router using HTTPS
49
- - traefik.http.routers.${STACK_NAME}-proxy-https.rule=Host(`${DOMAIN}`) || Host(`www.${DOMAIN}`)
50
- - traefik.http.routers.${STACK_NAME}-proxy-https.entrypoints=https
51
- - traefik.http.routers.${STACK_NAME}-proxy-https.tls=true
49
+ - traefik.http.routers.${STACK_NAME?Variable not set }-proxy-https.rule=Host(`${DOMAIN?Variable not set }`) || Host(`www.${DOMAIN?Variable not set }`)
50
+ - traefik.http.routers.${STACK_NAME?Variable not set }-proxy-https.entrypoints=https
51
+ - traefik.http.routers.${STACK_NAME?Variable not set }-proxy-https.tls=true
52
52
# Use the "le" (Let's Encrypt) resolver created below
53
- - traefik.http.routers.${STACK_NAME}-proxy-https.tls.certresolver=le
53
+ - traefik.http.routers.${STACK_NAME?Variable not set }-proxy-https.tls.certresolver=le
54
54
# Define the port inside of the Docker service to use
55
- - traefik.http.services.${STACK_NAME}-proxy.loadbalancer.server.port=80
55
+ - traefik.http.services.${STACK_NAME?Variable not set }-proxy.loadbalancer.server.port=80
56
56
# Handle domain with and without "www" to redirect to only one
57
57
# To disable www redirection remove the next line
58
- - traefik.http.middlewares.${STACK_NAME}-www-redirect.redirectregex.regex=^https?://(www.)?(${DOMAIN})/(.*)
58
+ - traefik.http.middlewares.${STACK_NAME?Variable not set }-www-redirect.redirectregex.regex=^https?://(www.)?(${DOMAIN?Variable not set })/(.*)
59
59
# Redirect a domain with www to non-www
60
60
# To disable it remove the next line
61
- - traefik.http.middlewares.${STACK_NAME}-www-redirect.redirectregex.replacement=https://${DOMAIN}/$${3}
61
+ - traefik.http.middlewares.${STACK_NAME?Variable not set }-www-redirect.redirectregex.replacement=https://${DOMAIN?Variable not set }/$${3}
62
62
# Redirect a domain without www to www
63
63
# To enable it remove the previous line and uncomment the next
64
64
# - traefik.http.middlewares.${STACK_NAME}-www-redirect.redirectregex.replacement=https://www.${DOMAIN}/$${3}
65
65
# Middleware to redirect www, to disable it remove the next line
66
- - traefik.http.routers.${STACK_NAME}-proxy-https.middlewares=${STACK_NAME}-www-redirect
66
+ - traefik.http.routers.${STACK_NAME?Variable not set }-proxy-https.middlewares=${STACK_NAME?Variable not set }-www-redirect
67
67
# Middleware to redirect www, and redirect HTTP to HTTPS
68
- # to disable www redirection remove the section: ${STACK_NAME}-www-redirect,
69
- - traefik.http.routers.${STACK_NAME}-proxy-http.middlewares=${STACK_NAME}-www-redirect,${STACK_NAME}-https-redirect
68
+ # to disable www redirection remove the section: ${STACK_NAME?Variable not set }-www-redirect,
69
+ - traefik.http.routers.${STACK_NAME?Variable not set }-proxy-http.middlewares=${STACK_NAME?Variable not set }-www-redirect,${STACK_NAME?Variable not set }-https-redirect
70
70
71
71
db :
72
72
image : postgres:12
@@ -79,12 +79,12 @@ services:
79
79
deploy :
80
80
placement :
81
81
constraints :
82
- - node.labels.${STACK_NAME}.app-db-data == true
82
+ - node.labels.${STACK_NAME?Variable not set }.app-db-data == true
83
83
84
84
pgadmin :
85
85
image : dpage/pgadmin4
86
86
networks :
87
- - ${TRAEFIK_PUBLIC_NETWORK}
87
+ - ${TRAEFIK_PUBLIC_NETWORK?Variable not set }
88
88
- default
89
89
depends_on :
90
90
- db
@@ -93,16 +93,16 @@ services:
93
93
deploy :
94
94
labels :
95
95
- traefik.enable=true
96
- - traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK}
97
- - traefik.constraint-label=${TRAEFIK_PUBLIC_TAG}
98
- - traefik.http.routers.${STACK_NAME}-pgadmin-http.rule=Host(`pgadmin.${DOMAIN}`)
99
- - traefik.http.routers.${STACK_NAME}-pgadmin-http.entrypoints=http
100
- - traefik.http.routers.${STACK_NAME}-pgadmin-http.middlewares=${STACK_NAME}-https-redirect
101
- - traefik.http.routers.${STACK_NAME}-pgadmin-https.rule=Host(`pgadmin.${DOMAIN}`)
102
- - traefik.http.routers.${STACK_NAME}-pgadmin-https.entrypoints=https
103
- - traefik.http.routers.${STACK_NAME}-pgadmin-https.tls=true
104
- - traefik.http.routers.${STACK_NAME}-pgadmin-https.tls.certresolver=le
105
- - traefik.http.services.${STACK_NAME}-pgadmin.loadbalancer.server.port=5050
96
+ - traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK?Variable not set }
97
+ - traefik.constraint-label=${TRAEFIK_PUBLIC_TAG?Variable not set }
98
+ - traefik.http.routers.${STACK_NAME?Variable not set }-pgadmin-http.rule=Host(`pgadmin.${DOMAIN?Variable not set }`)
99
+ - traefik.http.routers.${STACK_NAME?Variable not set }-pgadmin-http.entrypoints=http
100
+ - traefik.http.routers.${STACK_NAME?Variable not set }-pgadmin-http.middlewares=${STACK_NAME?Variable not set }-https-redirect
101
+ - traefik.http.routers.${STACK_NAME?Variable not set }-pgadmin-https.rule=Host(`pgadmin.${DOMAIN?Variable not set }`)
102
+ - traefik.http.routers.${STACK_NAME?Variable not set }-pgadmin-https.entrypoints=https
103
+ - traefik.http.routers.${STACK_NAME?Variable not set }-pgadmin-https.tls=true
104
+ - traefik.http.routers.${STACK_NAME?Variable not set }-pgadmin-https.tls.certresolver=le
105
+ - traefik.http.services.${STACK_NAME?Variable not set }-pgadmin.loadbalancer.server.port=5050
106
106
107
107
queue :
108
108
image : rabbitmq:3
@@ -114,7 +114,7 @@ services:
114
114
flower :
115
115
image : mher/flower
116
116
networks :
117
- - ${TRAEFIK_PUBLIC_NETWORK}
117
+ - ${TRAEFIK_PUBLIC_NETWORK?Variable not set }
118
118
- default
119
119
env_file :
120
120
- .env
@@ -126,26 +126,26 @@ services:
126
126
deploy :
127
127
labels :
128
128
- traefik.enable=true
129
- - traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK}
130
- - traefik.constraint-label=${TRAEFIK_PUBLIC_TAG}
131
- - traefik.http.routers.${STACK_NAME}-flower-http.rule=Host(`flower.${DOMAIN}`)
132
- - traefik.http.routers.${STACK_NAME}-flower-http.entrypoints=http
133
- - traefik.http.routers.${STACK_NAME}-flower-http.middlewares=${STACK_NAME}-https-redirect
134
- - traefik.http.routers.${STACK_NAME}-flower-https.rule=Host(`flower.${DOMAIN}`)
135
- - traefik.http.routers.${STACK_NAME}-flower-https.entrypoints=https
136
- - traefik.http.routers.${STACK_NAME}-flower-https.tls=true
137
- - traefik.http.routers.${STACK_NAME}-flower-https.tls.certresolver=le
138
- - traefik.http.services.${STACK_NAME}-flower.loadbalancer.server.port=5555
129
+ - traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK?Variable not set }
130
+ - traefik.constraint-label=${TRAEFIK_PUBLIC_TAG?Variable not set }
131
+ - traefik.http.routers.${STACK_NAME?Variable not set }-flower-http.rule=Host(`flower.${DOMAIN?Variable not set }`)
132
+ - traefik.http.routers.${STACK_NAME?Variable not set }-flower-http.entrypoints=http
133
+ - traefik.http.routers.${STACK_NAME?Variable not set }-flower-http.middlewares=${STACK_NAME?Variable not set }-https-redirect
134
+ - traefik.http.routers.${STACK_NAME?Variable not set }-flower-https.rule=Host(`flower.${DOMAIN?Variable not set }`)
135
+ - traefik.http.routers.${STACK_NAME?Variable not set }-flower-https.entrypoints=https
136
+ - traefik.http.routers.${STACK_NAME?Variable not set }-flower-https.tls=true
137
+ - traefik.http.routers.${STACK_NAME?Variable not set }-flower-https.tls.certresolver=le
138
+ - traefik.http.services.${STACK_NAME?Variable not set }-flower.loadbalancer.server.port=5555
139
139
140
140
backend :
141
- image : ' ${DOCKER_IMAGE_BACKEND}:${TAG-latest}'
141
+ image : ' ${DOCKER_IMAGE_BACKEND?Variable not set }:${TAG-latest}'
142
142
depends_on :
143
143
- db
144
144
env_file :
145
145
- .env
146
146
environment :
147
- - SERVER_NAME=${DOMAIN}
148
- - SERVER_HOST=https://${DOMAIN}
147
+ - SERVER_NAME=${DOMAIN?Variable not set }
148
+ - SERVER_HOST=https://${DOMAIN?Variable not set }
149
149
# Allow explicit env var override for tests
150
150
- SMTP_HOST=${SMTP_HOST}
151
151
build :
@@ -156,40 +156,40 @@ services:
156
156
deploy :
157
157
labels :
158
158
- traefik.enable=true
159
- - traefik.constraint-label-stack=${TRAEFIK_TAG}
160
- - traefik.http.routers.${STACK_NAME}-backend-http.rule=PathPrefix(`/api`) || PathPrefix(`/docs`) || PathPrefix(`/redoc`)
161
- - traefik.http.services.${STACK_NAME}-backend.loadbalancer.server.port=80
159
+ - traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set }
160
+ - traefik.http.routers.${STACK_NAME?Variable not set }-backend-http.rule=PathPrefix(`/api`) || PathPrefix(`/docs`) || PathPrefix(`/redoc`)
161
+ - traefik.http.services.${STACK_NAME?Variable not set }-backend.loadbalancer.server.port=80
162
162
163
163
celeryworker :
164
- image : ' ${DOCKER_IMAGE_CELERYWORKER}:${TAG-latest}'
164
+ image : ' ${DOCKER_IMAGE_CELERYWORKER?Variable not set }:${TAG-latest}'
165
165
depends_on :
166
166
- db
167
167
- queue
168
168
env_file :
169
169
- .env
170
170
environment :
171
- - SERVER_NAME=${DOMAIN}
172
- - SERVER_HOST=https://${DOMAIN}
171
+ - SERVER_NAME=${DOMAIN?Variable not set }
172
+ - SERVER_HOST=https://${DOMAIN?Variable not set }
173
173
# Allow explicit env var override for tests
174
- - SMTP_HOST=${SMTP_HOST}
174
+ - SMTP_HOST=${SMTP_HOST?Variable not set }
175
175
build :
176
176
context : ./backend
177
177
dockerfile : celeryworker.dockerfile
178
178
args :
179
179
INSTALL_DEV : ${INSTALL_DEV-false}
180
180
181
181
frontend :
182
- image : ' ${DOCKER_IMAGE_FRONTEND}:${TAG-latest}'
182
+ image : ' ${DOCKER_IMAGE_FRONTEND?Variable not set }:${TAG-latest}'
183
183
build :
184
184
context : ./frontend
185
185
args :
186
186
FRONTEND_ENV : ${FRONTEND_ENV-production}
187
187
deploy :
188
188
labels :
189
189
- traefik.enable=true
190
- - traefik.constraint-label-stack=${TRAEFIK_TAG}
191
- - traefik.http.routers.${STACK_NAME}-frontend-http.rule=PathPrefix(`/`)
192
- - traefik.http.services.${STACK_NAME}-frontend.loadbalancer.server.port=80
190
+ - traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set }
191
+ - traefik.http.routers.${STACK_NAME?Variable not set }-frontend-http.rule=PathPrefix(`/`)
192
+ - traefik.http.services.${STACK_NAME?Variable not set }-frontend.loadbalancer.server.port=80
193
193
194
194
volumes :
195
195
app-db-data :
0 commit comments