2020-02-10 08:00:54 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
## Thanks
|
|
|
|
# https://serverfault.com/a/919212
|
|
|
|
##
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rsync -a --delete /var/www/html/assets/js /assets
|
|
|
|
rsync -a --delete /var/www/html/assets/css /assets
|
|
|
|
rsync -a --delete /var/www/html/assets/frappe /assets
|
|
|
|
rsync -a --delete /var/www/html/assets/erpnext /assets
|
|
|
|
|
|
|
|
chmod -R 755 /assets
|
|
|
|
|
2020-02-20 16:18:51 +00:00
|
|
|
if [[ -z "$FRAPPE_PY" ]]; then
|
|
|
|
export FRAPPE_PY=0.0.0.0
|
2020-02-10 08:00:54 +00:00
|
|
|
fi
|
|
|
|
|
2020-02-20 16:18:51 +00:00
|
|
|
if [[ -z "$FRAPPE_PY_PORT" ]]; then
|
|
|
|
export FRAPPE_PY_PORT=8000
|
2020-02-10 08:00:54 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -z "$FRAPPE_SOCKETIO" ]]; then
|
|
|
|
export FRAPPE_SOCKETIO=0.0.0.0
|
|
|
|
fi
|
|
|
|
|
2020-03-01 23:39:57 +00:00
|
|
|
if [[ -z "$SOCKETIO_PORT" ]]; then
|
|
|
|
export SOCKETIO_PORT=9000
|
2020-02-10 08:00:54 +00:00
|
|
|
fi
|
|
|
|
|
2020-02-20 16:18:51 +00:00
|
|
|
envsubst '${API_HOST}
|
|
|
|
${API_PORT}
|
|
|
|
${FRAPPE_PY}
|
|
|
|
${FRAPPE_PY_PORT}
|
|
|
|
${FRAPPE_SOCKETIO}
|
2020-03-01 23:39:57 +00:00
|
|
|
${SOCKETIO_PORT}' \
|
2020-02-10 08:00:54 +00:00
|
|
|
< /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
|
|
|
|
|
|
|
|
exec "$@"
|