diff options
| author | shu <nvcsadjkojf@outlook.com> | 2026-07-27 00:22:33 +0800 |
|---|---|---|
| committer | shu <nvcsadjkojf@outlook.com> | 2026-07-27 00:22:33 +0800 |
| commit | aaa0cf501ce44a7c7c54c7c5c6485cfb7f60e583 (patch) | |
| tree | da94ef66e9830d09961e577f87d36e63a6076ce5 /compose.yaml | |
| parent | 338cc101f127e4841689c1f81227ee033e57ad28 (diff) | |
Add Docker Compose deployment
Diffstat (limited to 'compose.yaml')
| -rw-r--r-- | compose.yaml | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..5a909c3 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,100 @@ +name: tdwiki + +services: + tiddlywiki: + build: + context: . + dockerfile: docker/tiddlywiki/Dockerfile + restart: unless-stopped + init: true + user: "${PUID:-1000}:${PGID:-1000}" + command: + - . + - --listen + - host=0.0.0.0 + - port=8080 + - gzip=yes + - use-browser-cache=yes + volumes: + - ./tiddlers:/wiki/tiddlers + - ./files:/wiki/files:ro + - ./tiddlywiki.info:/wiki/tiddlywiki.info:ro + expose: + - "8080" + healthcheck: + test: ["CMD", "wget", "-q", "--spider", "http://127.0.0.1:8080/"] + interval: 10s + timeout: 3s + retries: 12 + start_period: 10s + security_opt: + - no-new-privileges:true + + redis: + image: redis:7.4-alpine + restart: unless-stopped + command: ["redis-server", "--save", "60", "1", "--loglevel", "warning"] + volumes: + - redis-data:/data + healthcheck: + test: ["CMD", "redis-cli", "ping"] + interval: 10s + timeout: 3s + retries: 5 + security_opt: + - no-new-privileges:true + + authelia: + image: authelia/authelia:4.39.20 + restart: unless-stopped + depends_on: + redis: + condition: service_healthy + volumes: + - ./docker/authelia:/config:ro + - ./data/authelia:/var/lib/authelia + - ./secrets:/secrets:ro + environment: + TZ: "${TZ:-Asia/Shanghai}" + AUTHELIA_IDENTITY_VALIDATION_RESET_PASSWORD_JWT_SECRET_FILE: /secrets/authelia_jwt_secret + AUTHELIA_SESSION_SECRET_FILE: /secrets/authelia_session_secret + AUTHELIA_STORAGE_ENCRYPTION_KEY_FILE: /secrets/authelia_storage_encryption_key + expose: + - "9091" + healthcheck: + test: ["CMD", "wget", "-q", "--spider", "http://127.0.0.1:9091/api/health"] + interval: 10s + timeout: 3s + retries: 12 + start_period: 10s + security_opt: + - no-new-privileges:true + + caddy: + build: + context: . + dockerfile: docker/caddy/Dockerfile + args: + GOPROXY: "${GOPROXY:-https://goproxy.cn,direct}" + restart: unless-stopped + depends_on: + tiddlywiki: + condition: service_healthy + authelia: + condition: service_healthy + environment: + BASE_DOMAIN: "${BASE_DOMAIN:-tdwiki.home.arpa}" + ports: + - "8081:80" + - "443:443" + - "443:443/udp" + volumes: + - ./docker/caddy/Caddyfile:/etc/caddy/Caddyfile:ro + - ./files:/srv/files + - ./data/caddy/data:/data + - ./data/caddy/config:/config + security_opt: + - no-new-privileges:true + +volumes: + redis-data: |
