mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
fix app.json extraction in dockerfile apps not using /app. closes #2300
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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": {
|
||||
|
||||
Reference in New Issue
Block a user