Docker image
The mock is published as a Docker image that runs the standalone server, exposing the mocked endpoints over HTTP. This is a convenient way to spin up a disposable commercetools API for local development, demos, or integration environments.
Image: labdigital/commercetools-mock-server
Run it
Section titled “Run it”docker run --rm -p 8989:8989 labdigital/commercetools-mock-serverThe container listens on port 8989 by default. Point your commercetools client
at http://localhost:8989.
Environment variables
Section titled “Environment variables”The same variables as the standalone server apply:
| Variable | Default | Effect |
|---|---|---|
HTTP_SERVER_PORT | 8989 (in the image) | Port inside the container. |
ENABLE_LOGGING | false | Enable pretty request logging. |
EXPERIMENTAL_SQLITE_STORAGE | false | Use the SQLite storage backend. |
docker run --rm -p 8989:8989 \ -e ENABLE_LOGGING=true \ labdigital/commercetools-mock-serverdocker compose
Section titled “docker compose”services: commercetools-mock: image: labdigital/commercetools-mock-server:latest ports: - "8989:8989" environment: ENABLE_LOGGING: "true" restart: unless-stoppedImages are tagged per release (semver) with a latest tag tracking the newest
stable release. Pin a specific version for reproducible environments:
docker run --rm -p 8989:8989 labdigital/commercetools-mock-server:4.1.0