I think it would be nice to have a flexible docker image that can be built automatically. IMO the TW app should be in a “throw away” container, but the data should be persistent.
corepack is marked as “experimental” and is intended to be used to manage “package manager”. A TW docker image does not need more than 1 package manager
imo pnpm … imo not needed, since npm is already part of the image.
for “production” - after installation is done - IMO npm and yarn should be removed
a “development” version can keep npm and yarn.
Mapping to the local harddrive is OK for development
IMO for “production” the persistent storage should be mapped to a docker volume for speed reasons.
The whole thing should work with linux, Mac and Windows (Docker for Windows)
I don’t use Docker myself, but it is very popular, and I think it would be highly desirable to get one (or more) standard, core Docker images into the main repo.
It would be nice to provide sufficient information / recommendations so such docker images can be hosted locally, internet facing and on services available to host online.
as of course many people are running their TW on Synology or similar in LAN and then using whatever variant of Wireguard to connect to it via the internetz
Looks like Nicola’s image is indeed the most up-to-date one
I use an alpine container with node and tiddlywiki installed, but I would prefer to switch to an official versioned docker container from the TiddlyWiki project.
I’m not familiar enough with Docker to do it myself, but I believe that adding a Docker build to our existing CI framework would be straightforward for someone with the relevant skills and experience. I would welcome the contribution of a CI update to achieve this.
Docker is a standalone app. I have used it on linux where is must be run with root privileges. I use it to sanbox the install and running of npm packages.
The use case for an official image is the same as the use case for an tiddlywiki saver or web clipper – even if its the same saver or web clipper solution – people feel more comfortable with one-stop solutions than 3rd party solutions. The scavenger hunt approach to everything does not breed confidence in the project. Having a sanctioned solution helps funnel more people and support to that solution.
If you’re talking about the use-case for a docker solution in particular, then arguably not having to worry about NVM, NPM, and node eases some of the headache of the node.js installation. In my case, I combined it with tailscale so I can feel relatively confident of running it as a server inside it’s own network.
For those who aren’t familiar, the general workflow for using a docker solution is
Install Docker, of course
Download 1 or two text files (typically docker-compose.yml and .env)
Configure variables in the file for your setup to specify things like ports or where your tiddlers live
Give a command: docker compose up -d
Your app is now running, and you can access it typically using whatever server port you specified. Yes, you can digress in ten different directions, but that’s a pretty common way to use it. Depending on your compose file, updating can be as simple as bringing your instance down and then back up again.
Docker communicates with the world through either ports, sockets, or file directories, limiting the attack surface.
Everything lives in the Docker container, meaning the solution is easy to upgrade and easy to port to a different machine. In theory that other machine could be on a completely different o/s and architecture.
I guess a really good special edition for tiddlywiki would bundle tiddlywiki with caddy so people could easily use it as a server and have the SSL taken care of.
I don’t see any benefit to running a tw, on its own, in a docker image. tw does not have any npm dependencies, and so does not need sandboxing from third party packages. Your use case is obviously valid.
To have an official tw docker image, I think it would have to be signed, and there would probably be the need for a official docker account for tiddlywiki.
But is it worth the effort?
It is easy to create a dockerfile.
Some time ago I published on Github the Dockerfile to build a Tiddlyserver image (GitHub - mauloop/tiddlyserver-docker). It is still working and uses by default the latest Tiddlywiki version, unless you change the npm install directive (instructions are provided in the Readme). Tiddlyserver (TiddlyServer · Boosting TiddlyWiki into orbit) is a convenient way to run multiple Tiddlywiki node.js based instances, still working even tough it looks to be no longer mantained. Hope this can help.
This allows me to manage my Tiddlywiki like any other systemd service (eg, start at login) and doesn’t require me to install any additional software on my computer. It also does not require root/admin access or any additional user privileges.
In my case, I have mounted a local filesystem folder for the wiki storage and I’m using my own image based on alpine which is basically a thin wrapper over npm install then tiddlywiki --listen
I doubt this is a common use-case for Tiddlywiki containers but I’m happily using it on multiple machines, and I would switch to an official image if one were available.