Skip to content

Commit 428c715

Browse files
committed
Add dockerfile
1 parent 290cefc commit 428c715

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM eclipse-temurin:21-jre
2+
3+
RUN mkdir -p /opt/app
4+
COPY build/libs/history.jar /opt/app
5+
CMD ["java", "-jar", "/opt/app/history.jar"]

src/main/kotlin/no/java/conf/plugins/Search.kt

+15-8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package no.java.conf.plugins
33
import arrow.core.raise.either
44
import com.jillesvangurp.ktsearch.KtorRestClient
55
import com.jillesvangurp.ktsearch.SearchClient
6+
import io.github.oshai.kotlinlogging.KotlinLogging
67
import io.ktor.server.application.Application
78
import io.ktor.server.application.call
89
import io.ktor.server.request.receiveNullable
@@ -14,19 +15,25 @@ import io.ktor.server.routing.routing
1415
import no.java.conf.model.search.TextSearchRequest
1516
import no.java.conf.service.SearchService
1617

18+
private val logger = KotlinLogging.logger {}
19+
1720
fun searchClient(
1821
host: String,
1922
port: Int,
2023
username: String,
2124
password: String
22-
) = SearchClient(
23-
KtorRestClient(
24-
host = host,
25-
port = port,
26-
user = username,
27-
password = password,
28-
),
29-
)
25+
): SearchClient {
26+
logger.info { "Connection Info: $host:$port with $username" }
27+
28+
return SearchClient(
29+
KtorRestClient(
30+
host = host,
31+
port = port,
32+
user = username,
33+
password = password,
34+
),
35+
)
36+
}
3037

3138
fun Application.searchClient() =
3239
searchClient(

0 commit comments

Comments
 (0)