The project ships three Docker Compose files: one for the MinIO object store, one for Redis, and one for the main backtest-kit container that bundles your compiled strategy with the backtest-kit runtime. MinIO and Redis can be started independently (or reused from an existing deployment) — the main container connects to them via environment variables rather than Docker-managed networking, usingDocumentation 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.
host.docker.internal to cross the container-to-host boundary.
MinIO (docker/minio/docker-compose.yaml)
MinIO acts as the S3-compatible source of truth for all 16 persist adapters. Every candle, signal, log entry, and strategy snapshot is stored as an object in the backtest-kit bucket, automatically created on first start.
docker/minio/docker-compose.yaml
| Property | Value | Notes |
|---|---|---|
| Image | tripolskypetr/minio:2022 | Pre-configured MinIO build with bucket auto-creation support |
| S3 API port | 9000 | Used by minio.Client in src/config/minio.ts |
| Console port | 9001 | Browser-based management UI |
| Volume | ./minio_data:/data | All object data is written here; survives container restarts |
MINIO_ROOT_USER | minioadmin | Must match CC_MINIO_ACCESSKEY in .env |
MINIO_ROOT_PASSWORD | minioadmin | Must match CC_MINIO_SECRETKEY in .env |
MINIO_DEFAULT_BUCKETS | backtest-kit | Bucket is created automatically on first start |
| Restart policy | always | Container restarts on crash or host reboot |
minioadmin / minioadmin (or whatever credentials you set in the compose file). You should see the backtest-kit bucket listed under Buckets.
Redis (docker/redis/docker-compose.yaml)
Redis serves as the time-ordered index for the three entity types that need newest-first listings (Log, Notification, Storage). It does not store object bodies — only lightweight per-minute sets of object names that allow listNewest to walk backwards through time in O(limit) without scanning the S3 bucket.
docker/redis/docker-compose.yaml
| Property | Value | Notes |
|---|---|---|
| Image | redis:7.4.1 | Official Redis image, pinned to a specific version |
| Port | 6379 | Standard Redis port; must match CC_REDIS_PORT in .env |
| Password | mysecurepassword | Set via --requirepass; must match CC_REDIS_PASSWORD in .env |
| Volume | ./redis_data:/data | Persists Redis RDB / AOF snapshots across restarts |
| Restart policy | always | Container restarts on crash or host reboot |
Redis is started with
--requirepass mysecurepassword in the command array. The REDIS_PASSWORD environment variable shown in the compose file is informational only — the actual authentication is enforced by the --requirepass flag passed to redis-server.Main backtest-kit container (docker-compose.yaml)
The root docker-compose.yaml runs the backtest-kit runtime with your compiled strategy. It mounts the entire project directory as /workspace inside the container, so any ./build/index.cjs you produce on the host is immediately available to the entrypoint without a rebuild.
docker-compose.yaml
| Property | Value | Notes |
|---|---|---|
| Image | tripolskypetr/backtest-kit | Official backtest-kit container image |
| Platform | linux/amd64 | Explicit platform pin for Apple Silicon / ARM hosts |
| Web UI port | 60050 | Exposed when UI=1; open http://localhost:60050 |
| Volume mount | ./:/workspace | Full project directory available inside the container |
| Working dir | /workspace | All relative paths (e.g. ./build/index.cjs) resolve here |
env_file | .env | MinIO/Redis credentials loaded from .env at the project root |
| Health check | /api/v1/health/health_check | Polled every 30s; container marked unhealthy after 3 failures |
| Restart policy | unless-stopped | Restarts on crash but not when explicitly stopped with docker-compose down |
Deploy commands
PassMODE, ENTRY, and STRATEGY_FILE as environment variables on the command line. The UI=1 flag starts the web dashboard on port 60050.
npm scripts
Thepackage.json includes convenience scripts that wrap the full deploy lifecycle:
Health check
The container exposes a health endpoint that Docker polls automatically:Networking
The main backtest-kit container does not share a Docker network with the MinIO and Redis containers. Instead, it reaches them on the host machine via thehost.docker.internal hostname:
/etc/hosts entry inside the backtest-kit container that resolves host.docker.internal to the host’s gateway IP (the Docker bridge interface). The .env file then points the adapters at that address:
| Platform | host.docker.internal availability |
|---|---|
| Docker Desktop (macOS) | Injected automatically — extra_hosts entry is redundant but harmless |
| Docker Desktop (Windows) | Injected automatically — same as macOS |
| Docker Engine on Linux | Requires the extra_hosts: host-gateway entry; not injected by default |
.env:
extra_hosts entry is still harmless in this case — the container simply won’t use host.docker.internal for infrastructure connections.
Volume persistenceBoth
minio_data (in docker/minio/) and redis_data (in docker/redis/) are bind-mount volumes — data is written to the host filesystem under the respective docker/minio/minio_data and docker/redis/redis_data directories. This means all object data and Redis snapshots survive container restarts and upgrades. To wipe state and start fresh, stop the containers and delete the data directories manually before restarting.