Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Dockerfile and Docker compose examples #130

Merged
merged 3 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _docs/response-templating.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ Variable assignment and number helpers are available:

## XPath helpers

Addiionally some helpers are available for working with JSON and XML.
Additionally some helpers are available for working with JSON and XML.

When the incoming request contains XML, the `xPath` helper can be used to extract values or sub documents via an XPath 1.0 expression. For instance, given the XML

Expand Down
30 changes: 30 additions & 0 deletions _docs/standalone/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,33 @@ docker run -it --rm \
wiremock/wiremock \
--extensions org.wiremock.webhooks.Webhooks
```

### Building your own image

Inside the container, the WireMock uses `/home/wiremock` as the root from which it reads the `mappings` and `__files` directories.
This means you can copy your configuration from your host machine into Docker and WireMock will load the stub mappings.

Wiremock utilizes a custom entrypoint script that passes all provided arguments as WireMock startup parameters. To modify the WireMock launch parameters it is recommended to override the entrypoint in your custom Docker image.

```Dockerfile
# Sample Dockerfile
FROM wiremock/wiremock:latest
COPY wiremock /home/wiremock
ENTRYPOINT ["/docker-entrypoint.sh", "--global-response-templating", "--disable-gzip", "--verbose"]
```

### Docker Compose

Configuration in compose file is similar to Dockerfile definition

```YAML
# Sample compose file
version: "3"
services:
wiremock:
image: "wiremock/wiremock:latest"
container_name: my_wiremock
entrypoint: ["/docker-entrypoint.sh", "--global-response-templating", "--disable-gzip", "--verbose"]
```