diff --git a/plugins/00_dokku-standard/commands b/plugins/00_dokku-standard/commands index e6c6d5751..a091783e5 100755 --- a/plugins/00_dokku-standard/commands +++ b/plugins/00_dokku-standard/commands @@ -36,7 +36,7 @@ case "$1" in dockerfile) # extract first port from Dockerfile - DOCKERFILE_PORT=$(grep EXPOSE Dockerfile | head -1 | awk '{ print $2 }' || true) + DOCKERFILE_PORT=$(grep "^EXPOSE \+[[:digit:]]\+\(\/tcp\)\? *$" Dockerfile | head -1 | sed 's/EXPOSE \+\([[:digit:]]\+\)\(\/tcp\)\?.*/\1/' || true) [[ -n "$DOCKERFILE_PORT" ]] && dokku config:set-norestart $APP DOKKU_DOCKERFILE_PORT=$DOCKERFILE_PORT # buildstep pluginhooks don't necessarily make sense for dockerfiles. call the new breed!!! diff --git a/tests/apps/dockerfile/Dockerfile b/tests/apps/dockerfile/Dockerfile index cdae029b0..cd47658a5 100644 --- a/tests/apps/dockerfile/Dockerfile +++ b/tests/apps/dockerfile/Dockerfile @@ -2,7 +2,9 @@ FROM ubuntu:trusty ENV LC_ALL C ENV DEBIAN_FRONTEND noninteractive ENV DEBCONF_NONINTERACTIVE_SEEN true -EXPOSE 3000 +EXPOSE 3001/udp +EXPOSE 3000/tcp +EXPOSE 3003 RUN apt-get install -y software-properties-common && add-apt-repository ppa:chris-lea/node.js && apt-get update RUN apt-get install -y build-essential curl postgresql-client-9.3 nodejs git