forked from evertramos/nginx-proxy-automation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
executable file
·39 lines (30 loc) · 929 Bytes
/
start.sh
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
#!/bin/bash
#
# This file should be used to prepare and run your WebProxy after set up your .env file
# Source: https://github.com/evertramos/docker-compose-letsencrypt-nginx-proxy-companion
#
# 1. Check if .env file exists
if [ -e .env ]; then
source .env
else
echo "Please set up your .env file before starting your enviornment."
exit 1
fi
# 2. Create docker network
docker network create $NETWORK
# 3. Verify if second network is configured
if [ ! -z ${SERVICE_NETWORK+X} ]; then
docker network create $SERVICE_NETWORK
fi
# 4. Download the latest version of nginx.tmpl
curl https://raw.githubusercontent.com/jwilder/nginx-proxy/master/nginx.tmpl > nginx.tmpl
# 5. Update local images
docker-compose pull
# 6. Start proxy
# Check if you have multiple network
if [ -z ${SERVICE_NETWORK+X} ]; then
docker-compose up -d
else
docker-compose -f docker-compose-multiple-networks.yml up -d
fi
exit 0