forked from evertramos/nginx-proxy-automation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b5e6eb2
commit 19c6e45
Showing
3 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/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. 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
# Set up your DOMAIN | ||
if [ $# -eq 0 ]; then | ||
echo "Please inform your domain name to test your proxy." | ||
echo "./start_test.sh $1" | ||
exit 1 | ||
else | ||
DOMAIN=$1 | ||
fi | ||
|
||
# Read your .env file | ||
source .env | ||
|
||
# Testing your proxy | ||
if [ -z ${SERVICE_NETWORK+X} ]; then | ||
docker run -d -e VIRTUAL_HOST=$DOMAIN --network=$NETWORK --name test-web httpd:alpine | ||
else | ||
docker run -d -e VIRTUAL_HOST=$DOMAIN --network=$SERVICE_NETWORK --name test-web httpd:alpine | ||
fi | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
# Stop and remove test enviornment | ||
docker stop test-web && docker rm test-web | ||
|
||
exit 0 |