M0: scaffold solution, EF+Timescale schema, /healthz
Five-project Clean Architecture solution (Core/Infrastructure/App + Core.Tests/ Integration.Tests) on .NET 10 with central package management, snake_case EF mapping, and shared build/style config. - Full domain entity set + EF DbContext for the SDD §5.3 schema (singular table names). - InitialSchema migration (relational) + TimescaleHypertables migration (raw SQL: create_hypertable + compression on reading, hypertable on consumption). - App wiring: Serilog (actually wired, unlike MQTTower), DbContext, migrate-on-startup, /healthz. Serves plain HTTP behind a reverse proxy (no HTTPS redirect). - deploy/Dockerfile (2-stage, ICU-capable) + docker-compose (app + timescaledb). - Integration.Tests: shared TimescaleFixture (Testcontainers) — migrations, hypertables, compression policy, and /healthz all verified green (4/4). Claude-Session: https://claude.ai/code/session_01WujdMtMJPbxDpDnMeK22rr
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
# MeterVault self-host stack: the Blazor app + TimescaleDB.
|
||||
# docker compose -f deploy/docker-compose.yml up -d
|
||||
# Secrets are supplied via environment variables (Section__Key double-underscore mapping)
|
||||
# with ${VAR:-default} fallbacks — never baked into the image.
|
||||
|
||||
services:
|
||||
db:
|
||||
image: timescale/timescaledb:2.17.2-pg16
|
||||
environment:
|
||||
POSTGRES_DB: metervault
|
||||
POSTGRES_USER: metervault
|
||||
POSTGRES_PASSWORD: ${METERVAULT_DB_PASSWORD:-metervault}
|
||||
volumes:
|
||||
- metervault_db:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U metervault -d metervault"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
restart: unless-stopped
|
||||
|
||||
app:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: deploy/Dockerfile
|
||||
image: ${METERVAULT_IMAGE:-metervault/metervault:local}
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
ConnectionStrings__Default: "Host=db;Port=5432;Database=metervault;Username=metervault;Password=${METERVAULT_DB_PASSWORD:-metervault}"
|
||||
ASPNETCORE_ENVIRONMENT: Production
|
||||
MeterVault__TimeZone: ${METERVAULT_TIMEZONE:-Europe/Berlin}
|
||||
MeterVault__Currency: ${METERVAULT_CURRENCY:-EUR}
|
||||
MeterVault__Locale: ${METERVAULT_LOCALE:-en}
|
||||
ports:
|
||||
- "${METERVAULT_PORT:-8080}:8080"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -fsS http://localhost:8080/healthz || exit 1"]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 30s
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
metervault_db:
|
||||
Reference in New Issue
Block a user