-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
151 lines (144 loc) · 5.91 KB
/
Copy pathdocker-compose.yml
File metadata and controls
151 lines (144 loc) · 5.91 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
150
151
services:
gex-faker-api:
build:
context: .
target: server
container_name: gex-faker-api
user: "${PUID:-1000}:${PGID:-1000}"
ports:
# Bind to loopback by default so `docker compose up` never exposes the API
# (and the Studio control plane + logs) to the LAN unauthenticated. For
# remote access set HOST_BIND=0.0.0.0 AND set STUDIO_AUTH_TOKEN — and put it
# behind TLS (e.g. a reverse proxy), since Basic/Bearer over plain HTTP is
# plaintext.
- "${HOST_BIND:-127.0.0.1}:${HOST_PORT:-8080}:8080"
volumes:
- ${DATA_HOST_DIR:-./data}:/app/data:rw
# Same read-only configs mount as the daemon, so Studio's manual downloads use
# the SAME effective YAML (tickers/packages/categories) the daemon does.
- ./configs:/app/configs:ro
environment:
- PORT=8080
- DATA_DIR=/app/data
- DATA_DATE=${DATA_DATE:-}
- DATA_MODE=${DATA_MODE:-memory}
- CACHE_MODE=${CACHE_MODE:-exhaust}
- ENDPOINT_CACHE_MODE=${ENDPOINT_CACHE_MODE:-shared}
- SYNC_BROADCAST_SYSTEM_ENABLED=${SYNC_BROADCAST_SYSTEM_ENABLED:-false}
- SYNC_BROADCAST_SYSTEM_ID=${SYNC_BROADCAST_SYSTEM_ID:-}
- SYNC_BROADCAST_SYSTEM_INTERVAL=${SYNC_BROADCAST_SYSTEM_INTERVAL:-1s}
# Enables the Studio Download screen (fetch market days from GEXbot). Unset
# = Download degrades with a "set GEXBOT_API_KEY" message. Never logged.
- GEXBOT_API_KEY=${GEXBOT_API_KEY:-}
# Studio Logs screen reads logs from Loki over the compose network.
- LOKI_URL=${LOKI_URL:-http://loki:3100}
# Studio Monitoring screen queries Prometheus over the compose network.
- PROMETHEUS_URL=${PROMETHEUS_URL:-http://prometheus:9090}
# The downloader YAML the Studio download worker loads — the SAME path the
# daemon uses, so manual and scheduled downloads share one coverage authority.
- GEXBOT_DOWNLOADER_CONFIG=${DAEMON_CONFIG_PATH:-/app/configs/default.yaml}
# Studio Settings proxies the daemon's sanitized status over the compose network.
- DAEMON_URL=${DAEMON_URL:-http://gex-daemon:9091}
# Set to require HTTP Basic auth on /studio (any user, password = token).
# Empty = open; set this whenever the API port is reachable beyond a trusted host.
- STUDIO_AUTH_TOKEN=${STUDIO_AUTH_TOKEN:-}
depends_on:
- loki
- prometheus
- gex-daemon
labels:
- observability.logs=true
- observability.service=gex-faker-api
restart: unless-stopped
gex-daemon:
build:
context: .
target: daemon
container_name: gex-daemon
user: "${PUID:-1000}:${PGID:-1000}"
volumes:
- ${DATA_HOST_DIR:-./data}:/app/data:rw
- ./configs:/app/configs:ro
environment:
- DAEMON_SCHEDULE_HOUR=${DAEMON_SCHEDULE_HOUR:-17}
- DAEMON_SCHEDULE_MINUTE=${DAEMON_SCHEDULE_MINUTE:-5}
- DAEMON_TIMEZONE=${DAEMON_TIMEZONE:-America/New_York}
- DAEMON_STATE_FILE=/app/data/.daemon-state
- DAEMON_CONFIG_PATH=${DAEMON_CONFIG_PATH:-/app/configs/default.yaml}
- DAEMON_RUN_ON_STARTUP=${DAEMON_RUN_ON_STARTUP:-true}
- DAEMON_RUN_TIMEOUT_MINUTES=${DAEMON_RUN_TIMEOUT_MINUTES:-45}
- GEXBOT_OUTPUT_AUTO_CLEANUP=${GEXBOT_OUTPUT_AUTO_CLEANUP:-false}
- GEXBOT_OUTPUT_CLEANUP_AFTER_DAYS=${GEXBOT_OUTPUT_CLEANUP_AFTER_DAYS:-7}
- GEXBOT_API_KEY=${GEXBOT_API_KEY}
- NTFY_ENABLED=${NTFY_ENABLED:-false}
- NTFY_SERVER=${NTFY_SERVER:-https://ntfy.sh}
- NTFY_TOPIC=${NTFY_TOPIC:-}
- NTFY_PRIORITY=${NTFY_PRIORITY:-default}
- NTFY_TAGS=${NTFY_TAGS:-package}
- NTFY_TOKEN=${NTFY_TOKEN:-}
labels:
- observability.logs=true
- observability.service=gex-daemon
restart: unless-stopped
# One-off downloader CLI. Never starts with `up` (tools profile); run on demand:
# docker compose --profile tools run --rm gex-tools download 2026-07-28
# docker compose --profile tools run --rm gex-tools eod pack all --prune
gex-tools:
profiles: ["tools"]
build:
context: .
target: tools
image: gexbot-faker-api-gex-tools
user: "${PUID:-1000}:${PGID:-1000}"
working_dir: /app
volumes:
- ./data:/app/data:rw
- ./configs:/app/configs:ro
environment:
- GEXBOT_API_KEY=${GEXBOT_API_KEY}
- GEXBOT_DOWNLOADER_CONFIG=${DAEMON_CONFIG_PATH:-/app/configs/default.yaml}
# Prometheus, Loki, and Alloy run in the DEFAULT stack. Studio queries
# Prometheus (metrics) and Loki (logs) server-side over the compose network —
# the browser never talks to them. None are host-published.
prometheus:
image: prom/prometheus:v3.13.2
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- --storage.tsdb.retention.time=${PROMETHEUS_RETENTION:-30d}
volumes:
- ./observability/prometheus:/etc/prometheus:ro
- prometheus_data:/prometheus
restart: unless-stopped
# Alertmanager delivers firing alerts to ntfy via the daemon's /alerts/ntfy webhook
# bridge, so the rule set actually pages an operator instead of only rendering in Studio.
alertmanager:
image: prom/alertmanager:v0.27.0
command:
- --config.file=/etc/alertmanager/config.yml
- --storage.path=/alertmanager
volumes:
- ./observability/alertmanager:/etc/alertmanager:ro
- alertmanager_data:/alertmanager
restart: unless-stopped
loki:
image: grafana/loki:3.7.6
command: -config.file=/etc/loki/config.yml
volumes:
- ./observability/loki/config.yml:/etc/loki/config.yml:ro
- loki_data:/loki
restart: unless-stopped
alloy:
image: grafana/alloy:v1.18.1
command: run /etc/alloy/config.alloy
volumes:
- ./observability/alloy/config.alloy:/etc/alloy/config.alloy:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- alloy_data:/var/lib/alloy
depends_on: [loki]
restart: unless-stopped
volumes:
prometheus_data:
alertmanager_data:
loki_data:
alloy_data: