Skip to content

Commit d642cce

Browse files
authored
Move Docker demo to examples/docker, simplify README (#100)
- Move docker-compose.yml to examples/docker (integration test infra) - Add examples/docker/README.md with detailed Docker usage docs - Trim main README Docker section to prioritize published sidequery/sidemantic image - Clarify volume mount requirement and ADBC connection method
1 parent 74e22ed commit d642cce

3 files changed

Lines changed: 86 additions & 61 deletions

File tree

README.md

Lines changed: 6 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
A universal metrics layer for consistent metrics across your data stack. Compatible with 15+ semantic model formats.
44

55
- **Supported Formats:** Sidemantic (YAML, Python or SQL), Cube, dbt MetricFlow, LookML, Hex, Rill, Superset, Omni, BSL, GoodData LDM, Snowflake Cortex, Malloy, OSI, AtScale SML, ThoughtSpot TML
6-
- **Databases:** DuckDB, MotherDuck, PostgreSQL, BigQuery, Snowflake, ClickHouse, Databricks, Spark SQL, ADBC
6+
- **Databases:** DuckDB, MotherDuck, PostgreSQL, BigQuery, Snowflake, ClickHouse, Databricks, Spark SQL (also via ADBC)
77

88
[Documentation](https://sidemantic.com) | [GitHub](https://github.com/sidequery/sidemantic) | [Discord](https://discord.com/invite/7MZ4UgSVvF) | [Demo](https://sidemantic.com/demo) (50+ MB data download, runs in your browser with Pyodide + DuckDB)
99

@@ -252,74 +252,19 @@ load_from_directory(layer, "my_models/") # Auto-detects formats
252252

253253
## Docker
254254

255-
Build the image (includes all database drivers, PG server, and MCP server):
255+
The published image is [`sidequery/sidemantic`](https://hub.docker.com/r/sidequery/sidemantic) on Docker Hub. Mount your models directory as a volume at `/app/models`:
256256

257257
```bash
258-
docker build -t sidemantic .
258+
docker run -p 5433:5433 -v ./models:/app/models sidequery/sidemantic
259259
```
260260

261-
### PostgreSQL server (default)
262-
263-
Mount your models directory and expose port 5433:
264-
265-
```bash
266-
docker run -p 5433:5433 -v ./models:/app/models sidemantic
267-
```
268-
269-
Connect with any PostgreSQL client:
270-
271-
```bash
272-
psql -h localhost -p 5433 -U any -d sidemantic
273-
```
274-
275-
With a backend database connection:
261+
Demo mode (built-in sample data, no volume needed):
276262

277263
```bash
278-
docker run -p 5433:5433 \
279-
-v ./models:/app/models \
280-
-e SIDEMANTIC_CONNECTION="postgres://user:pass@host:5432/db" \
281-
sidemantic
264+
docker run -p 5433:5433 sidequery/sidemantic --demo
282265
```
283266

284-
### MCP server
285-
286-
```bash
287-
docker run -v ./models:/app/models -e SIDEMANTIC_MODE=mcp sidemantic
288-
```
289-
290-
### Both servers simultaneously
291-
292-
Runs the PG server in the background and MCP on stdio:
293-
294-
```bash
295-
docker run -p 5433:5433 -v ./models:/app/models -e SIDEMANTIC_MODE=both sidemantic
296-
```
297-
298-
### Demo mode
299-
300-
```bash
301-
docker run -p 5433:5433 sidemantic --demo
302-
```
303-
304-
### Baking models into the image
305-
306-
Create a `Dockerfile` that copies your models at build time:
307-
308-
```dockerfile
309-
FROM sidemantic
310-
COPY my_models/ /app/models/
311-
```
312-
313-
### Environment variables
314-
315-
| Variable | Description |
316-
|----------|-------------|
317-
| `SIDEMANTIC_MODE` | `serve` (default), `mcp`, or `both` |
318-
| `SIDEMANTIC_CONNECTION` | Database connection string |
319-
| `SIDEMANTIC_DB` | Path to DuckDB file (inside container) |
320-
| `SIDEMANTIC_USERNAME` | PG server auth username |
321-
| `SIDEMANTIC_PASSWORD` | PG server auth password |
322-
| `SIDEMANTIC_PORT` | PG server port (default 5433) |
267+
See [`examples/docker/`](examples/docker/) for MCP mode, env vars, building from source, and integration test services.
323268

324269
## Testing
325270

examples/docker/README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Docker
2+
3+
The published image is `sidequery/sidemantic` on Docker Hub. It includes all database drivers, the PostgreSQL wire-protocol server, and the MCP server.
4+
5+
## PostgreSQL server (default)
6+
7+
Mount your models directory and expose port 5433:
8+
9+
```bash
10+
docker run -p 5433:5433 -v ./models:/app/models sidequery/sidemantic
11+
```
12+
13+
Connect with any PostgreSQL client:
14+
15+
```bash
16+
psql -h localhost -p 5433 -U any -d sidemantic
17+
```
18+
19+
With a backend database connection:
20+
21+
```bash
22+
docker run -p 5433:5433 \
23+
-v ./models:/app/models \
24+
-e SIDEMANTIC_CONNECTION="postgres://user:pass@host:5432/db" \
25+
sidequery/sidemantic
26+
```
27+
28+
## MCP server
29+
30+
```bash
31+
docker run -v ./models:/app/models -e SIDEMANTIC_MODE=mcp sidequery/sidemantic
32+
```
33+
34+
## Both servers simultaneously
35+
36+
Runs the PG server in the background and MCP on stdio:
37+
38+
```bash
39+
docker run -p 5433:5433 -v ./models:/app/models -e SIDEMANTIC_MODE=both sidequery/sidemantic
40+
```
41+
42+
## Demo mode
43+
44+
```bash
45+
docker run -p 5433:5433 sidequery/sidemantic --demo
46+
```
47+
48+
## Baking models into the image
49+
50+
```dockerfile
51+
FROM sidequery/sidemantic
52+
COPY my_models/ /app/models/
53+
```
54+
55+
## Environment variables
56+
57+
| Variable | Description |
58+
|----------|-------------|
59+
| `SIDEMANTIC_MODE` | `serve` (default), `mcp`, or `both` |
60+
| `SIDEMANTIC_CONNECTION` | Database connection string |
61+
| `SIDEMANTIC_DB` | Path to DuckDB file (inside container) |
62+
| `SIDEMANTIC_USERNAME` | PG server auth username |
63+
| `SIDEMANTIC_PASSWORD` | PG server auth password |
64+
| `SIDEMANTIC_PORT` | PG server port (default 5433) |
65+
66+
## Building from source
67+
68+
From the repo root:
69+
70+
```bash
71+
docker build -t sidemantic .
72+
```
73+
74+
## Integration test services (docker-compose)
75+
76+
The `docker-compose.yml` in this directory spins up Postgres, BigQuery emulator, Spark, and ClickHouse for local integration testing:
77+
78+
```bash
79+
docker compose -f examples/docker/docker-compose.yml up
80+
```

0 commit comments

Comments
 (0)