Do not try to initialize wiki if it exists already

(Tiddlywiki 5.1.x fails when running `--init` on an existing wiki.)
This commit is contained in:
Martin Honermeyer 2014-11-15 18:44:05 +01:00
parent e3c491f109
commit 09e4b9d318
2 changed files with 12 additions and 1 deletions

View file

@ -14,6 +14,9 @@ RUN npm install -g tiddlywiki
VOLUME /var/lib/tiddlywiki
WORKDIR /var/lib/tiddlywiki
# Add init-and-run script
ADD init-and-run-wiki /usr/local/bin/init-and-run-wiki
# Meta
CMD tiddlywiki mywiki --init server && tiddlywiki mywiki --server 8080 $:/core/save/all text/plain text/html user "" 0.0.0.0
CMD ["/usr/local/bin/init-and-run-wiki"]
EXPOSE 8080

8
init-and-run-wiki Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
set -e
if [ ! -d /var/lib/tiddlywiki/mywiki ]; then
tiddlywiki mywiki --init server
fi
exec tiddlywiki mywiki --server 8080 $:/core/save/all text/plain text/html user "" 0.0.0.0