From 1e67850e877b33b97af03b32ff6cfacef0a2aa21 Mon Sep 17 00:00:00 2001 From: Dmitry Verkhoturov Date: Sat, 11 Apr 2020 18:35:12 +0200 Subject: [PATCH] fix docker run error without attached /srv/var --- docker-init.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docker-init.sh b/docker-init.sh index 387e8a55..3104aace 100755 --- a/docker-init.sh +++ b/docker-init.sh @@ -5,4 +5,11 @@ sed -i "s|https://demo.remark42.com|${REMARK_URL}|g" /srv/web/*.js # remove devtools attach helper. TODO: move to webpack loader sed -i "/REMOVE-START/,/REMOVE-END/d" /srv/web/iframe.html -chown -R app:app /srv/var 2>/dev/null +if [ -d "/srv/var" ]; then + chown -R app:app /srv/var 2>/dev/null +else + echo "ERROR: /srv/var doesn't exist, which means that state of the application" + echo "ERROR: will be lost on container stop or restart." + echo "ERROR: Please mount local directory to /srv/var in order for it to work." + exit 199 +fi