diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..951727346 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +*target diff --git a/Dockerfile.cli b/Dockerfile.cli new file mode 100644 index 000000000..474b73c34 --- /dev/null +++ b/Dockerfile.cli @@ -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"] diff --git a/Makefile b/Makefile index a507700a0..ff1d42aaf 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/README.md b/README.md index c666770b6..8dc7cdc1b 100644 --- a/README.md +++ b/README.md @@ -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: