This repository was archived by the owner on Aug 10, 2020. It is now read-only.
File tree 3 files changed +21
-0
lines changed
3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -5,3 +5,4 @@ MYSQL_PASSWORD=password
5
5
6
6
WORDPRESS_DB_HOST = db
7
7
VIRTUAL_HOST = site1.test
8
+ VIRTUAL_HOST_EMAIL = [email protected]
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ services:
8
8
environment :
9
9
- VIRTUAL_HOST=mail.${VIRTUAL_HOST}
10
10
- VIRTUAL_PORT=8025
11
+ - LETSENCRYPT_HOST=mail.${VIRTUAL_HOST}
11
12
networks :
12
13
- site-network
13
14
@@ -47,6 +48,7 @@ services:
47
48
environment :
48
49
- VIRTUAL_HOST
49
50
- LETSENCRYPT_HOST=${VIRTUAL_HOST}
51
+ - LETSENCRYPT_EMAIL=${VIRTUAL_HOST_EMAIL}
50
52
volumes :
51
53
- " ./app/src:/var/www/html"
52
54
- " ./config/nginx/default.conf:/etc/nginx/conf.d/default.conf"
Original file line number Diff line number Diff line change @@ -131,6 +131,9 @@ deleteSingleWordPress() {
131
131
132
132
sudo rm -rf " $WEBROOT /$SITE_NAME "
133
133
docker network disconnect " $SITE_NAME " nginx-proxy
134
+ if isContainerConnected letsencrypt; then
135
+ docker network disconnect " $SITE_NAME " letsencrypt
136
+ fi
134
137
docker network rm " $SITE_NAME "
135
138
fi
136
139
}
@@ -201,6 +204,21 @@ isNginxProxyRunning() {
201
204
fi
202
205
}
203
206
207
+ # check if Container is connected to network
208
+ isContainerConnected () {
209
+ docker inspect -f ' {{range $p, $conf := .NetworkSettings.Networks}}
210
+ {{if ne $p "bridge"}}
211
+ {{$p}}
212
+ {{end}}
213
+ {{end}}' $1 | grep $SITE_NAME > /dev/null 2>&1
214
+
215
+ if [[ $? == 0 ]]; then
216
+ return 0
217
+ else
218
+ return 1
219
+ fi
220
+ }
221
+
204
222
# run jwilder/nginx-proxy and JrCs/docker-letsencrypt-nginx-proxy-companion container
205
223
runNginxProxyAndLetsEncrypt () {
206
224
if ! isNginxProxyRunning; then
You can’t perform that action at this time.
0 commit comments