setup tests for HelloWorldService
This commit is contained in:
20
Dockerfile
20
Dockerfile
@ -1,6 +1,22 @@
|
||||
# Multi-stage Dockerfile for JAX-WS Hello World Service
|
||||
|
||||
# Stage 1: Build the application
|
||||
# Stage 1: Test the application
|
||||
FROM maven:3.8.6-openjdk-8 AS tester
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy pom.xml and download dependencies (for better caching)
|
||||
COPY pom.xml .
|
||||
RUN mvn dependency:go-offline -B
|
||||
|
||||
# Copy source code
|
||||
COPY src ./src
|
||||
|
||||
# Run tests
|
||||
RUN mvn test
|
||||
|
||||
# Stage 2: Build the application
|
||||
FROM maven:3.8.6-openjdk-8 AS builder
|
||||
|
||||
# Set working directory
|
||||
@ -16,7 +32,7 @@ COPY src ./src
|
||||
# Build the application
|
||||
RUN mvn clean package -DskipTests
|
||||
|
||||
# Stage 2: Run the application
|
||||
# Stage 3: Run the application
|
||||
FROM tomcat:9.0-jdk8
|
||||
|
||||
# Remove default Tomcat applications
|
||||
|
||||
Reference in New Issue
Block a user