-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
71 lines (58 loc) · 1.9 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
67
68
69
70
71
name := "scala_kafka_docker"
version := "1.0"
scalaVersion := "2.12.4"
val kafka = "com.typesafe.akka" %% "akka-stream-kafka" % "0.19"
val akka_http = Seq(
"com.typesafe.akka" %% "akka-http" % "10.1.0-RC2",
"com.typesafe.akka" %% "akka-stream" % "2.5.9"
)
val slick = Seq(
"com.typesafe.slick" %% "slick" % "3.2.0",
"org.slf4j" % "slf4j-nop" % "1.6.4",
"com.typesafe.slick" %% "slick-hikaricp" % "3.2.0",
"org.postgresql" % "postgresql" % "42.2.2"
)
val jsonParser = "org.json4s" %% "json4s-jackson" % "3.6.0-M2"
val testLibs = Seq(
"org.scalamock" %% "scalamock" % "4.1.0" % Test,
"org.scalatest" %% "scalatest" % "3.2.0-SNAP10" % Test,
"com.typesafe.akka" %% "akka-testkit" % "2.5.11" % Test,
"com.typesafe.akka" %% "akka-http-testkit" % "10.1.0" % Test,
"org.scalacheck" %% "scalacheck" % "1.13.5" % Test
)
def dockerSettings = Seq(
dockerfile in docker := {
val artifactSource: File = assembly.value
val artifactTargetPath = s"/project/${artifactSource.name}"
val scriptSourceDir = baseDirectory.value / "../script"
val projectDir = "/project/"
new Dockerfile {
from("openjdk:8-jre")
add(artifactSource, artifactTargetPath)
copy(scriptSourceDir, projectDir)
entryPoint(s"/project/start.sh")
cmd(projectDir, s"${name.value}", s"${version.value}")
expose(8080)
}
},
imageNames in docker := Seq(
ImageName(s"${name.value}:latest")
)
)
lazy val sign_up = (project in file("sign_up"))
.enablePlugins(DockerPlugin)
.settings(
libraryDependencies :=
akka_http :+ kafka :+ jsonParser,
dockerSettings
)
lazy val persistance = (project in file("persistance"))
.enablePlugins(DockerPlugin)
.settings(
libraryDependencies :=
slick :+ kafka :+ jsonParser,
dockerSettings
)
lazy val tests = (project in file("tests"))
.dependsOn(sign_up, persistance)
.settings(libraryDependencies := testLibs ++ akka_http)