Daniel Espen | 5ead0f5 | 2020-06-08 13:44:31 +0200 | [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 |
Daniel Espen | 5ead0f5 | 2020-06-08 13:44:31 +0200 | [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" |