Context and Motivation
I run all my wikis under Docker. Since I manage several, I decided to try MWS. So far, I’m impressed by the project’s quality—especially its authentication, role management, and separation between wikis.
Performance Observations
On the performance side, I’ve seen a slight improvement with my largest wiki: load time dropped from 30 seconds on a legacy Node.js server to 24 seconds with MWS. While not a huge difference, I suspect this is due to how I load images internally (without HTTP requests). I’d welcome advice on this: Should I set up a dedicated HTML server just for images? If so, what’s the most effective way to do it?
Docker Benefits
Running MWS under Docker makes it easy to iterate in a test environment. Binding the container to a local directory ensures persistent wiki data.
Automation Script
Not being a Docker expert, I spent some time building a script that works for both initial image creation and subsequent container runs. The code is available—feel free to try it out and adapt it to your needs.
docker-compose.yml:
services:
mwsTiddlywiki:
image: node:latest
container_name: mwstiddlywiki
user: "node"
restart: unless-stopped
ports:
- "8900:8080"
volumes:
- .:/home/node/app
working_dir: /home/node/app
environment:
- HOME=/home/node
- USER=node
- HOST=0.0.0.0
command: >
sh -c "
if [ ! -d \"mwsTiddlywiki\" ]; then
npm init @tiddlywiki/mws@latest \"mwsTiddlywiki\"
fi &&
cd mwsTiddlywiki &&
if [ ! -f \"store.json\" ]; then
npx mws init-store
fi &&
npx mws listen --listener host=0.0.0.0
"