-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcompose.yml
More file actions
149 lines (141 loc) · 5.67 KB
/
Copy pathcompose.yml
File metadata and controls
149 lines (141 loc) · 5.67 KB
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
services:
time-a:
image: ghcr.io/pendulum-project/ntpd-rs:sha-3b4aaf6
expose: [4460, "1231/udp"]
ports: ["127.0.0.1:1231:1231/udp", "[::1]:1231:1231/udp"]
stop_grace_period: 500ms
environment:
TZ: "Europe/Amsterdam"
RUST_LOG: DEBUG
volumes:
- "./nts-pool-ke/testdata/a.ntpd-rs.toml:/etc/ntpd-rs/ntp.toml:ro"
- "./nts-pool-ke/testdata/time-a.key:/var/lib/ntpd-rs/tls/time-a.key:ro"
- "./nts-pool-ke/testdata/time-a.fullchain.pem:/var/lib/ntpd-rs/tls/time-a.fullchain.pem:ro"
- "./nts-pool-ke/testdata/testca.pem:/var/lib/ntpd-rs/tls/testca.pem:ro"
time-b:
image: ghcr.io/pendulum-project/ntpd-rs:sha-3b4aaf6
expose: [4460, "1232/udp"]
ports: ["127.0.0.1:1232:1232/udp", "[::1]:1232:1232/udp"]
stop_grace_period: 500ms
environment:
TZ: "Europe/Amsterdam"
RUST_LOG: DEBUG
volumes:
- "./nts-pool-ke/testdata/b.ntpd-rs.toml:/etc/ntpd-rs/ntp.toml:ro"
- "./nts-pool-ke/testdata/time-b.key:/var/lib/ntpd-rs/tls/time-b.key:ro"
- "./nts-pool-ke/testdata/time-b.fullchain.pem:/var/lib/ntpd-rs/tls/time-b.fullchain.pem:ro"
- "./nts-pool-ke/testdata/testca.pem:/var/lib/ntpd-rs/tls/testca.pem:ro"
ke:
image: ghcr.io/tweedegolf/rust-dev:stable
depends_on: [time-a, time-b]
stop_grace_period: 500ms
ports:
- "127.0.0.1:4460:4460"
- "[::1]:4460:4460"
user: "${USER_ID:?USER_ID not set}:${GROUP_ID:?GROUP_ID not set}"
environment:
RUST_LOG: debug
TZ: "Europe/Amsterdam"
CARGO_HOME: "/app/.cargo"
CARGO_TARGET_DIR: "/app/target-docker"
SQLX_OFFLINE: "${DOCKER_SQLX_OFFLINE:-0}"
volumes:
- ".:/app"
working_dir: /app/nts-pool-ke
ulimits:
core: 0
command: ["watchexec", "--shell=none", "-o", "restart", "--", "cargo", "run", "-p", "nts-pool-ke", "--", "--config", "/app/nts-pool-ke/unsafe.pool.toml"]
psql:
image: ghcr.io/tweedegolf/postgres:17
environment:
POSTGRES_USER: nts-pool
POSTGRES_DB: nts-pool
TZ: "Europe/Amsterdam"
POSTGRES_HOST_AUTH_METHOD: trust
ports: ["127.0.0.1:5432:5432"]
mailcrab:
image: marlonb/mailcrab:latest
ports:
- "127.0.0.1:1080:1080"
management:
image: ghcr.io/tweedegolf/rust-dev:stable
depends_on: [ke, psql, mailcrab]
stop_grace_period: 500ms
ports:
- "127.0.0.1:3000:3000"
- "127.0.0.1:3001:3001"
user: "${USER_ID:?USER_ID not set}:${GROUP_ID:?GROUP_ID not set}"
environment:
RUST_LOG: debug
TZ: "Europe/Amsterdam"
CARGO_HOME: "/app/.cargo"
CARGO_TARGET_DIR: "/app/target-docker"
NTSPOOL_DATABASE_URL: "postgres://nts-pool@psql:5432/nts-pool"
DATABASE_URL: "postgres://nts-pool@psql:5432/nts-pool"
NTSPOOL_CONFIG_UPDATER_SECRET: "a-config-updater-secret"
NTSPOOL_DATABASE_RUN_MIGRATIONS: "false"
NTSPOOL_ASSETS_DIR: "/app/nts-pool-management/assets"
NTSPOOL_GEOLOCATION_DB: "/app/nts-pool-ke/testdata/GeoLite2-Country-Test.mmdb"
NTSPOOL_JWT_SECRET: "a-string-secret-at-least-256-bits-long"
NTSPOOL_COOKIE_SECRET: "another-string-secret-at-least-256-bits-long"
NTSPOOL_BASE_SHARED_SECRET: "even-more-secrets-this-time-with-no-min-length"
NTSPOOL_BASE_SECRET_INDEX: "0"
NTSPOOL_SMTP_URL: "smtp://mailcrab:1025"
NTSPOOL_MAIL_FROM_ADDRESS: "NTS Pool <noreply@example.com>"
NTSPOOL_BASE_URL: "http://localhost:3000"
NTSPOOL_POOLSRV_NAME: "srv.localhost"
NTSPOOL_POOLKE_NAME: "localhost"
NTSPOOL_MONITOR_RESULT_BATCHSIZE: "4"
NTSPOOL_MONITOR_RESULT_BATCHTIME: "60"
NTSPOOL_MONITOR_UPDATE_INTERVAL: "60"
NTSPOOL_MONITOR_PROBE_INTERVAL: "4"
NTSPOOL_MONITOR_NTS_TIMEOUT: "1000"
NTSPOOL_MONITOR_NTP_TIMEOUT: "1000"
NTSPOOL_MAX_TIMESOURCE_WEIGHT: "10"
SQLX_OFFLINE: "${DOCKER_SQLX_OFFLINE:-0}"
volumes:
- ".:/app"
working_dir: /app/nts-pool-management
ulimits:
core: 0
command: ["watchexec", "--shell=none", "-o", "restart", "--", "cargo", "run", "-p", "nts-pool-management", "--features", "livereload,dev-database", "--"]
monitor:
image: ghcr.io/tweedegolf/rust-dev:stable
depends_on: [management]
stop_grace_period: 500ms
user: "${USER_ID:?USER_ID not set}:${GROUP_ID:?GROUP_ID not set}"
environment:
RUST_LOG: debug
TZ: "Europe/Amsterdam"
CARGO_HOME: "/app/.cargo"
CARGO_TARGET_DIR: "/app/target-docker"
volumes:
- ".:/app"
working_dir: /app
ulimits:
core: 0
command: ["watchexec", "--shell=none", "-o", "restart", "--", "cargo", "run", "-p", "nts-pool-monitor", "--", "--config", "/app/nts-pool-monitor/config.toml"]
network_mode: "host" # This container uses host networkin in order to be able to connect to the NTP servers on localhost
config-gen:
image: ghcr.io/tweedegolf/rust-dev:stable
depends_on: [psql, management]
stop_grace_period: 500ms
user: "${USER_ID:?USER_ID not set}:${GROUP_ID:?GROUP_ID not set}"
environment:
RUST_LOG: debug
TZ: "Europe/Amsterdam"
CARGO_HOME: "/app/.cargo"
CARGO_TARGET_DIR: "/app/target-docker"
SQLX_OFFLINE: "${DOCKER_SQLX_OFFLINE:-0}"
NTSPOOL_CONFIG_UPDATER_SECRET: "a-config-updater-secret"
NTSPOOL_CONFIG_UPDATER_SERVERS_URL: "http://management:3001/poolke_servers"
NTSPOOL_CONFIG_UPDATER_SERVERS_OUTPUT_FILES: "/app/nts-pool-ke/servers.json"
NTSPOOL_CONFIG_UPDATER_MONITOR_KEYS_URL: "http://management:3001/monitor_keys"
NTSPOOL_CONFIG_UPDATER_MONITOR_KEYS_OUTPUT_FILES: "/app/nts-pool-ke/monitoring.json"
NTSPOOL_CONFIG_UPDATER_INTERVAL_SECONDS: "10"
volumes:
- ".:/app"
working_dir: /app
ulimits:
core: 0
command: ["/app/compose-config-updater.sh"]