This repository has been archived on 2021-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
docker-ghost/rootfs/usr/local/bin/startup

38 lines
1.2 KiB
Plaintext
Raw Normal View History

2017-11-03 20:33:40 +01:00
#!/bin/bash
cd content
mkdir apps data images themes logs adapters &>/dev/null
rm -rf /ghost/content/themes/casper &>/dev/null
cp -r /ghost/casper themes/casper &>/dev/null
cd /ghost
if [ ! -f /ghost/content/ghost.conf ]; then
echo
echo "INFO : No configuration file was provided, an example will be used"
echo " You can access and modify it in the volume you mounted"
echo " Restart in order to apply your changes!"
echo
mv /usr/local/etc/ghost.example.conf /ghost/content/ghost.conf
fi
cp -f content/ghost.conf config.production.json
sed -i -e "s|https://my-ghost-blog.com|${ADDRESS}|g" /ghost/content/ghost.conf
if [ "$ENABLE_ISSO" == "True" ] && ! grep -q 'isso' /ghost/content/themes/casper/post.hbs; then
cd /usr/local/etc
sed -i -e "/\/author/r isso.conf" /ghost/content/themes/casper/post.hbs
sed -i -e '/isso-thread/{n;d}' /ghost/content/themes/casper/post.hbs
sed -i -e "s/<HOST>/$ISSO_HOST/g" \
-e "s/<AVATAR>/$ISSO_AVATAR/g" \
-e "s/<VOTE>/$ISSO_VOTE/g" /ghost/content/themes/casper/post.hbs
fi
chown -R ${UID}:${GID} /ghost /etc/s6.d
if [ '$@' == '' ]; then
exec su-exec ${UID}:${GID} /bin/s6-svscan /etc/s6.d
else
exec su-exec ${UID}:${GID} "$@"
fi