Merge 'Add cli Dockerfile' from Pere Diaz Bou

Shamelessly vibe coded shit to add simple docker image to run the cli
:).
`docker build -f Dockerfile.cli -t turso-cli . && docker run -it turso-
cli`

Reviewed-by: Preston Thorpe (@PThorpe92)

Closes #2325
This commit is contained in:
PThorpe92
2025-07-31 00:05:30 -04:00
4 changed files with 34 additions and 0 deletions

1
.dockerignore Normal file
View File

@@ -0,0 +1 @@
*target

20
Dockerfile.cli Normal file
View File

@@ -0,0 +1,20 @@
FROM rust:1.88.0 as builder
WORKDIR /app
# Copy the actual source code
COPY . .
# Build the CLI binary
RUN cargo build --release --package turso_cli
# Runtime stage
FROM rust:1.88.0-slim
WORKDIR /app
# Copy the built binary
COPY --from=builder /app/target/release/tursodb /usr/local/bin/
# Set the entrypoint
ENTRYPOINT ["tursodb"]

View File

@@ -150,3 +150,9 @@ bench-exclude-tpc-h:
cargo bench $$benchmarks; \
fi
.PHONY: bench-exclude-tpc-h
docker-cli-build:
docker build -f Dockerfile.cli -t turso-cli .
docker-cli-run:
docker run -it -v ./:/app turso-cli

View File

@@ -88,6 +88,13 @@ You can also build and run the latest development version with:
cargo run
```
If you like docker, we got you covered. Simply run this in the root folder:
```bash
make docker-cli-build && \
make docker-cli-run
```
### MCP Server Mode
The Turso CLI includes a built-in [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that allows AI assistants to interact with your databases. Start the MCP server with: