diff --git a/docs/advanced-usage/deployment-tasks.md b/docs/advanced-usage/deployment-tasks.md index cb1c20d37..c15ac3bf3 100644 --- a/docs/advanced-usage/deployment-tasks.md +++ b/docs/advanced-usage/deployment-tasks.md @@ -13,7 +13,8 @@ Common use cases include: Dokku accomplishes this by using an `app.json` file. The format in use is similar to format of Heroku's [app.json](https://devcenter.heroku.com/articles/app-json-schema). However, dokku currently only supports the nodes `scripts.dokku.predeploy` and `scripts.dokku.postdeploy`. -Simply place an `app.json` file in the root of your repository or for dockerfile apps, `ADD` it to /app. +For buildpack apps, simply place an `app.json` file in the root of your repository. +For dockerfile apps, place `app.json` in the configured `WORKDIR` directory; otherwise dokku defaults to the buildpack app behavior of looking in `/app`. >NOTE: postdeploy changes are *NOT* committed to the app image. ### Example app.json diff --git a/plugins/00_dokku-standard/exec-app-json-scripts b/plugins/00_dokku-standard/exec-app-json-scripts index ab2207aab..b6a6870de 100755 --- a/plugins/00_dokku-standard/exec-app-json-scripts +++ b/plugins/00_dokku-standard/exec-app-json-scripts @@ -10,7 +10,7 @@ get_phase_script() { local APP_JSON_FILE="$GET_PHASE_SCRIPT_TMP_WORK_DIR/app.json" trap 'rm -rf "$GET_PHASE_SCRIPT_TMP_WORK_DIR" > /dev/null' RETURN INT TERM - copy_from_image "$IMAGE" "/app/app.json" "$GET_PHASE_SCRIPT_TMP_WORK_DIR" 2>/dev/null || true + copy_from_image "$IMAGE" "app.json" "$GET_PHASE_SCRIPT_TMP_WORK_DIR" 2>/dev/null || true if [[ -f "$APP_JSON_FILE" ]];then local VALUE=$(get_json_value "scripts.dokku.${PHASE_SCRIPT_KEY}" < "$APP_JSON_FILE") diff --git a/tests/apps/dockerfile/Dockerfile b/tests/apps/dockerfile/Dockerfile index fa82185d5..5b7dfd4fc 100644 --- a/tests/apps/dockerfile/Dockerfile +++ b/tests/apps/dockerfile/Dockerfile @@ -4,8 +4,8 @@ EXPOSE 3001/udp EXPOSE 3000/tcp EXPOSE 3003 -COPY . /app -WORKDIR /app +COPY . /var/www/html +WORKDIR /var/www/html RUN npm install CMD npm start diff --git a/tests/apps/dockerfile/app.json b/tests/apps/dockerfile/app.json index 9b9aa95ce..d3d57e1fe 100644 --- a/tests/apps/dockerfile/app.json +++ b/tests/apps/dockerfile/app.json @@ -11,8 +11,8 @@ "logo": "https://raw.githubusercontent.com/dokku/dokku/master/docs/assets/dokku.png", "scripts": { "dokku": { - "predeploy": "touch /app/predeploy.test", - "postdeploy": "touch /app/postdeploy.test" + "predeploy": "mkdir -p /app && touch /app/predeploy.test", + "postdeploy": "mkdir -p /app && touch /app/postdeploy.test" } }, "env": {