Ashfaqul Haque | b9fadc6 | 2020-03-13 15:46:42 +0100 | [diff] [blame] | 1 | # Add java runtime environment for execution |
| 2 | FROM java:8-jdk-alpine |
| 3 | |
| 4 | # Copy built jar to image using the jar name specified in the pom.xml (JAR_FILE) |
| 5 | ARG JAR_FILE |
| 6 | COPY target/${JAR_FILE} /usr/share/basyxExecutable.jar |
| 7 | COPY target/lib /usr/share/lib |
Constantin Ziesche | 02817f1 | 2020-08-04 21:40:43 +0200 | [diff] [blame^] | 8 | COPY src/main/resources/context.properties /usr/share/context.properties |
Ashfaqul Haque | b9fadc6 | 2020-03-13 15:46:42 +0100 | [diff] [blame] | 9 | |
| 10 | # Expose the appropriate port. In case of Tomcat, this is 8080. |
| 11 | ARG PORT |
| 12 | EXPOSE ${PORT} |
| 13 | |
| 14 | # Start the jar |
Constantin Ziesche | 02817f1 | 2020-08-04 21:40:43 +0200 | [diff] [blame^] | 15 | CMD java -jar "/usr/share/basyxExecutable.jar" "/usr/share/context.properties" |