-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
compose.yaml
35 lines (34 loc) · 1.07 KB
/
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
version: '2'
services:
nostr-relay:
build: .
depends_on:
litestream-backup:
condition: service_healthy
restart: always
ports:
- "7447:7447"
volumes_from:
- litestream-restore:rw
litestream-backup:
image: litestream/litestream
volumes_from:
- litestream-restore:rw
entrypoint: ["/bin/sh", "-c"]
depends_on:
litestream-restore:
condition: service_completed_successfully
healthcheck:
test: /usr/local/bin/litestream restore -if-db-not-exists -if-replica-exists -config /opt/litestream/litestream.yaml /data/nostr-relay.sqlite
timeout: 10m
retries: 1
command:
- /usr/local/bin/litestream replicate -config /opt/litestream/litestream.yaml
litestream-restore:
image: litestream/litestream
volumes:
- .:/data
- .:/opt/litestream
entrypoint: ["/bin/sh", "-c"]
command:
- /usr/local/bin/litestream restore -if-db-not-exists -if-replica-exists -config /opt/litestream/litestream.yaml /data/nostr-relay.sqlite && chmod 777 /data/nostr-relay.sqlite || true