@@ -12,8 +12,11 @@ MACHINE='default'
1212# exists in global DNS, which may cause issues reassigning it with dnsmasq.
1313export DOMAIN=${DOMAIN:- ' test' }
1414
15+ # Nginx proxy exposed port. Useful when using something other than 80.
16+ export NGINX_PORT=$( docker port nginx-proxy | awk -F ' :' ' {print $2}' )
17+
1518# Used as the prefix for docker networking, container naming and nginx hostname.
16- export PROJECT=$( basename ${PWD} | sed ' s/[-_]//g ' )
19+ export PROJECT=$( basename ${PWD} )
1720
1821# Determine the OS type of the host machine.
1922if [ " $( uname) " == " Darwin" ]; then
@@ -53,8 +56,9 @@ dsh_start() {
5356 notice " Starting project containers."
5457 docker-compose up -d
5558 setup_xdebug
59+ export URL=" http://${PROJECT} .${DOMAIN} $( if [ ! $NGINX_PORT -eq ' 80' ]; then echo " :$NGINX_PORT " ; fi) "
5660 notice " Please wait about 10 seconds for the database to settle.
57- You can now access the site from http:// ${PROJECT} . ${DOMAIN } .
61+ You can now access the site from ${URL } .
5862Project files are available in /code, You may need to build and install your
5963 project before it starts working.
6064Connecting via ./dsh shell and running robo build is a common next step."
@@ -242,6 +246,9 @@ setup_nginx_proxy() {
242246
243247 if ! docker ps | grep " nginx-proxy" > /dev/null; then
244248 error " jwilder/nginx-proxy could not be started."
249+ else
250+ # Update the nginx port as it wasn't running initially.
251+ export NGINX_PORT=$( docker port nginx-proxy | awk -F ' :' ' {print $2}' )
245252 fi
246253}
247254
0 commit comments