这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@michaelshobbs
Copy link
Member

This honors $DOKKU_DOCKERFILE_PORT when binding the docker container to an external IP.

refs #1336

@michaelshobbs
Copy link
Member Author

@josegonzalez I think we just missed this use case. Not sure we want to add a deploy test specifically for this though. Thoughts?

dokku Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first if/elif stanza can probably be simplified a bit as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you mean?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like, we check several times what the PROC_TYPE is, as well as two checks on BIND_EXTERNAL.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I meant, do you have a recommendation?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like:

if [[ "$PROC_TYPE" == "web" ]]; then
    port=${DOKKU_DOCKERFILE_PORT:=5000}
    if [[ "$BIND_EXTERNAL" = "true" ]]; then
        id=$(docker run -d -p $port -e PORT=$port $DOCKER_ARGS $IMAGE $START_CMD)
        port=$(docker port $id $port | sed 's/[0-9.]*://')
        ipaddr=127.0.0.1
    else
        id=$(docker run -d -e PORT=$port $DOCKER_ARGS $IMAGE $START_CMD)
        ipaddr=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' $id)
    fi
else
    id=$(docker run -d $DOCKER_ARGS $IMAGE $START_CMD)
fi

shrug

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh oh oh yeah sorry I was overthinking it. this makes sense.

@josegonzalez
Copy link
Member

No test needed imo.

michaelshobbs added a commit that referenced this pull request Jul 24, 2015
…ns-vhost

set and use $port whenever $PROC_TYPE == 'web'
@michaelshobbs michaelshobbs merged commit 3525f69 into master Jul 24, 2015
@michaelshobbs michaelshobbs deleted the 1336_mh-use-dockerfile-port-sans-vhost branch July 24, 2015 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants