From 109fe2c4385ecb9a23615cefe8a63a95636347c4 Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Tue, 12 Sep 2017 23:44:32 +0200 Subject: [PATCH] Added WebWolf to Docker --- webgoat-server/pom.xml | 5 +++++ webgoat-server/src/main/docker/Dockerfile | 9 +++++---- webgoat-server/src/main/docker/startup.sh | 6 ++++++ 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 webgoat-server/src/main/docker/startup.sh diff --git a/webgoat-server/pom.xml b/webgoat-server/pom.xml index 6a75fb259a..1f1bce4b22 100644 --- a/webgoat-server/pom.xml +++ b/webgoat-server/pom.xml @@ -36,6 +36,11 @@ ${project.build.directory} ${project.build.finalName}.jar + + / + ${project.basedir}/../webwolf/target + webwolf-${project.version}.jar + diff --git a/webgoat-server/src/main/docker/Dockerfile b/webgoat-server/src/main/docker/Dockerfile index fcd589685e..392c0c9919 100644 --- a/webgoat-server/src/main/docker/Dockerfile +++ b/webgoat-server/src/main/docker/Dockerfile @@ -3,9 +3,10 @@ FROM openjdk:8-jre RUN useradd --home-dir /home/webgoat --create-home -U webgoat USER webgoat - -RUN mkdir -p /home/webgoat/.embedmongo/linux -RUN curl -o /home/webgoat/.embedmongo/linux/mongodb-linux-x86_64-3.2.2.tgz https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.2.tgz RUN cd /home/webgoat/; mkdir -p .webgoat COPY webgoat-server-8.0-SNAPSHOT.jar /home/webgoat/webgoat.jar -ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/home/webgoat/webgoat.jar"] \ No newline at end of file +COPY webwolf-8.0-SNAPSHOT.jar /home/webgoat/webwolf.jar +COPY startup.sh /home/webgoat/startup.sh +RUN sudo chmod +x /home/webgoat/startup.sh + +CMD ["/home/webgoat/startup.sh"] \ No newline at end of file diff --git a/webgoat-server/src/main/docker/startup.sh b/webgoat-server/src/main/docker/startup.sh new file mode 100644 index 0000000000..d329b2d42e --- /dev/null +++ b/webgoat-server/src/main/docker/startup.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +java -Djava.security.egd=file:/dev/./urandom -jar /home/webgoat/webgoat.jar & +echo "Waiting for WebGoat to start..." +sleep 20 +java -Djava.security.egd=file:/dev/./urandom -jar /home/webgoat/webwolf.jar