docker build -t mockdraft:latest .docker run -p 3000:3000 -v $(pwd)/openapi.yaml:/app/specs/openapi.yaml mockdraft:latest# Enable delay
docker run -p 3000:3000 -v $(pwd)/openapi.yaml:/app/specs/openapi.yaml mockdraft:latest start /app/specs/openapi.yaml -p 3000 --delay
# Enable chaos mode
docker run -p 3000:3000 -v $(pwd)/openapi.yaml:/app/specs/openapi.yaml mockdraft:latest start /app/specs/openapi.yaml -p 3000 --chaos
# Enable both
docker run -p 3000:3000 -v $(pwd)/openapi.yaml:/app/specs/openapi.yaml mockdraft:latest start /app/specs/openapi.yaml -p 3000 --delay --chaos
# Custom port
docker run -p 4000:4000 -v $(pwd)/openapi.yaml:/app/specs/openapi.yaml mockdraft:latest start /app/specs/openapi.yaml -p 4000docker-compose updocker-compose up --builddocker-compose up -ddocker-compose downEdit docker-compose.yml and uncomment the command line with --delay and --chaos flags.
The Dockerfile uses a multi-stage build to:
- Builder stage: Installs all dependencies and compiles TypeScript
- Production stage: Only includes production dependencies and compiled code
This results in a smaller final image (~150MB instead of ~300MB).
Mount your OpenAPI specs to /app/specs/:
docker run -v $(pwd)/my-api.yaml:/app/specs/openapi.yaml mockdraft:latestNone required currently. The tool is fully configured via command-line arguments.