-
Notifications
You must be signed in to change notification settings - Fork 479
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
004fbac
commit f96f204
Showing
3 changed files
with
42 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,24 @@ | ||
FROM tomcat | ||
# Stage 1: Build Stage | ||
FROM openjdk:8 as build | ||
|
||
WORKDIR /app | ||
|
||
# Copy the source code into the Docker image | ||
COPY . . | ||
|
||
RUN apt-get update ; apt-get install maven default-jdk -y ; update-alternatives --config javac | ||
# Install Maven and JDK, then build the project | ||
RUN apt-get update && \ | ||
apt-get install -y maven && \ | ||
mvn clean package | ||
|
||
# Stage 2: Runtime Stage | ||
FROM tomcat:7.0.82 | ||
|
||
# Copy the WAR file built in the previous stage | ||
COPY --from=build /app/target/*.war /usr/local/tomcat/webapps/ | ||
|
||
RUN mvn clean package ; cp target/*.war /usr/local/tomcat/webapps/ | ||
# Copy the pre-prepared tomcat-users.xml to set up user roles | ||
COPY default-tomcat.xml /usr/local/tomcat/conf/tomcat-users.xml | ||
|
||
CMD ["catalina.sh","run"] | ||
# CMD to start Tomcat | ||
CMD ["catalina.sh", "run"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
javavulnlab: | ||
build: . | ||
ports: | ||
- 8080:8080 | ||
links: | ||
- mysql | ||
|
||
mysql: | ||
image: mysql | ||
environment: | ||
- MYSQL_ROOT_PASSWORD=root | ||
services: | ||
jvl: | ||
image: cspf/jvl | ||
build: | ||
dockerfile: ./Dockerfile | ||
context: ./ | ||
ports: | ||
- 8080:8080 | ||
links: | ||
- mysql | ||
|
||
mysql: | ||
image: mysql:5.7 | ||
environment: | ||
MYSQL_ROOT_PASSWORD: root | ||
MYSQL_ROOT_HOST: "%" | ||
MYSQL_DATABASE: abc | ||
command: | ||
- "--default-authentication-plugin=mysql_native_password" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters