add parsoid image

This commit is contained in:
Wonderfall 2017-07-30 04:49:47 +02:00
parent 2b18c3f9b1
commit e7c1cd5063
7 changed files with 96 additions and 0 deletions

28
parsoid/Dockerfile Normal file
View File

@ -0,0 +1,28 @@
FROM alpine:3.6
ENV NODE_ENV=production \
GID=991 UID=991 \
INTERFACE=0.0.0.0 \
PORT=8000 \
ADDRESS=http://localhost/w/ \
DOMAIN=localhost
RUN apk -U --no-cache add \
ca-certificates \
libressl \
nodejs-current \
nodejs-current-npm \
s6 \
git \
su-exec \
&& git clone https://gerrit.wikimedia.org/r/p/mediawiki/services/parsoid --depth=1 \
&& cd parsoid && npm install
COPY rootfs /
RUN chmod +x /usr/local/bin/* /etc/s6.d/*/* /etc/s6.d/.s6-svscan/*
EXPOSE 8000
ENTRYPOINT ["run.sh"]
CMD ["/bin/s6-svscan", "/etc/s6.d"]

View File

@ -0,0 +1,2 @@
#!/bin/sh
exit 0

View File

@ -0,0 +1,3 @@
#!/bin/sh
cd /parsoid
exec node bin/server.js

View File

@ -0,0 +1,19 @@
#!/bin/sh
echo
echo ">>> wonderfall/parsoid container <<<"
echo
cd /parsoid
cp config.example.yaml config.yaml
sed -i "s|http://localhost/w/|$ADDRESS|g" config.yaml
sed -i "s|domain: 'localhost'|domain: '$DOMAIN'|g" config.yaml
echo "> Updating permissions..."
chown -R ${UID}:${GID} /parsoid /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

View 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>

View 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"
}
}

View 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>