-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
86 lines (68 loc) · 2.56 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import sbtassembly.MergeStrategy
name := "metamorphosis"
organization := "br.com.diegosilva"
version := "0.0.1"
scalaVersion := "2.13.4"
enablePlugins(DockerPlugin)
resolvers += Resolver.mavenLocal
libraryDependencies ++= {
val akka = "com.typesafe.akka"
val akkaV = "2.6.16"
val akkaHttpV = "10.2.6"
val circeVersion = "0.14.1"
val slickVersion = "3.3.3"
Seq(
akka %% "akka-actor-typed" % akkaV,
akka %% "akka-stream-typed" % akkaV,
akka %% "akka-cluster-tools" % akkaV,
akka %% "akka-cluster-sharding-typed" % akkaV,
akka %% "akka-serialization-jackson" % akkaV,
akka %% "akka-persistence-typed" % akkaV,
akka %% "akka-persistence-query" % akkaV,
"com.lightbend.akka" %% "akka-persistence-jdbc" % "5.0.4",
"com.typesafe.slick" %% "slick" % slickVersion,
"com.typesafe.slick" %% "slick-hikaricp" % slickVersion,
"com.github.tminglei" %% "slick-pg" % "0.19.7",
"com.github.tminglei" %% "slick-pg_circe-json" % "0.19.7",
"org.flywaydb" % "flyway-core" % "7.15.0",
"org.postgresql" % "postgresql" % "42.2.24",
akka %% "akka-slf4j" % akkaV,
akka %% "akka-http" % akkaHttpV,
"ch.qos.logback" % "logback-classic" % "1.2.3",
"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-generic" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion,
"de.heikoseeberger" %% "akka-http-circe" % "1.38.2",
"io.nats" % "java-nats-streaming" % "2.2.3",
"org.codehaus.groovy" % "groovy-all" % "3.0.9" pomOnly()
)
}
assemblyJarName in assembly := "server.jar"
assemblyMergeStrategy in assembly := {
case PathList("META-INF", xs @ _*) =>
(xs map {_.toLowerCase}) match {
case ("manifest.mf" :: Nil) | ("index.list" :: Nil) | ("dependencies" :: Nil) =>
MergeStrategy.discard
case ps @ (x :: xs) if ps.last.endsWith(".sf") || ps.last.endsWith(".dsa") =>
MergeStrategy.discard
case "plexus" :: xs =>
MergeStrategy.discard
case "services" :: xs =>
MergeStrategy.filterDistinctLines
case ("spring.schemas" :: Nil) | ("spring.handlers" :: Nil) =>
MergeStrategy.filterDistinctLines
case _ => MergeStrategy.discard
}
case PathList("reference.conf") => MergeStrategy.concat
case _ => MergeStrategy.first
}
dockerfile in docker := {
val artifact: File = assembly.value
val artifactTargetPath = s"/app/${artifact.name}"
new Dockerfile {
from("openjdk:11-jre")
add(artifact, artifactTargetPath)
entryPoint("java", "-jar", artifactTargetPath)
}
}
buildOptions in docker := BuildOptions(cache = false)