Skip to content

v0.8.10

Choose a tag to compare

@auggiesoft auggiesoft released this 28 Feb 11:58
· 309 commits to master since this release

Zero-config Docker setup

Docker Compose now works with zero configuration — just docker-compose.yml and docker compose up -d. No .env file, no schema.sql download needed.

What changed

  • Auto-apply schema on startup — tr-engine now embeds schema.sql and applies it automatically when it connects to a fresh database. No more downloading schema.sql separately or mounting it into the PostgreSQL container's init directory.

  • Configurable Docker defaults via .env — database credentials (POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB) and host ports (HTTP_PORT, MQTT_PORT) are now configurable in .env with sensible defaults. DATABASE_URL is built automatically from the POSTGRES_* variables — no more duplicating credentials in multiple places.

  • Simplified docs — Docker quickstart is now one curl + one command. sample.env is optional (download it only when you need to customize). Updated docker.md, docker-external-mqtt.md, getting-started.md, and install.sh.

Upgrading

No action needed — existing databases are detected and the schema auto-apply is skipped. The schema.sql volume mount in your docker-compose.yml is harmless if still present, but you can remove it:

# Remove this line from your postgres volumes:
- ./schema.sql:/docker-entrypoint-initdb.d/01-schema.sql:ro

Files changed

File Change
embed.go Embed schema.sql in binary
internal/database/schema.go New — InitSchema() checks for tables, applies if missing
cmd/tr-engine/main.go Call InitSchema() between Connect and Migrate
docker-compose.yml Remove schema mount, add ${POSTGRES_*} / ${HTTP_PORT} / ${MQTT_PORT} interpolation
sample.env Add Docker-specific variables section
install.sh Remove schema.sql download, use variable interpolation
docs/docker.md Zero-config quickstart, document new variables
docs/docker-external-mqtt.md Same cleanup
docs/getting-started.md Note auto-apply, keep manual option