diff --git a/build.sbt b/build.sbt index 980c954..afed9ab 100644 --- a/build.sbt +++ b/build.sbt @@ -15,4 +15,9 @@ libraryDependencies ++= Seq( "org.consensusresearch" %% "scorex-transaction" % "1.2.+" ) +//assembly settings +assemblyJarName in assembly := "lagonaki.jar" + +test in assembly := {} + mainClass in assembly := Some("scorex.perma.Application") \ No newline at end of file diff --git a/cli.sh b/cli.sh new file mode 100755 index 0000000..7c45950 --- /dev/null +++ b/cli.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +java -cp target/scala-2.11/lagonaki.jar scorex.api.client.ApiClient diff --git a/docker.sbt b/docker.sbt new file mode 100644 index 0000000..8f8c4c0 --- /dev/null +++ b/docker.sbt @@ -0,0 +1,41 @@ +/* +// dockerize + +enablePlugins(DockerPlugin) + +// Make the docker task depend on the assembly task, +// which generates a fat JAR file +docker <<= docker.dependsOn(sbt.Keys.`package`.in(Compile, packageBin)) + + +dockerfile in docker := { + val jarFile = (assemblyOutputPath in assembly).value + val jarTargetPath = s"/app/${jarFile.name}" + val settingsPath = (baseDirectory in ThisBuild).value / "settings.json" + + new Dockerfile { + from("frolvlad/alpine-oraclejdk8") + // runRaw("apk --update add openjdk7-jre") + // copy compiled jar into the container + run("mkdir", "-p", "/app") + copy(jarFile, jarTargetPath) + // copy settings + copy(settingsPath, "/app/settings.json") + // persist data beyond the lifetime of a container session + run("mkdir", "-p", "/tmp/scorex") + volume("/tmp/scorex") + // run scorex as: + // /usr/bin/java -jar scorex.jar + workDir("/app") + run("/usr/bin/java", "-jar", jarTargetPath) + } +} + +// todo: name image +imageNames in docker := Seq( + ImageName(s"org.consensusresearch/starter") +) + +// todo: can drop cache +// buildOptions in docker := BuildOptions(cache = false) +*/ \ No newline at end of file