Skip to content

Commit 2362b1b

Browse files
committed
Added dockerfile for java app
1 parent 736f775 commit 2362b1b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

docker/app/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM eclipse-temurin:21-jdk-alpine
2+
WORKDIR /app
3+
EXPOSE 8082
4+
COPY my.jar my.jar
5+
ENV RUN_FROM_JAR true
6+
ENTRYPOINT ["java","-jar","my.jar"]

src/main/kotlin/no/java/moresleep/Application.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ private fun createHandler(): Handler {
4040

4141
if (Setup.readBoolValue(SetupValue.RUN_FROM_JAR)) {
4242
// Prod ie running from jar
43+
println("Running from jar")
4344
webAppContext.baseResource = Resource.newClassPathResource("webapp", true, false)
4445
} else {
4546
// Development ie running in ide
47+
println("Running from local filesystem")
4648
webAppContext.resourceBase = "src/main/resources/webapp"
4749
}
4850

0 commit comments

Comments
 (0)