The full Docker deployment bundles the strategy runner inside the officialDocumentation 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.
tripolskypetr/backtest-kit container image alongside the MinIO and Redis infrastructure services. Rather than running the Node.js process directly on the host, the container mounts the project root as /workspace, reads its configuration from .env, and executes the compiled strategy bundle — giving you a portable, restart-safe deployment with a built-in health check. MinIO and Redis continue to run as separate containers (started via their own Compose files) and are reachable from the runner container through the host.docker.internal gateway.
The main docker-compose.yaml
The root-leveldocker-compose.yaml defines the strategy runner container. It is intentionally decoupled from the MinIO and Redis Compose files so that infrastructure and application lifecycle can be managed independently.
docker-compose.yaml
Key fields explained
image: tripolskypetr/backtest-kit
The pre-built Docker image that ships the @backtest-kit/cli entrypoint, Node.js runtime, and all peer dependencies. Your strategy code is not baked in — it is injected at runtime via the volume mount.
platform: linux/amd64
Pins the platform to linux/amd64 for consistent behaviour across Apple Silicon and other ARM hosts. Docker Desktop and most CI runners will transparently emulate this via Rosetta 2 or QEMU.
extra_hosts: host.docker.internal:host-gateway
Injects a /etc/hosts entry inside the container that resolves host.docker.internal to the Docker host’s gateway IP. This is what allows the strategy runner to reach MinIO on port 9000 and Redis on port 6379 using the host.docker.internal endpoints set in .env — without any custom Docker networks or service linking.
ports: 60050:60050
Exposes the web UI served by @backtest-kit/ui on port 60050. Open http://localhost:60050 in a browser once the container is healthy to monitor running strategies, inspect signals, and review logs.
volumes: ./:/workspace
Mounts the entire project root into /workspace inside the container. Combined with working_dir: /workspace, this means the container can read your compiled ./build/index.cjs bundle, the .env file, and any supporting assets without a rebuild of the Docker image.
env_file: .env
Loads CC_MINIO_ENDPOINT, CC_MINIO_PORT, CC_MINIO_ACCESSKEY, CC_MINIO_SECRETKEY, CC_REDIS_HOST, CC_REDIS_PORT, CC_REDIS_USER, and CC_REDIS_PASSWORD from the project-root .env file into the container environment.
environment:
The explicit variable list (e.g. MODE, STRATEGY_FILE, ENTRY, UI) forwards values from the shell environment that invokes docker-compose up. This is how one-liner commands like MODE=backtest ENTRY=1 ... docker-compose up -d propagate runtime flags into the container without modifying .env.
healthcheck
Polls http://localhost:60050/api/v1/health/health_check every 30 seconds with a 10-second timeout and 3 retries. The container transitions from starting to healthy once the UI server is accepting requests. Docker’s restart: unless-stopped policy will restart a container that fails health checks repeatedly.
Running modes
Start the services (MinIO and Redis) first if they are not already running:npm script shortcuts
Thepackage.json provides two convenience scripts that wrap the Docker Compose commands:
npm run start:docker runs npm run build first (invoking Rollup) before calling docker-compose up -d, so you cannot accidentally start the container with a stale bundle. npm run stop:docker calls docker-compose down, which stops and removes the container but leaves the MinIO and Redis containers untouched.
Viewing logs
Stream live container output while the runner is active:Ctrl+C to detach from the log stream without stopping the container.
Build step
The container reads the compiled strategy bundle from./build/index.cjs on the host filesystem (via the volume mount). You must produce this file before starting the container:
rollup.config and outputs ./build/index.cjs. The start:docker npm script runs the build automatically; if you invoke docker-compose up directly, make sure the build is up to date.
The container reaches MinIO and Redis on the host via
host.docker.internal, not via Docker service names. This is why the extra_hosts line is required in the Compose file, and why .env uses host.docker.internal as the default for CC_MINIO_ENDPOINT and CC_REDIS_HOST. If you later migrate MinIO or Redis into the same Docker Compose file as the runner and put them on a shared network, you can switch those variables to the Docker service names instead.