The repository ships four Docker Compose files, each targeting a different concern. Three live underDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/backtest-kit/backtest-kit-redis-postgres-pgpool-docker/llms.txt
Use this file to discover all available pages before exploring further.
docker/ and provision the backing services (Pgpool-II cluster, standalone Postgres, and Redis), while the root docker-compose.yaml runs the application container itself. You can mix and match: spin up only the services you need on the host, then run the app locally or via Docker.
Repository File Tree
Pgpool Cluster Compose
Thedocker/pgpool/docker-compose.yaml is the recommended database backend for development and staging. It starts the tripolskypetr/pgpool:latest all-in-one image, which runs one primary PostgreSQL 16 node and two streaming replicas behind a Pgpool-II load balancer — all in a single container.
| Variable | Default | Purpose |
|---|---|---|
POSTGRES_USER | backtest | Application database role — must match src/config/params.ts |
POSTGRES_PASSWORD | mysecurepassword | Password for the application role |
POSTGRES_DB | backtest-pro | Database name the app connects to |
REPL_USER | replicator | Internal role used for streaming replication between nodes |
REPL_PASSWORD | replicatorpass | Password for the replication role |
PGCLUSTER_ROOT | /var/lib/pgcluster | Data directory inside the container where all node data lives |
PGBIN | /usr/local/bin | Directory containing the PostgreSQL binaries |
Standalone Postgres Compose
Thedocker/postgres/docker-compose.yaml starts a plain postgres:16-alpine single node. It is useful for CI pipelines or quick local experiments where you do not need to exercise replication behaviour.
Redis Compose
Thedocker/redis/docker-compose.yaml runs redis:7.4.1 with password authentication enforced via --requirepass. Data is persisted in a named volume so the cache survives container restarts, but a cold start gracefully falls back to PostgreSQL.
The
REDIS_PASSWORD environment variable is informational only — Redis itself reads the password from the --requirepass flag in the command array. Both are set to mysecurepassword to match the application defaults in src/config/params.ts.Main App Compose
The rootdocker-compose.yaml runs the tripolskypetr/backtest-kit application container. It is designed to operate alongside the service containers started above.
extra_hosts: host-gateway
The
host.docker.internal:host-gateway entry maps the special DNS name host.docker.internal to the Docker host’s IP. This allows the app container to reach Postgres and Redis running on the host without knowing the actual IP address.Volume mount: /workspace
The entire project directory is mounted as
/workspace inside the container. The compiled strategy bundle (e.g. ./build/index.cjs) is therefore immediately visible to the running process without a rebuild.Port 60050
The web UI and the
/api/v1/health/health_check endpoint are both served on port 60050. Set UI=1 in your environment to enable the full web dashboard.Healthcheck
Docker polls
http://localhost:60050/api/v1/health/health_check every 30 seconds with a 10-second timeout and 3 retries before marking the container unhealthy.