mirror of
https://github.com/hoellen/dockerfiles.git
synced 2025-07-01 22:55:39 +00:00
UNMAINTENED
This commit is contained in:
43
unmaintained/ghost/Dockerfile
Normal file
43
unmaintained/ghost/Dockerfile
Normal file
@ -0,0 +1,43 @@
|
||||
FROM alpine:3.6
|
||||
|
||||
ARG VERSION=1.14.0
|
||||
|
||||
ENV GHOST_NODE_VERSION_CHECK=false \
|
||||
NODE_ENV=production \
|
||||
GID=991 UID=991 \
|
||||
ADDRESS=https://my-ghost-blog.com \
|
||||
ENABLE_ISSO=False \
|
||||
ISSO_HOST=isso.domain.tld \
|
||||
ISSO_AVATAR=false \
|
||||
ISSO_VOTE=false
|
||||
|
||||
WORKDIR /ghost
|
||||
|
||||
RUN apk -U --no-cache add \
|
||||
bash \
|
||||
ca-certificates \
|
||||
grep \
|
||||
libressl \
|
||||
nodejs-current \
|
||||
nodejs-current-npm \
|
||||
s6 \
|
||||
su-exec \
|
||||
vim \
|
||||
&& wget -q https://github.com/TryGhost/Ghost/releases/download/${VERSION}/Ghost-${VERSION}.zip -P /tmp \
|
||||
&& unzip -q /tmp/Ghost-${VERSION}.zip -d /ghost \
|
||||
&& npm install --production \
|
||||
&& mv content/themes/casper casper
|
||||
|
||||
COPY rootfs /
|
||||
|
||||
RUN chmod +x /usr/local/bin/* /etc/s6.d/*/* /etc/s6.d/.s6-svscan/*
|
||||
|
||||
EXPOSE 2368
|
||||
|
||||
VOLUME /ghost/content
|
||||
|
||||
LABEL description="Ghost CMS ${VERSION}" \
|
||||
maintainer="Wonderfall <wonderfall@targaryen.house>"
|
||||
|
||||
ENTRYPOINT ["run.sh"]
|
||||
CMD ["/bin/s6-svscan", "/etc/s6.d"]
|
44
unmaintained/ghost/README.md
Normal file
44
unmaintained/ghost/README.md
Normal file
@ -0,0 +1,44 @@
|
||||
## wonderfall/ghost
|
||||
|
||||

|
||||
|
||||
**Breaking changes if you're upgrading from 0.x. Please export your current data, and import them again in a new 1.x blog. You also have to move your images to the new volume if you want to keep them. Disqus is also not supported, please move to Isso, a much better comments system. Sorry for the mess!**
|
||||
|
||||
#### What is this? What features?
|
||||
- A **simple** Ghost CMS build made for production.
|
||||
- Based on Alpine Linux so it's lightweight!
|
||||
- Bundled with latest node.js available (version check is disabled).
|
||||
- Offers Isso integration.
|
||||
|
||||
#### Build-time variables
|
||||
- **VERSION** : version of Ghost.
|
||||
|
||||
#### Environment variables
|
||||
- **GID** : ghost user id *(default : 991)*
|
||||
- **UID** : ghost group id *(default : 991)*
|
||||
- **ADDRESS** : your domain (with *http(s)://*) *(default : https://my-ghost-blog.com)*
|
||||
- **ENABLE_ISSO** : enables Isso support if set to *True* *(default : False)*
|
||||
- **ISSO_HOST**, **ISSO_AVATAR**, **ISSO_VOTE** : Isso settings (*True* or *False*)
|
||||
|
||||
#### Volumes
|
||||
- **/ghost/content** : contents of your blog
|
||||
|
||||
### Ports
|
||||
- **2368** [(reverse proxy!)](https://github.com/hardware/mailserver/wiki/Reverse-proxy-configuration)
|
||||
|
||||
### How to configure?
|
||||
Everything you need is in `/ghost/content/ghost.conf` (also mounted on your host...).
|
||||
|
||||
### docker-compose.yml sample
|
||||
|
||||
```
|
||||
ghost-myblog:
|
||||
image: wonderfall/ghost:1
|
||||
container_name: ghost-myblog
|
||||
environment:
|
||||
- UID=8100
|
||||
- GID=8100
|
||||
- ADDRESS=https://myblog.com
|
||||
volumes:
|
||||
- /mnt/docker/myblog:/ghost/content
|
||||
```
|
2
unmaintained/ghost/rootfs/etc/s6.d/.s6-svscan/finish
Normal file
2
unmaintained/ghost/rootfs/etc/s6.d/.s6-svscan/finish
Normal file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exit 0
|
5
unmaintained/ghost/rootfs/etc/s6.d/ghost/run
Normal file
5
unmaintained/ghost/rootfs/etc/s6.d/ghost/run
Normal file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
cd /ghost
|
||||
NODE_ENV=development node_modules/.bin/knex-migrator init
|
||||
NODE_ENV=development node_modules/.bin/knex-migrator migrate
|
||||
exec npm start
|
47
unmaintained/ghost/rootfs/usr/local/bin/run.sh
Normal file
47
unmaintained/ghost/rootfs/usr/local/bin/run.sh
Normal file
@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
echo
|
||||
echo ">>> wonderfall/ghost container <<<"
|
||||
echo
|
||||
|
||||
echo "> Initializing content folder..."
|
||||
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
|
||||
|
||||
if [ ! -f /ghost/config.production.json ]; then
|
||||
ln -s content/ghost.conf config.production.json
|
||||
fi
|
||||
|
||||
echo "> Applying preferences..."
|
||||
|
||||
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
|
||||
|
||||
echo "> Updating permissions..."
|
||||
chown -R ${UID}:${GID} /ghost /etc/s6.d
|
||||
|
||||
echo "> Executing process..."
|
||||
if [ '$@' == '' ]; then
|
||||
exec su-exec ${UID}:${GID} /bin/s6-svscan /etc/s6.d
|
||||
else
|
||||
exec su-exec ${UID}:${GID} "$@"
|
||||
fi
|
16
unmaintained/ghost/rootfs/usr/local/etc/disqus.conf
Normal file
16
unmaintained/ghost/rootfs/usr/local/etc/disqus.conf
Normal file
@ -0,0 +1,16 @@
|
||||
|
||||
<div id="disqus_thread"></div>
|
||||
<script type="text/javascript">
|
||||
var disqus_shortname = '<SHORTNAME>';
|
||||
var disqus_identifier = '{{post.id}}';
|
||||
|
||||
/* * * DON'T EDIT BELOW THIS LINE * * */
|
||||
(function() {
|
||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
})();
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
||||
|
21
unmaintained/ghost/rootfs/usr/local/etc/ghost.example.conf
Normal file
21
unmaintained/ghost/rootfs/usr/local/etc/ghost.example.conf
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"url": "https://my-ghost-blog.com",
|
||||
|
||||
"server": {
|
||||
"host": "0.0.0.0",
|
||||
"port": "2368"
|
||||
},
|
||||
|
||||
"database": {
|
||||
"client": "sqlite3",
|
||||
"connection": {
|
||||
"filename": "content/data/ghost-dev.db"
|
||||
},
|
||||
"useNullAsDefault": true,
|
||||
"debug": false
|
||||
},
|
||||
|
||||
"mail": {
|
||||
"transport": "Direct"
|
||||
}
|
||||
}
|
7
unmaintained/ghost/rootfs/usr/local/etc/isso.conf
Normal file
7
unmaintained/ghost/rootfs/usr/local/etc/isso.conf
Normal file
@ -0,0 +1,7 @@
|
||||
</footer>
|
||||
<script data-isso="//<HOST>/"
|
||||
data-isso-avatar="<AVATAR>"
|
||||
data-isso-vote="<VOTE>"
|
||||
src="//<HOST>/js/embed.min.js"></script>
|
||||
|
||||
<section id="isso-thread"></section>
|
Reference in New Issue
Block a user