This repository has been archived by the owner on Jan 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yaml
116 lines (109 loc) · 3.23 KB
/
docker-compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
---
# MIT License
# Copyright (c) 2018 Nicola Worthington <[email protected]>
# https://docs.docker.com/compose/compose-file
version: "3.4"
volumes:
htdocs:
tiddlywiki:
# BUG: https://github.com/moby/moby/issues/3465
#letsencrypt:
services:
automation:
build:
context: automation
environment:
EMAIL: "${EMAIL:[email protected]}"
DOMAIN: "${DOMAIN:-localhost.localdomain}"
GIT_REPOSITORY: "$GIT_REPOSITORY"
GIT_USERNAME: "$GIT_USERNAME"
GIT_PASSWORD: "$GIT_PASSWORD"
volumes:
- source: tiddlywiki
target: /var/lib/tiddlywiki/mywiki
type: volume
- source: htdocs
target: /var/lib/tiddlywiki/htdocs
type: volume
- source: "${LETSENCRYPT_DATA:-/etc/letsencrypt}"
target: /var/lib/tiddlywiki/letsencrypt
# BUG: https://github.com/moby/moby/issues/3465
type: bind
letsencrypt:
build:
context: letsencrypt
environment:
EMAIL: "${EMAIL:[email protected]}"
DOMAIN: "${DOMAIN:-localhost.localdomain}"
depends_on:
- automation
volumes:
- source: htdocs
target: /usr/local/apache2/htdocs
type: volume
- source: "${LETSENCRYPT_DATA:-/etc/letsencrypt}"
target: /etc/letsencrypt
# BUG: https://github.com/moby/moby/issues/3465
type: bind
healthcheck:
# TODO: Use openssl and/or certbot to validate the certificates and expiry dates.
test: ["CMD", "ls", "/etc/letsencrypt/live/$DOMAIN/cert.pem"]
interval: 1m
timeout: 2s
retries: 3
start_period: 10s
tiddlywiki:
build:
context: tiddlywiki
environment:
TW_USERNAME: "${TW_USERNAME:-anonymous}"
expose:
- 8080
depends_on:
- automation
volumes:
- source: tiddlywiki
target: /var/lib/tiddlywiki/mywiki
type: volume
healthcheck:
# TODO: Improve this to retrieve a known core system tiddler perhaps?
test: ["CMD-SHELL", "printf 'GET /status HTTP/1.0\r\nHost: dinglebop.com\r\n\r\n' | nc localhost 8080 | grep -wq tiddlywiki_version"]
interval: 1m
timeout: 2s
retries: 3
start_period: 10s
apache:
build:
context: apache
environment:
EMAIL: "${EMAIL:[email protected]}"
DOMAIN: "${DOMAIN:-localhost.localdomain}"
TW_USERNAME: "${TW_USERNAME:-anonymous}"
TW_PASSWORD: "${TW_PASSWORD:-password}"
TW_PRIVATE: "${TW_PRIVATE:-}"
depends_on:
- tiddlywiki
- letsencrypt
links:
- tiddlywiki:8080
ports:
- 80:80
- 443:443
- 444:444
volumes:
- source: htdocs
target: /usr/local/apache2/htdocs
type: volume
read_only: true
- source: "${LETSENCRYPT_DATA:-/etc/letsencrypt}"
target: /etc/letsencrypt
# BUG: https://github.com/moby/moby/issues/3465
type: bind
read_only: true
healthcheck:
# TODO: Improve to test operation modes of all three tcp/80,443,444 ports.
test: ["CMD-SHELL", "printf 'HEAD / HTTP/1.1\r\nHost: dinglebop.com\r\n\r\n' | nc localhost 80 | grep -wqF 'Location: https://dinglebop.com/'"]
interval: 1m
timeout: 2s
retries: 3
start_period: 10s