Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publishing changes #24

Merged
merged 6 commits into from
Oct 28, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Docker works locally.
  • Loading branch information
markiantorno committed Oct 27, 2020
commit 007989a36ebb5da164706dc39f5afef15cdcb736
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ RUN chown -R $APPLICATION_USER /app
USER $APPLICATION_USER

# These lines copy the packaged application into the Docker image and sets the working directory to where it was copied.
COPY ./build/libs/my-application.jar /app/my-application.jar
COPY ./build/libs/validator-wrapper-jvm-0.0.1.jar /app/validator-wrapper.jar
WORKDIR /app

EXPOSE 8080

# The last line instructs Docker to run java with G10s GC, 4G of memory and the packaged application.
CMD ["java", "-server", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseCGroupMemoryLimitForHeap", "-XX:InitialRAMFraction=2", "-XX:MinRAMFraction=2", "-XX:MaxRAMFraction=2", "-XX:+UseG1GC", "-XX:MaxGCPauseMillis=100", "-XX:+UseStringDeduplication", "-jar", "my-application.jar"]
CMD ["java", "-server", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseCGroupMemoryLimitForHeap", "-XX:InitialRAMFraction=2", "-XX:MinRAMFraction=2", "-XX:MaxRAMFraction=2", "-XX:+UseG1GC", "-XX:MaxGCPauseMillis=100", "-XX:+UseStringDeduplication", "-jar", "validator-wrapper.jar", "-startServer"]
19 changes: 13 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
kotlin("multiplatform") version "1.4.0"
kotlin("plugin.serialization") version "1.4.0"
id("org.hidetake.ssh") version "2.10.1"
id ("org.openjfx.javafxplugin") version "0.0.8"
id("org.openjfx.javafxplugin") version "0.0.8"
application
}
group = "org.hl7.fhir"
Expand Down Expand Up @@ -37,12 +37,14 @@ repositories {

kotlin {
jvm {
compilations.all {
kotlinOptions.jvmTarget = "1.8"
compilations {
all {
kotlinOptions.jvmTarget = "1.8"
}
}
withJava()
}
js(){
js() {
useCommonJs()
browser {
binaries.executable()
Expand All @@ -66,8 +68,8 @@ kotlin {
implementation(kotlin("stdlib-common"))
implementation("com.fasterxml.jackson.core:jackson-databind:${property("jacksonVersion")}")

implementation ("org.jetbrains.kotlinx:kotlinx-serialization-core:${property("serializationVersion")}")
implementation ("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:${property("serializationVersion")}")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:${property("serializationVersion")}")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:${property("serializationVersion")}")
implementation("ca.uhn.hapi.fhir:org.hl7.fhir.validation:${property("fhirCoreVersion")}")
implementation("ca.uhn.hapi.fhir:org.hl7.fhir.utilities:${property("fhirCoreVersion")}")
}
Expand Down Expand Up @@ -133,16 +135,20 @@ kotlin {
}
}
}

javafx {
version = "14"
modules("javafx.controls", "javafx.graphics", "javafx.web")
}

application {
mainClassName = "ServerKt"
}

tasks.getByName<KotlinWebpack>("jsBrowserProductionWebpack") {
outputFileName = "output.js"
}

tasks.getByName<Jar>("jvmJar") {
manifest {
attributes["Main-Class"] = "ServerKt"
Expand All @@ -151,6 +157,7 @@ tasks.getByName<Jar>("jvmJar") {
val jsBrowserProductionWebpack = tasks.getByName<KotlinWebpack>("jsBrowserProductionWebpack")
from(File(jsBrowserProductionWebpack.destinationDirectory, jsBrowserProductionWebpack.outputFileName))
}

tasks.getByName<JavaExec>("run") {
dependsOn(tasks.getByName<Jar>("jvmJar"))
classpath(tasks.getByName<Jar>("jvmJar"))
Expand Down
2 changes: 1 addition & 1 deletion src/jvmMain/resources/application.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ktor {
deployment {
dev {
host = "localhost"
host = "0.0.0.0"
port = 8080
}
prod {
Expand Down