1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-26 11:37:20 +00:00

Add initial TiddlyWiki Dockerfile and docs

This commit is contained in:
Noah Betzen 2023-04-03 16:46:49 -07:00
parent 2a19c60e20
commit 1af4af3bb5
No known key found for this signature in database
GPG Key ID: 77096D8E1B96F1D5
3 changed files with 64 additions and 0 deletions

21
Dockerfile Normal file
View File

@ -0,0 +1,21 @@
# Adapted from: https://github.com/elasticdog/tiddlywiki-docker/blob/master/5/Dockerfile
ARG NODE_LTS_VERSION=18
FROM node:${NODE_LTS_VERSION}-alpine
ARG TIDDLYWIKI_VERSION=5.2.7
ARG TIDDLYWIKI_DATA_DIR=/tiddlywiki
ARG TIDDLYWIKI_PORT=8080
# https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#handling-kernel-signals
RUN apk add --no-cache tini
RUN npm install -g tiddlywiki@${TIDDLYWIKI_VERSION}
EXPOSE ${TIDDLYWIKI_PORT}
VOLUME ${TIDDLYWIKI_DATA_DIR}
WORKDIR ${TIDDLYWIKI_DATA_DIR}
ENTRYPOINT ["/sbin/tini", "--", "tiddlywiki"]
CMD ["--help"]

View File

@ -0,0 +1,39 @@
created: 20230403211230516
modified: 20230403211230516
tags: [[TiddlyWiki with Docker]]
title: Using TiddlyWiki with Docker
type: text/vnd.tiddlywiki
~TiddlyWiki5 can also be run using Docker. See the [[Dockerfile]] for details.
The image can be built using the following command in the root of the TiddlyWiki git repo:
```
docker build --tag tiddlywiki .
```
It can be run like so:
```
# Create a data directory
mkdir ~/tiddlywiki
# Initialize the data directory
docker run \
--rm \
--name tiddlywiki \
--volume ~/tiddlywiki:/tiddlywiki \
tiddlywiki \
mynewwiki --init server
# Start the server with custom arguments
docker run \
--rm \
--name tiddlywiki \
--volume ~/tiddlywiki:/tiddlywiki \
--publish 8080:8080 \
tiddlywiki \
mynewwiki --listen host=0.0.0.0 port=8080 "readers=(anon)" "writers=(authenticated)" admin=noah username=noah password=noah
```
If you'd prefer a pre-built image, there is a community-maintained image on Docker Hub: https://hub.docker.com/r/elasticdog/tiddlywiki/
See [[Commands]] for a full listing of the available commands.

View File

@ -32,6 +32,10 @@ Developer documentation is in progress at https://tiddlywiki.com/dev/
{{Upgrading TiddlyWiki on Node.js}}
! Using TiddlyWiki with Docker
{{Using TiddlyWiki with Docker}}
! Also see
<<list-links "[tag[TiddlyWiki on Node.js]] -[[Installing TiddlyWiki on Node.js]] -[[Using TiddlyWiki on Node.js]] -[[Upgrading TiddlyWiki on Node.js]]">>