Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/backtest-kit/backtest-kit-minio-s3-docker/llms.txt

Use this file to discover all available pages before exploring further.

All runtime configuration for backtest-kit-minio-s3-docker is driven by a single .env file located at the project root. The file is consumed in two ways: the Node.js process reads it directly when running on the host (via dotenv), and the main docker-compose.yaml passes it into the strategy runner container via the env_file directive. This means both deployment modes share an identical configuration surface — changing a value in .env affects the host run and the Docker run equally.

.env.example

.env.example
# Infrastructure endpoints as seen from the backtest-kit container
# (docker-compose.yaml maps host.docker.internal to the host gateway).
# For a host-node run replace host.docker.internal with 127.0.0.1.

# MinIO (S3) — source of truth, see docker/minio/docker-compose.yaml
CC_MINIO_ENDPOINT=host.docker.internal
CC_MINIO_PORT=9000
CC_MINIO_ACCESSKEY=minioadmin
CC_MINIO_SECRETKEY=minioadmin

# Redis — time-ordered index, see docker/redis/docker-compose.yaml
CC_REDIS_HOST=host.docker.internal
CC_REDIS_PORT=6379
CC_REDIS_USER=default
CC_REDIS_PASSWORD=mysecurepassword

MinIO connection variables

CC_MINIO_ENDPOINT
string
default:"localhost"
Hostname or IP address of the MinIO S3 API. Use localhost (or 127.0.0.1) when running backtest-kit directly on the host and MinIO is in a local container. Use host.docker.internal when backtest-kit itself runs inside a container (the main docker-compose.yaml maps this to the host gateway automatically). Can be set to any resolvable hostname or IP for a remote MinIO deployment.
CC_MINIO_PORT
number
default:"9000"
Port for the MinIO S3-compatible API. Matches the 9000 host port exposed in docker/minio/docker-compose.yaml. Only change this if you have remapped the MinIO port in your Compose file or are pointing at a remote endpoint on a non-standard port.
CC_MINIO_ACCESSKEY
string
default:"minioadmin"
MinIO access key (equivalent to an AWS AWS_ACCESS_KEY_ID). Must match the MINIO_ROOT_USER value configured in docker/minio/docker-compose.yaml. All 16 persistence adapters authenticate with this credential when performing S3 GET, PUT, HEAD, and DELETE operations.
CC_MINIO_SECRETKEY
string
default:"minioadmin"
MinIO secret key (equivalent to an AWS AWS_SECRET_ACCESS_KEY). Must match MINIO_ROOT_PASSWORD in the MinIO Compose file. Treat this value with the same care as a database password.

Redis connection variables

CC_REDIS_HOST
string
default:"127.0.0.1"
Hostname or IP address of the Redis instance that serves as the time-ordered index. The same 127.0.0.1 vs host.docker.internal distinction applies here as for CC_MINIO_ENDPOINT — use 127.0.0.1 for host-node runs and host.docker.internal for containerised runs.
CC_REDIS_PORT
number
default:"6379"
Redis port. Matches the 6379 host port exposed in docker/redis/docker-compose.yaml. Change only if you have remapped the port or are targeting a remote Redis instance on a non-standard port.
CC_REDIS_USER
string
default:"default"
Redis ACL username. The default Redis ACL creates a single default user; leave this as default unless you have provisioned named Redis users via an aclfile or ACL SETUSER commands.
CC_REDIS_PASSWORD
string
default:"mysecurepassword"
Redis requirepass authentication password. Must match the --requirepass argument set in docker/redis/docker-compose.yaml. Used by ioredis on every new connection.

Container runtime variables

When backtest-kit runs inside the tripolskypetr/backtest-kit Docker image (via the main docker-compose.yaml), additional environment variables are passed through to configure the @backtest-kit/cli entrypoint. These are not read from .env — they are set inline as shell exports or in the environment: block of the Compose file.
MODE
string
Selects the execution mode. Must be one of:
  • backtest — replay historical candle data
  • live — connect to live exchange feeds
  • paper — live feeds with simulated order execution
Required whenever ENTRY=1 is set.
STRATEGY_FILE
string
default:"./build/index.cjs"
Path to the compiled strategy bundle that the runner will require(). The default ./build/index.cjs is the output of npm run build (Rollup). The project root is mounted as /workspace inside the container, so relative paths resolve correctly.
ENTRY
string
Set to 1 to actually execute the runner. Without this flag the process starts but immediately exits, mirroring the --entry guard in the CLI mode. Prevents accidental execution when a container is restarted without the intent to run a strategy.
SYMBOL
string
Overrides the trading symbol (e.g. BTCUSDT) defined in the strategy source. Useful for running the same compiled bundle against multiple symbols without a rebuild.
STRATEGY
string
Overrides the strategy name key registered in the strategy source.
EXCHANGE
string
Overrides the exchange identifier (e.g. ccxt).
FRAME
string
Overrides the timeframe / frame name key (e.g. Jan2026Frame).
UI
string
Set to 1 to enable the web UI served on port 60050. The container exposes this port, and the healthcheck polls it at http://localhost:60050/api/v1/health/health_check every 30 seconds.
TELEGRAM
string
Set to 1 to enable Telegram trade notifications. Requires Telegram bot credentials to be configured in the strategy source.
VERBOSE
string
Set to 1 to enable verbose logging output. Useful for debugging adapter calls or tracking individual MinIO and Redis operations.
NO_CACHE
string
Set to 1 to disable the in-process candle cache. Every candle read will hit MinIO directly. Primarily useful for testing cache-invalidation behaviour.
NO_FLUSH
string
Set to 1 to skip the flush-on-shutdown sequence. Normally backtest-kit writes any pending in-memory state to MinIO before exiting; this flag suppresses that behaviour.

Production-like .env example

The following .env illustrates a setup pointing at dedicated MinIO and Redis hosts with non-default credentials, running the strategy runner in live mode:
.env (production example)
# MinIO on a dedicated host
CC_MINIO_ENDPOINT=minio.internal.example.com
CC_MINIO_PORT=9000
CC_MINIO_ACCESSKEY=prod-access-key
CC_MINIO_SECRETKEY=prod-secret-key-change-me

# Redis on a dedicated host
CC_REDIS_HOST=redis.internal.example.com
CC_REDIS_PORT=6379
CC_REDIS_USER=default
CC_REDIS_PASSWORD=strong-redis-password-change-me
Then start the container with:
MODE=live ENTRY=1 UI=1 STRATEGY_FILE=./build/index.cjs docker-compose up -d

The default credentials (minioadmin / minioadmin for MinIO, mysecurepassword for Redis) are committed to the public repository and are widely known. Always rotate them before exposing either service on a non-loopback interface. Update both the Compose service definitions (docker/minio/docker-compose.yaml, docker/redis/docker-compose.yaml) and the corresponding variables in .env at the same time.
The .env.example file ships with CC_MINIO_ENDPOINT=host.docker.internal and CC_REDIS_HOST=host.docker.internal — the correct values for containerised runs. If you run backtest-kit directly on the host with npm run start, replace them with loopback addresses: CC_MINIO_ENDPOINT=localhost (the code default in src/config/params.ts) and CC_REDIS_HOST=127.0.0.1 (also the code default). Both values differ from host.docker.internal because that hostname is only resolvable from within a Docker container; the host process must use the loopback address directly.

Build docs developers (and LLMs) love