Skip to main content

Documentation Index

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

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

This page documents every environment variable the project reads, grouped by subsystem: MinIO (S3 object storage), Redis (time-ordered index), and CLI / Docker runtime flags passed to the @backtest-kit/cli entrypoint. All variables are optional — sensible defaults are baked into src/config/params.ts — but production deployments should always override credentials and endpoints explicitly via a .env file.

.env.example

Copy this file to .env at the project root and fill in values appropriate for your environment before starting any containers.
.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 variables

These variables are consumed by getMinio() in src/config/minio.ts, which constructs a minio.Client instance pointed at your S3-compatible endpoint. SSL is disabled by default; configure a reverse proxy with TLS termination if you need encrypted transport.
CC_MINIO_ENDPOINT
string
default:"localhost"
The hostname or IP address of the MinIO server. When the backtest-kit process runs inside Docker (via docker-compose.yaml) use host.docker.internal so the container can reach MinIO on the host machine. For a host-node run (Node.js started directly on the machine), use 127.0.0.1 or the loopback address. Override with a remote hostname if MinIO is deployed on a separate server.
CC_MINIO_PORT
number
default:"9000"
The S3 API port exposed by MinIO. The bundled docker/minio/docker-compose.yaml publishes port 9000 on the host. Change this only if your MinIO deployment listens on a non-standard port or sits behind a load balancer on a different port.
CC_MINIO_ACCESSKEY
string
default:"minioadmin"
The MinIO root user / access key ID. This corresponds to MINIO_ROOT_USER in the MinIO container’s environment. The default value matches the bundled docker/minio/docker-compose.yaml — change both values together when hardening a production deployment.
CC_MINIO_SECRETKEY
string
default:"minioadmin"
The MinIO root password / secret access key. This corresponds to MINIO_ROOT_PASSWORD in the MinIO container. Treat this as a credential: rotate it, store it in your secrets manager, and never commit it to source control.

Redis variables

These variables are consumed by getRedis() in src/config/redis.ts, which creates a singleton ioredis connection and keeps it alive with a 30-second PING interval. The connection is gracefully closed on SIGINT.
CC_REDIS_HOST
string
default:"127.0.0.1"
The hostname or IP address of the Redis server. Like the MinIO endpoint, use host.docker.internal when the backtest-kit process runs inside Docker and Redis runs on the host, or 127.0.0.1 for a local host-node run.
CC_REDIS_PORT
number
default:"6379"
The Redis TCP port. The bundled docker/redis/docker-compose.yaml publishes the standard Redis port 6379. Change this if your Redis instance uses a custom port or is reached through a proxy.
CC_REDIS_USER
string
default:"default"
The Redis ACL username. Redis 6+ supports multiple users via ACL; the special username default is the built-in superuser and is the correct value for the bundled single-user setup. Adjust this if your Redis deployment uses a named ACL account.
CC_REDIS_PASSWORD
string
default:"mysecurepassword"
The Redis authentication password, passed as requirepass in the bundled Redis container command. This must match the password configured in docker/redis/docker-compose.yaml. Change it for any non-local deployment and store it in a secrets manager.

MongoDB connection string (unused)

CC_MONGO_CONNECTION_STRING is exported from src/config/params.ts as a convenience export but is not consumed anywhere in this project. This MinIO + Redis variant has no MongoDB dependency — the variable exists only because params.ts is shared across multiple backtest-kit variants and the export is harmless when unused.
CC_MONGO_CONNECTION_STRING
string
MongoDB connection URI. Not used by this project. Present in src/config/params.ts for cross-variant compatibility but no adapter, service, or initialisation path reads it. Do not set this variable — it has no effect on the MinIO S3 Docker deployment.

CLI / Docker runtime variables

These variables are forwarded to the @backtest-kit/cli process inside the main docker-compose.yaml container. They map directly to CLI flags — see the backtest-kit CLI reference for the full flag specification. None of them need to be set in .env; they are typically passed on the docker-compose up command line or exported in the shell before running npm scripts.
VariableValues / FormatDescription
MODEbacktest | live | paperSelects the running mode. backtest replays historical candles, live trades with real funds, paper simulates live trading without placing real orders.
STRATEGY_FILEFile path stringPath to the compiled strategy bundle inside the container. Defaults to ./build/index.cjs (relative to /workspace).
ENTRY1Set to 1 to actually start the strategy runner. Maps to the --entry CLI flag; without it the process exits immediately after initialisation.
SYMBOLe.g. BTCUSDTOverrides the trading symbol defined in the strategy file. Useful for running the same compiled bundle against different pairs.
STRATEGYstrategy name stringOverrides the strategy name / identifier in the backtest-kit context.
EXCHANGEexchange name stringOverrides the exchange identifier (e.g. CCXT).
FRAMEframe name stringOverrides the time-frame / candle-window name used by the strategy.
UI1Enables the web UI served on port 60050. Open http://localhost:60050 in your browser after the container is healthy.
TELEGRAM1Enables Telegram notifications. Requires a valid Telegram bot token and chat ID configured separately in the strategy bundle.
VERBOSE1Enables verbose logging — useful for debugging adapter behaviour and network calls.
NO_CACHE1Disables in-memory caching of MinIO and Redis results.
NO_FLUSH1Skips the flush / clear step that normally runs once on startup before a backtest. Use this to resume an interrupted run without wiping previous results.
host.docker.internal vs 127.0.0.1The address you use for CC_MINIO_ENDPOINT and CC_REDIS_HOST depends on where the backtest-kit process runs:
  • Inside Docker (running via docker-compose.yaml): use host.docker.internal. The main docker-compose.yaml adds an extra_hosts entry — host.docker.internal:host-gateway — that maps this hostname to the Docker host’s gateway IP. On macOS and Windows, Docker Desktop provides this mapping automatically even without the extra_hosts entry. On Linux, the explicit host-gateway mapping in extra_hosts is required because the OS does not inject the hostname by default.
  • Host-node run (Node.js started directly on the machine, not inside a container): use 127.0.0.1. The default values in src/config/params.ts assume this case, so no .env override is needed for a purely local setup.
If MinIO or Redis run on a remote host, set the variables to the remote hostname or IP regardless of where backtest-kit itself runs.
Production secret hygieneNever commit your .env file to source control. Add .env to .gitignore and use a dedicated secrets manager (AWS Secrets Manager, HashiCorp Vault, Docker Swarm secrets, or Kubernetes Secrets) to inject credentials at runtime. The .env.example file in the repository contains only placeholder values and is safe to commit.

Build docs developers (and LLMs) love