Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
81 lines (77 loc) · 2.53 KB
/
Copy pathdocker-compose.yml
File metadata and controls
81 lines (77 loc) · 2.53 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
# Docker Compose for shepherd. See docs/deployment/docker.md.
#
# docker compose up -d the engine
# docker compose --profile observability up -d the engine and Prometheus
services:
shepherd:
image: ${SHEPHERD_IMAGE:-ghcr.io/nullislabs/shepherd:latest}
# `docker compose build` builds the image from this checkout.
build:
context: .
dockerfile: Dockerfile
container_name: shepherd
restart: unless-stopped
# The engine shuts down on SIGINT. Docker sends SIGTERM by default.
stop_signal: SIGINT
# Longer than the engine's shutdown drain, which is 150 s by default.
stop_grace_period: 180s
volumes:
# The engine config. Set SHEPHERD_ENGINE_CONFIG in `.env` to mount
# your own file in place of the committed one.
- ${SHEPHERD_ENGINE_CONFIG:-./engine.docker.toml}:/etc/shepherd/engine.toml:ro
# The local store, on a named volume so that it survives an upgrade.
- shepherd-state:/var/lib/shepherd
ports:
# /metrics, /healthz and /readyz, on the loopback address of the
# host only. The listener has no authentication.
- "127.0.0.1:9100:9100"
environment:
RUST_BACKTRACE: "1"
# Forwarded from `.env`. `engine.docker.toml` reads it.
MAINNET_RPC_URL:
# An outer limit on the process. The engine limits each module itself.
deploy:
resources:
limits:
memory: 2g
cpus: "2.0"
# Bound the container log: 10 files of 100 MB.
logging:
driver: json-file
options:
max-size: "100m"
max-file: "10"
networks:
- shepherd-net
# The listener answers once the engine has booted. A quarantined
# module does not make this check fail: read /readyz for module state.
healthcheck:
test: ["CMD", "bash", "-c", "exec 3<>/dev/tcp/127.0.0.1/9100"]
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
prometheus:
image: prom/prometheus:v2.55.0
container_name: shepherd-prometheus
restart: unless-stopped
profiles: ["observability"]
volumes:
- ./docs/deployment/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.retention.time=30d"
ports:
- "127.0.0.1:9090:9090"
networks:
- shepherd-net
depends_on:
shepherd:
condition: service_healthy
volumes:
shepherd-state:
prometheus-data:
networks:
shepherd-net:
driver: bridge