From 2fec877b5e06089ee94787d74fcba87be5deee0e Mon Sep 17 00:00:00 2001 From: Timmo <28114703+timmo001@users.noreply.github.com> Date: Sun, 19 Aug 2018 15:34:50 +0100 Subject: [PATCH] :hammer: move app and api to /data --- home-panel/Dockerfile | 4 ++-- home-panel/rootfs/etc/cont-init.d/20-config.sh | 2 +- home-panel/rootfs/etc/cont-init.d/40-api.sh | 6 +++--- home-panel/rootfs/etc/services.d/api/run | 2 +- home-panel/rootfs/etc/services.d/config/run | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/home-panel/Dockerfile b/home-panel/Dockerfile index c0f9abc..55cd331 100644 --- a/home-panel/Dockerfile +++ b/home-panel/Dockerfile @@ -20,7 +20,7 @@ RUN \ RUN mkdir -p /run/nginx && mkdir -p /usr/share/nginx/html # App -WORKDIR /usr/src/app +WORKDIR /data/app # Download and unzip into nginx html directory RUN \ @@ -31,7 +31,7 @@ RUN \ && rm -Rf ./* # API -WORKDIR /usr/src/api +WORKDIR /data/api # Clone and checkout API release RUN \ diff --git a/home-panel/rootfs/etc/cont-init.d/20-config.sh b/home-panel/rootfs/etc/cont-init.d/20-config.sh index 58932d0..0b25f76 100644 --- a/home-panel/rootfs/etc/cont-init.d/20-config.sh +++ b/home-panel/rootfs/etc/cont-init.d/20-config.sh @@ -16,4 +16,4 @@ fi hass.log.info "Copy config.." -cp "$config_file" /usr/src/api/files/config.json +cp "$config_file" /data/api/files/config.json diff --git a/home-panel/rootfs/etc/cont-init.d/40-api.sh b/home-panel/rootfs/etc/cont-init.d/40-api.sh index 3fe9061..4151205 100644 --- a/home-panel/rootfs/etc/cont-init.d/40-api.sh +++ b/home-panel/rootfs/etc/cont-init.d/40-api.sh @@ -6,13 +6,13 @@ # shellcheck disable=SC1091 source /usr/lib/hassio-addons/base.sh -echo "REACT_APP_API_URL = $(hass.config.get 'api_url')" > /usr/src/app/.env.local +echo "REACT_APP_API_URL = $(hass.config.get 'api_url')" > /data/app/.env.local certfile="/ssl/$(hass.config.get 'certfile')" keyfile="/ssl/$(hass.config.get 'keyfile')" if hass.config.true 'ssl'; then hass.log.info "Copy SSL certs to api directory" - cp "$certfile" /usr/src/api/fullchain.pem - cp "$keyfile" /usr/src/api/privkey.pem + cp "$certfile" /data/api/fullchain.pem + cp "$keyfile" /data/api/privkey.pem fi diff --git a/home-panel/rootfs/etc/services.d/api/run b/home-panel/rootfs/etc/services.d/api/run index 1104f3e..de6b916 100644 --- a/home-panel/rootfs/etc/services.d/api/run +++ b/home-panel/rootfs/etc/services.d/api/run @@ -9,6 +9,6 @@ source /usr/lib/hassio-addons/base.sh hass.log.info "Run API.." # shellcheck disable=SC2164 -cd /usr/src/api +cd /data/api node index.js diff --git a/home-panel/rootfs/etc/services.d/config/run b/home-panel/rootfs/etc/services.d/config/run index 7c93f9d..5d50a8c 100644 --- a/home-panel/rootfs/etc/services.d/config/run +++ b/home-panel/rootfs/etc/services.d/config/run @@ -12,5 +12,5 @@ config_file="/config/$(hass.config.get 'config_file')" # shellcheck disable=SC2034 inotifywait -m "$config_file" | while read file; do \ hass.log.debug "Update Config.." \ -&& cp "$config_file" /usr/src/api/files/config.json; \ +&& cp "$config_file" /data/api/files/config.json; \ done