[new] restart

This commit is contained in:
Andy Bunce 2021-10-26 22:01:40 +01:00
parent 7fb1288f73
commit 724271ae87
8 changed files with 82 additions and 15 deletions

2
tiddlywiki/.env Normal file
View File

@ -0,0 +1,2 @@
USERNAME=andy
PASSWORD=wikipass

2
tiddlywiki/.env-example Normal file
View File

@ -0,0 +1,2 @@
USERNAME=user
PASSWORD=wiki

1
tiddlywiki/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/wiki-data/

View File

@ -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 <aaron@elasticdog.com>"
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"]
WORKDIR /app
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
CMD [ "/entrypoint.sh" ]

21
tiddlywiki/LICENSE Normal file
View File

@ -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.

25
tiddlywiki/README.md Normal file
View File

@ -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

View File

@ -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

8
tiddlywiki/entrypoint.sh Normal file
View File

@ -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}"