Running Mocko
Docker Images
Mocko ships three images: an all-in-one standalone image, and a split pair with the mock server and the control panel as separate containers. This page explains what each contains and how to choose.
The three images
ghcr.io/mocko-app/standalonewraps the CLI: mock server, control panel, and file watching in one container. Ports 8080 (mocks) and 6625 (UI), mocks mounted at/var/mocks.ghcr.io/mocko-app/coreis just the mock server, the component that receives your traffic. Port 8080.ghcr.io/mocko-app/controlis just the control panel. Port 6625. It talks to core through a shared secret and stores its state in Redis.
When each fits
Standalone is the right default for local work and simple single-container setups: nothing to wire, watch mode on, UI included. It is what the Docker Compose page uses.
Core and control split is for shared deployments. The two components have different lives: core sits on the hot path of your test traffic and may need several replicas, while control serves a handful of developers and one replica is plenty. Splitting them lets you scale, restart, and secure each independently, and drop control entirely where nobody needs a UI.
Running the split pair
Core and control connect through two things: a Redis both can reach, and a shared deploy secret that lets control push changes to core. The essential wiring, shown as plain docker run commands:
DEPLOY_SECRETon core andMOCKO_DEPLOY_SECRETon control must match; it authenticates control's internal calls to core.DEPLOY_ENDPOINT_ENABLED=trueopens the internal endpoint control uses to apply changes. Leave it unset on a core that runs without control.- Both point at the same Redis. The split setup effectively requires Redis: it is where deployed mocks, hosts, and flags live, and how multiple core replicas stay consistent.
Core reads the same environment variables in any setup, so proxying (PROXY_BASE-URI), timeouts, and auth are configured identically here and in the standalone image.
File mocks in images
Core loads .hcl files from /var/mocks. You can mount them, but for shared environments baking them in wins: the image becomes a versioned, rollback-able artifact of your team's mock behavior.
FROM ghcr.io/mocko-app/core:2
COPY mocks/ /var/mocks/Behavior details
- Health checks: core answers on
GET /__mocko__/health, control onGET /api/health. Point container or orchestrator probes there. - On shared instances, consider
MANAGEMENT_AUTH_MODEto require a bearer token on management routes; see the configuration reference. - The
2tag on all three images always points at the latest Mocko v2 release, with no breaking changes within v2. Use the same tag across core and control.
Next
On Kubernetes, skip the manual wiring. Continue to Kubernetes with Helm.