Bencher Compose


The easiest way to deploy Bencher Self-Hosted is using a triptych of bencher CLI subcommands:


bencher up

Create and start the Bencher Self-Hosted containers. This is similar to running docker compose up.

bencher up [OPTIONS] [SERVICE]

Service

Select the containers to run. The possible choices are: all, api, and console. By default all is chosen. Similar to the SERVICE argument for docker compose up.

Options

--detach

Run in detached mode. The containers will be run in the background. Similar to the --detach flag for docker compose up.

--pull <WHEN>

Pull images before running. The possible choices are: always, missing, and never. By default always is chosen. Similar to the --pull option for docker compose up.

--tag <TAG>

Specify the image tag for the containers. By default the image tag matches the bencher CLI version. The most recent bencher CLI version is v0.4.37.

--console-port <PORT>

Specify a port number for the Console server container. By default, port 3000 is used. Similar to the port only form of the --expose option for docker run.

--api-port <PORT>

Specify a port number for the API server container. By default, port 61016 is used. Similar to the port only form of the --expose option for docker run.

--console-env <KEY_VALUE>

Pass an environment variable to the Console server container. The expected format is KEY=value. This can be useful when working with the Console Server configuration. Similar to the --env option for docker run.

--api-env <KEY_VALUE>

Pass an environment variable to the API server container. The expected format is KEY=value. This can be useful when working with the API Server configuration. Similar to the --env option for docker run.

--console-volume <HOST_CONTAINER>

Pass a mount volume to the Console server container. The expected format is /host/path:/container/path. This can be useful when working with the Console Server configuration. Similar to the --volume option for docker run.

--api-volume <HOST_CONTAINER>

Pass a mount volume to the API server container. The expected format is /host/path:/container/path. This can be useful when working with the API Server configuration. Similar to the --volume option for docker run.

--help

Print help.


bencher logs

View output from the Bencher Self-Hosted containers, if bencher up was run with the --detach flag. This is similar to running docker compose logs.

bencher up [OPTIONS] [SERVICE]

Service

Select the containers to run. The possible choices are: all, api, and console. By default all is chosen. Similar to the SERVICE argument for docker compose logs.

Options

--help

Print help.


bencher down

Stop and remove the Bencher Self-Hosted containers, if bencher up was run with the --detach flag. This is similar to running docker compose down.

bencher down [OPTIONS] [SERVICE]

Service

Select the containers to run. The possible choices are: all, api, and console. By default all is chosen. Similar to the SERVICE argument for docker compose down.

Options

--help

Print help.


Docker Compose

services:
bencher_api_compose:
image: ghcr.io/bencherdev/bencher-api:latest
container_name: bencher_api
ports:
- 61016:61016
volumes:
# Mount the configuration directory
- "./services/api/etc:/etc/bencher"
# Mount the database directory
- "./services/api/data:/var/lib/bencher/data"
# environment:
# Set configuration string or file path
# - BENCHER_CONFIG=
# - BENCHER_CONFIG_PATH=
bencher_console_compose:
image: ghcr.io/bencherdev/bencher-console:latest
container_name: bencher_console
ports:
- 3000:3000
environment:
# Set the API URL to the localhost IPv4 address
- BENCHER_API_URL=http://127.0.0.1:61016
# This is needed for Docker-to-Docker communication when using a local `BENCHER_API_URL`
# Do not set this when using a remote `BENCHER_API_URL`, such as https://bencher.example.com
- INTERNAL_API_URL=http://host.docker.internal:61016
depends_on:
- bencher_api_compose


Published: Sun, February 16, 2025 at 9:33:00 PM UTC