diff --git a/docs/application-deployment.md b/docs/application-deployment.md index 11ab783c1..7cb332b20 100644 --- a/docs/application-deployment.md +++ b/docs/application-deployment.md @@ -56,6 +56,20 @@ Deployment of `Dockerfile` repos is supported as of v0.3.15. Simply place a Dock By default, we will extract the first `EXPOSE` port and tell nginx to proxy your app to that port. Alternatively, you can set `$DOCKERFILE_PORT` in your app's dokku configuration. +By default no arguments are passed to `docker run` when deploying the container and the `CMD` or `ENTRYPOINT` defined in the `Dockerfile` are executed. You can take advantage of docker ability of overriding the `CMD` or passing parameters to your `ENTRYPOINT` setting `$DOKKU_DOCKERFILE_START_CMD`. Let's say for example you are deploying a base nodejs image, with the following `ENTRYPOINT`: + +``` +ENTRYPOINT ["node"] +``` + +You can do: + +``` +dokku config:set DOKKU_DOCKERFILE_START_CMD="--harmony server.js" +``` + +To tell docker what to run. + Setting `$DOKKU_DOCKERFILE_CACHE_BUILD` to `true` or `false` will enable or disable docker's image layer cache. Lastly, for more granular build control, you may also pass any `docker build` option to `docker`, by setting `$DOKKU_DOCKER_BUILD_OPTS`. ## Default vhost diff --git a/dokku b/dokku index 4252f831f..15a1ccdd4 100755 --- a/dokku +++ b/dokku @@ -92,7 +92,11 @@ case "$1" in BIND_EXTERNAL=$(pluginhook bind-external-ip $APP) [[ -n "$DOKKU_BUILDSTEP" ]] && START_CMD="/start $PROC_TYPE" - [[ -z "$DOKKU_BUILDSTEP" ]] && DOKKU_DOCKERFILE_PORT=$(dokku config:get $APP DOKKU_DOCKERFILE_PORT || true) + + if [[ -z "$DOKKU_BUILDSTEP" ]];then + DOKKU_DOCKERFILE_PORT=$(dokku config:get $APP DOKKU_DOCKERFILE_PORT || true) + START_CMD=$(dokku config:get $APP DOKKU_DOCKERFILE_START_CMD || $START_CMD) + fi if [[ "$BIND_EXTERNAL" = "false" ]] && [[ "$PROC_TYPE" == "web" ]];then port=${DOKKU_DOCKERFILE_PORT:=5000}