mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 12:37:20 +00:00
docs: added docker instructions
This commit is contained in:
45
docs/integration/docker.mdx
Normal file
45
docs/integration/docker.mdx
Normal file
@@ -0,0 +1,45 @@
|
||||
---
|
||||
title: 'Docker'
|
||||
description: 'Official docker image for bknd'
|
||||
---
|
||||
|
||||
# Official `bknd` Docker image
|
||||
The docker image intentially doesn't copy any data into the image for now, so you can copy the
|
||||
Dockerfile and build the image anywhere.
|
||||
|
||||
Locate the Dockerfile either by pulling the [repository](https://github.com/bknd-io/bknd) and navigating to the `docker`
|
||||
directory,
|
||||
or download from [here](https://github.com/bknd-io/bknd/blob/main/docker/Dockerfile).
|
||||
|
||||
## Building the Docker image
|
||||
To build the Docker image, run the following command:
|
||||
|
||||
```bash
|
||||
docker build -t bknd .
|
||||
```
|
||||
|
||||
## Running the Docker container
|
||||
To run the Docker container, run the following command:
|
||||
|
||||
```bash
|
||||
docker run -p 1337:1337 bknd
|
||||
```
|
||||
|
||||
You can pass the same CLI arguments (see [Using the CLI](https://docs.bknd.io/cli) guide) to the
|
||||
docker container as you'd do with
|
||||
`npx bknd
|
||||
run`,
|
||||
like so:
|
||||
|
||||
```bash
|
||||
docker run -p 1337:1337 -e ARGS="--db-url file:/data/data.db" bknd
|
||||
```
|
||||
Or connect to a remote turso database:
|
||||
```bash
|
||||
docker run -p 1337:1337 -e ARGS="--db-url libsql://<db>.turso.io --db-token <token>" bknd
|
||||
```
|
||||
|
||||
To mount the data directory to the host, you can use the `-v` flag:
|
||||
```bash
|
||||
docker run -p 1337:1337 -v /path/to/data:/data bknd
|
||||
```
|
||||
Reference in New Issue
Block a user