I have created this Dockerfile
and copied it into /my/project/wiremock directory, based on the samples from https://github.com/rodolpheche/wiremock-docker:
FROM openjdk:8-jre-alpine
ENV WIREMOCK_VERSION 2.27.1
RUN apk add --update openssl
# fix "No Server ALPNProcessors" when using https
RUN apk add --update libc6-compat
RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2
# grab su-exec for easy step-down from root
# and bash
RUN apk add --no-cache 'su-exec>=0.2' bash
# grab wiremock standalone jar
RUN mkdir -p /var/wiremock/lib/ \
&& wget https://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-jre8-
standalone/$WIREMOCK_VERSION/wiremock-jre8-standalone-$WIREMOCK_VERSION.jar \
-O /var/wiremock/lib/wiremock-jre8-standalone.jar
WORKDIR /home/wiremock
EXPOSE 7070 7443
CMD java $JAVA_OPTS -cp /var/wiremock/lib/*:/var/wiremock/extensions/*
com.github.tomakehurst.wiremock.standalone.WireMockServerRunner
Then I created the following docker-compose.yml
file inside /my/project/ directory
version: '3'
services:
wiremock:
image: rodolpheche/wiremock:latest
container_name: miplata-wiremock-local
build: ./wiremock/.
ports:
- "7070:8080"
- "7443:8443"
volumes:
- ./wiremock/stubs:/home/wiremock
Children directories inside /my/project/wiremock/stubs are mappings and __files.
When I execute docker-compose up
, the docker container works and I can make some requests that work fine. But my issue is, that changes inside the stubs directory are not refreshed automatically and then I need to restart the container every time that I create a new wiremock stub or update an existing one.
Do you have any idea if I am doing something wrong? It would be nice to continue working without restarting the container.
Thanks!!!!