project-root/
├── docker-compose.yml
├── .env
├── fastapi-app/
│ ├── Dockerfile
│ ├── requirements.txt
│ └── main.py
├── grafana/
│ └── provisioning/
│ └── datasources/
│ └── postgres.yaml
└── superset/
└── superset-init.sh
| Tool | Minimum version | Purpose |
|---|---|---|
| Docker Engine | 20.10+ | Runs the containers |
| Docker Compose | v2 (built-in to recent Docker) | Or docker compose CLI plugin |
Verify:
docker --version docker compose version
git clone gh:metrics-server
# (or git-clone your repo if you committed them there)Tip: keep the
.envfile outside version control if you’ll use real passwords (echo .env >> .gitignore).
Open .env and change any of:
POSTGRES_USER=appuser
POSTGRES_PASSWORD=secretpassword
POSTGRES_DB=appdb
GRAFANA_ADMIN_USER=admin
GRAFANA_ADMIN_PASSWORD=adminpass
SUPERSET_SECRET_KEY=someSuperSecretKey
SUPERSET_ADMIN_USER=admin
SUPERSET_ADMIN_PASSWORD=adminpassdocker compose up -d --build--buildensures the FastAPI image is constructed on first run.- The first start may take a minute while Superset boots and initialises its metadata.
docker compose ps # check STATUS → healthy or running
docker compose logs -f # watch combined logsYou should see messages like “Postgres is ready” and “superset init finished”.
| Component | URL | Default login |
|---|---|---|
| FastAPI | http://localhost:8000 | no auth – interactive docs at /docs |
| Grafana | http://localhost:3000 | admin / adminpass |
| Superset | http://localhost:8088 | admin / adminpass |
# create an item
curl -X POST http://localhost:8000/items/ \
-H "Content-Type: application/json" \
-d '{"name":"widget","description":"demo record"}'
# fetch items
curl http://localhost:8000/items/The JSON list returned should include the item you just created.
-
Grafana:
Log in → Connections → Data sources → “Postgres” is already present.
Create a panel and run e.g.SELECT * FROM items. -
Superset:
Database “Postgres” is pre-registered.
Go to SQL Lab → SQL Editor, pick the database/schema, and queryitems.
# Stop containers but keep data volumes
docker compose down
# Stop **and** delete volumes (PostgreSQL & Grafana data lost)
docker compose down -vThat’s it—your minimal LGTM (Loki-Grafana-Tempo-Mimir variant) stack with PostgreSQL, FastAPI and Superset is live and wired together.