Installation
Mimic ships as a Docker image. That’s the recommended way to run it for almost every use case. Building from source is supported but only needed if you’re contributing to Mimic itself.
Docker (recommended)
Section titled “Docker (recommended)”docker run -d \ --name mimic \ -p 8080:8080 \ -v $(pwd)/mocks:/app/mocks:ro \ ragilhadi/mimic:latestCreate a docker-compose.yml:
services: mimic: image: ragilhadi/mimic:latest container_name: mimic ports: - "8080:8080" volumes: - ./mocks:/app/mocks:ro environment: - PORT=8080 - RUST_LOG=info restart: unless-stoppedThen run:
docker compose up -dAvailable tags
Section titled “Available tags”# Latest stabledocker pull ragilhadi/mimic:latest
# Pin to a specific versiondocker pull ragilhadi/mimic:v1.0.0Images are published for linux/amd64 and linux/arm64, so they run natively on Apple Silicon, Raspberry Pi, and most cloud VMs.
Building from source
Section titled “Building from source”You only need this path if you’re contributing to Mimic or you want a custom build.
Prerequisites
Section titled “Prerequisites”- Rust 1.70 or later — install via rustup
make(optional, for convenience commands)
Build steps
Section titled “Build steps”-
Clone the repository.
Terminal window git clone https://github.com/ragilhadi/mimic.gitcd mimic -
Build a release binary.
Terminal window cargo build --releaseThe compiled binary will be at
target/release/mimic. -
Run it.
Terminal window ./target/release/mimicBy default Mimic reads mocks from
./mocksand listens on port 8080.
Development with hot rebuild
Section titled “Development with hot rebuild”For iterating on the Mimic codebase itself:
make dev # run in debug mode with verbose loggingmake watch # auto-rebuild and restart on file changesmake test # run the test suiteSee the Makefile commands in the repo for the full list.
Verifying your installation
Section titled “Verifying your installation”Whichever method you used, confirm Mimic is up:
curl http://localhost:8080/healthYou should get:
{ "status": "healthy", "mocks_loaded": 0, "service": "mimic"}If mocks_loaded is 0 and you weren’t expecting it to be, check that your mocks folder is mounted correctly and contains valid JSON files. See Mock Files for the file format.