Skip to content

Commit

Permalink
add helloworld sample
Browse files Browse the repository at this point in the history
  • Loading branch information
rodolpheche committed Apr 8, 2017
1 parent 19ef316 commit 3c3069e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 11 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ RUN useradd wiremock -m
USER wiremock
WORKDIR /home/wiremock


VOLUME /home/wiremock
EXPOSE 8080 443

Expand Down
26 changes: 16 additions & 10 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,33 @@

## How to use this image

The image include
##### The image include

- `EXPOSE 8080 443` : the wiremock http/https server port.
- `VOLUME /home/wiremock` : the wiremock data storage.
- `EXPOSE 8080 443` : the wiremock http/https server port
- `VOLUME /home/wiremock` : the wiremock data storage

Launch a Wiremock container
##### Launch a Wiremock container

```sh
$ docker run -d -v $PWD/stub:/home/wiremock -p 8080:8080 rodolpheche/wiremock
mkdir stub
docker run -d -v $PWD/stub:/home/wiremock -p 8080:8080 rodolpheche/wiremock
```

> Simply access [http://localhost:8080/__admin](http://localhost:8080/__admin) to check your mappings
> Simply access [http://localhost:8080/__admin](http://localhost:8080/__admin) to display your mappings (empty set)
Launch a Wiremock container with Wiremock arguments
##### Launch a Hello World container

```sh
$ docker run -d -v $PWD:/home/wiremock -p 8080:8080 -e WIREMOCK_ARGS="--verbose" rodolpheche/wiremock
git clone https://github.com/rodolpheche/wiremock-docker.git
docker run -d -v $PWD/wiremock-docker/sample/stub:/home/wiremock -p 8080:8080 rodolpheche/wiremock
```

Stop the container with Wiremock HTTP API
> Access [http://localhost:8080/hello](http://localhost:8080/hello) to show Hello World message
##### Launch a Wiremock container with Wiremock arguments

```sh
$ curl -XPOST http://localhost:8080/__admin/shutdown
docker run -d -v $PWD/stub:/home/wiremock -p 8080:8080 -p 443:443 -e WIREMOCK_ARGS="--verbose --https-port 443" rodolpheche/wiremock
```

> Access [https://localhost/__admin](https://localhost/__admin) to to check https working
3 changes: 3 additions & 0 deletions sample/stub/__files/hello.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"message": "Hello World !"
}
10 changes: 10 additions & 0 deletions sample/stub/mappings/hello.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"request": {
"method": "GET",
"url": "/hello"
},
"response": {
"status": 200,
"bodyFileName": "hello.json"
}
}

0 comments on commit 3c3069e

Please sign in to comment.