From 724271ae87bc2c6aa267e12ddc450e4097d2eb59 Mon Sep 17 00:00:00 2001 From: apb Date: Tue, 26 Oct 2021 22:01:40 +0100 Subject: [PATCH] [new] restart --- tiddlywiki/.env | 2 ++ tiddlywiki/.env-example | 2 ++ tiddlywiki/.gitignore | 1 + tiddlywiki/Dockerfile | 25 ++++++++++--------------- tiddlywiki/LICENSE | 21 +++++++++++++++++++++ tiddlywiki/README.md | 25 +++++++++++++++++++++++++ tiddlywiki/docker-compose.yml | 13 +++++++++++++ tiddlywiki/entrypoint.sh | 8 ++++++++ 8 files changed, 82 insertions(+), 15 deletions(-) create mode 100644 tiddlywiki/.env create mode 100644 tiddlywiki/.env-example create mode 100644 tiddlywiki/.gitignore create mode 100644 tiddlywiki/LICENSE create mode 100644 tiddlywiki/README.md create mode 100644 tiddlywiki/docker-compose.yml create mode 100644 tiddlywiki/entrypoint.sh diff --git a/tiddlywiki/.env b/tiddlywiki/.env new file mode 100644 index 0000000..9f896d3 --- /dev/null +++ b/tiddlywiki/.env @@ -0,0 +1,2 @@ +USERNAME=andy +PASSWORD=wikipass diff --git a/tiddlywiki/.env-example b/tiddlywiki/.env-example new file mode 100644 index 0000000..6edc1e6 --- /dev/null +++ b/tiddlywiki/.env-example @@ -0,0 +1,2 @@ +USERNAME=user +PASSWORD=wiki diff --git a/tiddlywiki/.gitignore b/tiddlywiki/.gitignore new file mode 100644 index 0000000..8b61771 --- /dev/null +++ b/tiddlywiki/.gitignore @@ -0,0 +1 @@ +/wiki-data/ \ No newline at end of file diff --git a/tiddlywiki/Dockerfile b/tiddlywiki/Dockerfile index 595f4b9..af7b39b 100644 --- a/tiddlywiki/Dockerfile +++ b/tiddlywiki/Dockerfile @@ -1,20 +1,15 @@ -FROM node:alpine +FROM node:12-alpine -ENV TIDDLYWIKI_VERSION=5.2.0 - -ARG SOURCE_COMMIT -LABEL maintainer="Aaron Bull Schaefer " -LABEL source="https://github.com/elasticdog/tiddlywiki-docker" -LABEL source-commit="${SOURCE_COMMIT:-unknown}" - -# 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} +RUN npm install -g tiddlywiki@5.20 EXPOSE 8080 -VOLUME /tiddlywiki -WORKDIR /tiddlywiki +VOLUME ["/app"] -ENTRYPOINT ["/sbin/tini", "--", "tiddlywiki"] -CMD ["--help"] \ No newline at end of file +WORKDIR /app + +COPY entrypoint.sh /entrypoint.sh + +RUN chmod +x /entrypoint.sh + +CMD [ "/entrypoint.sh" ] diff --git a/tiddlywiki/LICENSE b/tiddlywiki/LICENSE new file mode 100644 index 0000000..8694301 --- /dev/null +++ b/tiddlywiki/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Zou Guoqing + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tiddlywiki/README.md b/tiddlywiki/README.md new file mode 100644 index 0000000..30e8d77 --- /dev/null +++ b/tiddlywiki/README.md @@ -0,0 +1,25 @@ +# TiddlyWiki Docker +Run TiddlyWiki 5 via Docker and Docker Compose + +## QuickStart +You should install [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/) first. + +```shell +cp .env-example .env +docker-compose up -d +``` + +Now TiddlyWiki should be running on http://localhost:8080. + +## Data +The directory `./wiki-data` is used for all the data. + +## Auth +default: `user` / `wiki` +Modify `.env` file to customize + +## ToDo +- [ ] Backup Data Automatically: sync `./wiki-data` with Object Storage Service (Like Amazon S3) + +## Related Repo +* https://github.com/djmaze/tiddlywiki-docker diff --git a/tiddlywiki/docker-compose.yml b/tiddlywiki/docker-compose.yml new file mode 100644 index 0000000..103add6 --- /dev/null +++ b/tiddlywiki/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3' + +services: + tiddly: + image: tiddlywiki:5.2.0 + build: . + container_name: tiddlywiki-docker + restart: unless-stopped + volumes: + - ./wiki-data:/app + ports: + - 8088:8080 + env_file: ./.env diff --git a/tiddlywiki/entrypoint.sh b/tiddlywiki/entrypoint.sh new file mode 100644 index 0000000..406f359 --- /dev/null +++ b/tiddlywiki/entrypoint.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env sh +set -e + +if [ ! -f "/app/tiddlywiki.info" ]; then + tiddlywiki /app --init server +fi + +tiddlywiki /app --listen host=0.0.0.0 username="${USERNAME:-user}" password="${PASSWORD-wiki}"