Skip to content
This repository was archived by the owner on Aug 10, 2020. It is now read-only.

Commit 826b5bd

Browse files
author
Vishal Dodiya
committed
Answer PR feedback
1 parent 733ae50 commit 826b5bd

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

config/.env.example

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ MYSQL_PASSWORD=password
55

66
WORDPRESS_DB_HOST=db
77
VIRTUAL_HOST=site1.test
8+
VIRTUAL_HOST_EMAIL=[email protected]

docker-compose.yml

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ services:
88
environment:
99
- VIRTUAL_HOST=mail.${VIRTUAL_HOST}
1010
- VIRTUAL_PORT=8025
11+
- LETSENCRYPT_HOST=mail.${VIRTUAL_HOST}
1112
networks:
1213
- site-network
1314

@@ -47,6 +48,7 @@ services:
4748
environment:
4849
- VIRTUAL_HOST
4950
- LETSENCRYPT_HOST=${VIRTUAL_HOST}
51+
- LETSENCRYPT_EMAIL=${VIRTUAL_HOST_EMAIL}
5052
volumes:
5153
- "./app/src:/var/www/html"
5254
- "./config/nginx/default.conf:/etc/nginx/conf.d/default.conf"

scripts/ee4

+18
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ deleteSingleWordPress() {
131131

132132
sudo rm -rf "$WEBROOT/$SITE_NAME"
133133
docker network disconnect "$SITE_NAME" nginx-proxy
134+
if isContainerConnected letsencrypt; then
135+
docker network disconnect "$SITE_NAME" letsencrypt
136+
fi
134137
docker network rm "$SITE_NAME"
135138
fi
136139
}
@@ -201,6 +204,21 @@ isNginxProxyRunning() {
201204
fi
202205
}
203206

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+
204222
# run jwilder/nginx-proxy and JrCs/docker-letsencrypt-nginx-proxy-companion container
205223
runNginxProxyAndLetsEncrypt() {
206224
if ! isNginxProxyRunning; then

0 commit comments

Comments
 (0)