Modify sme invoker to discover the endpoints by itself
[nonrtric.git] / sample-services / hello-world-sme-invoker / Dockerfile
1 #==================================================================================
2 #   Copyright (C) 2024: OpenInfra Foundation Europe
3 #
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
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
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.
15 #
16 #==================================================================================
17
18
19 # Use Maven image with OpenJDK 17 for the build stage
20 FROM maven:3.8.5-openjdk-17 AS maven_build
21
22 # Copy Maven project files
23 COPY pom.xml /tmp/
24 COPY src /tmp/src/
25
26 # Set working directory
27 WORKDIR /tmp/
28
29 # Build the Maven project
30 RUN mvn package
31
32 # Use a separate image with OpenJDK 17 for the runtime stage
33 FROM openjdk:17-jdk-slim
34
35 # Expose port 8080
36 EXPOSE 8080
37
38 # Set the working directory
39 WORKDIR /app
40
41 # Copy the JAR file from the maven_build stage to the runtime stage
42 COPY --from=maven_build /tmp/target/hello-world-sme-invoker-0.1.0.jar /app/hello-world-sme-invoker-0.1.0.jar
43
44 # Command to run the application
45 CMD ["java", "-jar", "hello-world-sme-invoker-0.1.0.jar"]