1d9fd00cc2
Adds inline waveform plots to the shared event-detail modal, ported from sfm/sfm_webapp.html:2555-2880. The standalone SFM webapp's plot logic moves into event-modal.js with Tailwind-friendly grid + tick colors (theme-aware via the `dark` class on <html>). Channels render in BW Event Report order — MicL on top, Tran on bottom. Mic channel auto-converts psi → dB(L) when the operator's mic_unit_pref is "dBL" (the default), using _psiToDblForChart with a MIC_DBL_FLOOR=60 floor so the chart shows an SPL-vs-time curve instead of a sparse pattern of "moments above floor". Histograms render as bars with HH:MM:SS x-axis labels when the sidecar carries time_axis.interval_times (events ingested with the v0.20 parser); falls back to interval index for older events. Geo + mic histogram channels enforce minimum Y ranges (0.05 in/s and 0.001 psi respectively) so quiet events don't fill the panel. Waveform events get the trigger-line + zero-baseline overlay; the histogram branch suppresses it (no trigger concept). Downsampling kicks in at >3000 samples to keep render time bounded. Modal partial widened max-w-3xl → max-w-5xl to fit the chart panels without horizontal clipping. Chart.js 4.4.1 loaded from cdn.jsdelivr at the bottom of the partial, matching the standalone webapp's reference version pin. Side-yard: docker-compose bind-mounts ../seismo-relay-prod-snap into the SFM container so the symlinked DB + waveform store inside bridges/captures resolve. Without it SFM 500s on every /db/* call because the symlink target was outside the container's filesystem view. Read-write (not :ro) because SFM opens the DB in WAL mode which requires creating -wal and -shm sidecar files even for reads. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
84 lines
2.4 KiB
YAML
84 lines
2.4 KiB
YAML
services:
|
|
|
|
terra-view:
|
|
build: .
|
|
ports:
|
|
- "8001:8001"
|
|
volumes:
|
|
- ./data:/app/data
|
|
environment:
|
|
- PYTHONUNBUFFERED=1
|
|
- ENVIRONMENT=production
|
|
- SLMM_BASE_URL=http://host.docker.internal:8100
|
|
- SFM_BASE_URL=http://sfm:8200
|
|
# Display timezone for server logs + any text-rendered timestamps.
|
|
# DB columns are stored UTC regardless; this only affects what
|
|
# operators see. Override here for non-US-East deployments.
|
|
- TZ=America/New_York
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- slmm
|
|
- sfm
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
# --- SLMM (Sound Level Meter Manager) ---
|
|
slmm:
|
|
build:
|
|
context: ../slmm
|
|
dockerfile: Dockerfile
|
|
network_mode: host
|
|
volumes:
|
|
- ../slmm/data:/app/data
|
|
environment:
|
|
- PYTHONUNBUFFERED=1
|
|
- PORT=8100
|
|
- CORS_ORIGINS=*
|
|
- TCP_IDLE_TTL=-1
|
|
- TCP_MAX_AGE=-1
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8100/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 10s
|
|
|
|
# --- SFM (Seismo Fleet Manager) ---
|
|
sfm:
|
|
build:
|
|
context: ../seismo-relay
|
|
dockerfile: Dockerfile
|
|
ports:
|
|
- "8200:8200"
|
|
volumes:
|
|
- ../seismo-relay/sfm/data:/app/sfm/data
|
|
- ../seismo-relay/bridges/captures:/app/bridges/captures
|
|
# The DB + waveform store inside bridges/captures are symlinks
|
|
# pointing at the prod-snap directory. Mount its host path at
|
|
# the same absolute path inside the container so the symlinks
|
|
# resolve. Needed for SFM to query the events DB.
|
|
- ../seismo-relay-prod-snap:/home/serversdown/seismo-relay-prod-snap
|
|
environment:
|
|
- PYTHONUNBUFFERED=1
|
|
- PORT=8200
|
|
# Display timezone — affects server log timestamps, the PDF
|
|
# report renderer's UTC→local conversions, and matplotlib's
|
|
# datetime axes. DB columns (created_at etc.) are always UTC.
|
|
- TZ=America/New_York
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8200/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 10s
|
|
volumes:
|
|
data:
|