mirror of
https://github.com/katanemo/plano.git
synced 2026-04-25 08:46:24 +02:00
refactor demos (#398)
This commit is contained in:
parent
2bd61d628c
commit
b3c95a6698
93 changed files with 338 additions and 1042 deletions
18
demos/samples_java/weather_forcecast_service/Dockerfile
Normal file
18
demos/samples_java/weather_forcecast_service/Dockerfile
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Stage 1: Build the application using Maven
|
||||
FROM maven:3.8.7-openjdk-18-slim AS build
|
||||
WORKDIR /app
|
||||
# Copy pom.xml and download dependencies first (caching)
|
||||
COPY pom.xml .
|
||||
RUN mvn dependency:go-offline
|
||||
# Copy the source code and build the application
|
||||
COPY src ./src
|
||||
RUN mvn clean package -DskipTests
|
||||
|
||||
# Stage 2: Run the application using a slim JDK image
|
||||
FROM openjdk:17-jdk-slim
|
||||
WORKDIR /app
|
||||
# Copy the built jar from the previous stage
|
||||
COPY --from=build /app/target/weather-forecast-service-0.0.1-SNAPSHOT.jar app.jar
|
||||
# Expose the port on which the app runs (default Spring Boot is 8080)
|
||||
EXPOSE 8081
|
||||
ENTRYPOINT ["java", "-jar", "app.jar"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue