Merge pull request #1254 from kilianc/feature/custom-start-cmd

added DOKKU_DOCKERFILE_START_CMD support
This commit is contained in:
Jose Diaz-Gonzalez
2015-07-03 12:54:24 -04:00
2 changed files with 19 additions and 1 deletions

View File

@@ -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

6
dokku
View File

@@ -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}