1 #==================================================================================
2 # Copyright (C) 2023: OpenInfra Foundation Europe
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 # This source code is part of the near-RT RIC (RAN Intelligent Controller)
17 # platform project (RICP).
18 #==================================================================================
21 # Use Maven image with OpenJDK 17 for the build stage
22 FROM maven:3.8.5-openjdk-17 AS maven_build
24 # Copy Maven project files
28 # Set working directory
31 # Build the Maven project
34 # Use a separate image with OpenJDK 17 for the runtime stage
35 FROM openjdk:17-jdk-slim
40 # Set the working directory
43 # Copy the JAR file from the maven_build stage to the runtime stage
44 COPY --from=maven_build /tmp/target/hello-world-0.1.0.jar /app/hello-world-0.1.0.jar
46 # Command to run the application
47 CMD ["java", "-jar", "hello-world-0.1.0.jar"]