Skip to content

Commit

Permalink
Fix standard file names
Browse files Browse the repository at this point in the history
  • Loading branch information
evertramos committed Dec 11, 2017
1 parent b5e6eb2 commit 19c6e45
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
36 changes: 36 additions & 0 deletions start.sh
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
22 changes: 22 additions & 0 deletions test_start.sh
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
6 changes: 6 additions & 0 deletions test_stop.sh
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

0 comments on commit 19c6e45

Please sign in to comment.