mirror of
https://github.com/hassio-addons/addon-home-panel.git
synced 2025-05-05 03:11:24 +00:00
🔨 move app and api to /data
This commit is contained in:
parent
8bedd9128b
commit
2fec877b5e
5 changed files with 8 additions and 8 deletions
|
@ -20,7 +20,7 @@ RUN \
|
||||||
RUN mkdir -p /run/nginx && mkdir -p /usr/share/nginx/html
|
RUN mkdir -p /run/nginx && mkdir -p /usr/share/nginx/html
|
||||||
|
|
||||||
# App
|
# App
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /data/app
|
||||||
|
|
||||||
# Download and unzip into nginx html directory
|
# Download and unzip into nginx html directory
|
||||||
RUN \
|
RUN \
|
||||||
|
@ -31,7 +31,7 @@ RUN \
|
||||||
&& rm -Rf ./*
|
&& rm -Rf ./*
|
||||||
|
|
||||||
# API
|
# API
|
||||||
WORKDIR /usr/src/api
|
WORKDIR /data/api
|
||||||
|
|
||||||
# Clone and checkout API release
|
# Clone and checkout API release
|
||||||
RUN \
|
RUN \
|
||||||
|
|
|
@ -16,4 +16,4 @@ fi
|
||||||
|
|
||||||
hass.log.info "Copy config.."
|
hass.log.info "Copy config.."
|
||||||
|
|
||||||
cp "$config_file" /usr/src/api/files/config.json
|
cp "$config_file" /data/api/files/config.json
|
||||||
|
|
|
@ -6,13 +6,13 @@
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
source /usr/lib/hassio-addons/base.sh
|
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')"
|
certfile="/ssl/$(hass.config.get 'certfile')"
|
||||||
keyfile="/ssl/$(hass.config.get 'keyfile')"
|
keyfile="/ssl/$(hass.config.get 'keyfile')"
|
||||||
|
|
||||||
if hass.config.true 'ssl'; then
|
if hass.config.true 'ssl'; then
|
||||||
hass.log.info "Copy SSL certs to api directory"
|
hass.log.info "Copy SSL certs to api directory"
|
||||||
cp "$certfile" /usr/src/api/fullchain.pem
|
cp "$certfile" /data/api/fullchain.pem
|
||||||
cp "$keyfile" /usr/src/api/privkey.pem
|
cp "$keyfile" /data/api/privkey.pem
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -9,6 +9,6 @@ source /usr/lib/hassio-addons/base.sh
|
||||||
hass.log.info "Run API.."
|
hass.log.info "Run API.."
|
||||||
|
|
||||||
# shellcheck disable=SC2164
|
# shellcheck disable=SC2164
|
||||||
cd /usr/src/api
|
cd /data/api
|
||||||
|
|
||||||
node index.js
|
node index.js
|
||||||
|
|
|
@ -12,5 +12,5 @@ config_file="/config/$(hass.config.get 'config_file')"
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
inotifywait -m "$config_file" | while read file; do \
|
inotifywait -m "$config_file" | while read file; do \
|
||||||
hass.log.debug "Update Config.." \
|
hass.log.debug "Update Config.." \
|
||||||
&& cp "$config_file" /usr/src/api/files/config.json; \
|
&& cp "$config_file" /data/api/files/config.json; \
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue