Files
remark42/docker-init.sh
T
Pavel MineevandUmputun 5825a55b69 Update frontend
* change root dit and change way to import modules
* update deps to latest versions
* use latest tools for building bundles
* rewrite webpack config
* use nomodule technique for loading modern bundle
* inject polyfills by babel usebuiltins
* update eslint rules
* rename all style files to CSS
* use postcss preset env for building styles
* proper typescript typing
* put all html files to templates folder
* etc
2021-01-12 13:39:26 -06:00

20 lines
635 B
Bash
Executable File

#!/bin/sh
echo "prepare environment"
# replace BASE_URL constant by REMARK_URL
sed -i "s|{% REMARK_URL %}|${REMARK_URL}|g" /srv/web/*.html
sed -i "s|{% REMARK_URL %}|${REMARK_URL}|g" /srv/web/*.js
if [ -n "${SITE_ID}" ]; then
#replace "site_id: 'remark'" by SITE_ID
sed -i "s|'remark'|'${SITE_ID}'|g" /srv/web/*.html
fi
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