-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
66 lines (53 loc) · 2.18 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
scalaVersion := "2.12.1"
name := "highloadcup"
organization := "com.github.nyukhalov"
version := "1.0"
resolvers ++= Seq(
"Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/",
"Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
)
resolvers += Resolver.bintrayRepo("hseeberger", "maven")
libraryDependencies ++= Seq(
"com.typesafe" % "config" % "1.3.1",
"ch.qos.logback" % "logback-classic" % "1.2.3",
"com.typesafe.scala-logging" %% "scala-logging" % "3.7.2",
"com.github.pathikrit" %% "better-files" % "3.0.0",
"joda-time" % "joda-time" % "2.9.9",
"io.circe" %% "circe-core" % "0.8.0",
"io.circe" %% "circe-generic" % "0.8.0",
"io.circe" %% "circe-parser" % "0.8.0",
"org.rapidoid" % "rapidoid-http-fast" % "5.4.2",
"org.rapidoid" % "rapidoid-http-client" % "5.4.2",
"org.specs2" %% "specs2-core" % "3.9.1" % "test",
"org.specs2" %% "specs2-mock" % "3.9.1" % "test"
)
exportJars := true
mainClass in Compile := Option("com.github.nyukhalov.highloadcup.Boot")
enablePlugins(JavaAppPackaging, sbtdocker.DockerPlugin)
dockerfile in docker := {
val appDir: File = stage.value
val targetDir = "/app"
new Dockerfile {
from("frolvlad/alpine-oraclejdk8")
copy(appDir, targetDir)
runRaw(
"""apk update && \
apk upgrade && \
apk add bash
""")
expose(80)
entryPointRaw(s"$targetDir/bin/${executableScriptName.value} -J-Xms3584m -J-Xmx3584m -J-server -J-XX:+UseG1GC -J-XX:hashCode=5 -J-XX:+DisableExplicitGC -J-XX:InitiatingHeapOccupancyPercent=85")
// env("SPARK_BUILD", s"spark-${sparkVersion}-bin-hadoop2.4")
// runRaw("""wget http://d3kbcqa49mib13.cloudfront.net/$SPARK_BUILD.tgz && \
// tar -xvf $SPARK_BUILD.tgz && \
// mv $SPARK_BUILD /spark && \
// rm $SPARK_BUILD.tgz
// """)
// run("mkdir", "-p", "/database")
}
}
// can slow down building image
//buildOptions in docker := BuildOptions(
// cache = false,
// removeIntermediateContainers = BuildOptions.Remove.Always
//)