Skip to content

Commit

Permalink
Clean up of environment nginx start-up
Browse files Browse the repository at this point in the history
  • Loading branch information
portchris committed Jan 30, 2019
1 parent db2f744 commit eb810d1
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 70 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ adminer.php
nbproject/
data/
env/nginx/webserver/conf.d/default.conf
env/nginx/ssl
env/nginx/certs
env/nginx/share
env/nginx/webserver/vhost.d
Expand Down
2 changes: 1 addition & 1 deletion env/nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ ADD ./certs /etc/nginx/certs
# apt-get update && \
# apt-get install -y python-certbot-nginx -t stretch-backports

EXPOSE 80 443
EXPOSE 80 443 8080

# Execute Nginx config using environment variables to start all services
CMD ["bash", "/scripts/start.sh"]
7 changes: 0 additions & 7 deletions env/nginx/scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,17 @@ if [ -f $ENV ]; then
exit 1
fi

if [ -z ${WEBROOT+x} ]; then
echo "WEBROOT not set!"
exit 1
fi

if [ -f $CONF_DEFAULT ]; then
rm $CONF_DEFAULT
fi

# Update CONF to match current domain env
if [ ! -f $CONF ]; then
CONF="/etc/nginx/conf.d/$VIRTUAL_HOST.template"
# CONF_DEFAULT="/etc/nginx/vhost.d/$VIRTUAL_HOST.conf"
fi

cp $CONF $CONF_DEFAULT
sed -i -e "s/{VIRTUAL_HOST}/${VIRTUAL_HOST}/g" $CONF_DEFAULT
sed -i -e "s/{WEBROOT}/${WEBROOT}/g" $CONF_DEFAULT
echo # \n
cat $CONF_DEFAULT
echo # \n
Expand Down
61 changes: 0 additions & 61 deletions env/nginx/webserver/conf.d/naturalremedy.company.template

This file was deleted.

27 changes: 27 additions & 0 deletions env/nginx/webserver/conf.d/www.naturalremedy.company.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
server {
listen 8080;
listen [::]:8080;

server_name naturalremedy.company;
return 301 $scheme://www.naturalremedy.company$request_uri;
}

server {

listen 8080;
listen [::]:8080;

server_name www.naturalremedy.company;

set $MAGE_ROOT /home/www/naturalremedy/src;
set $code default;

root $MAGE_ROOT;
index index.php;

include /etc/nginx/defaults/magento1.conf;

location / {
try_files $uri $uri/ /index.php$is_args$args;
}
}
1 change: 0 additions & 1 deletion start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env bash

docker network create nginx-proxy
docker-compose up -d --remove-orphans

0 comments on commit eb810d1

Please sign in to comment.