Created
November 3, 2017 07:39
-
-
Save idoshamun/370f19c45832281b68b4e3cfc6f8536d to your computer and use it in GitHub Desktop.
Dockerizing Scala Application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// No need to run tests while building jar | |
test in assembly := {} | |
// Simple and constant jar name | |
assemblyJarName in assembly := s"app-assembly.jar" | |
// Merge strategy for assembling conflicts | |
assemblyMergeStrategy in assembly := { | |
case PathList("reference.conf") => MergeStrategy.concat | |
case PathList("META-INF", "MANIFEST.MF") => MergeStrategy.discard | |
case _ => MergeStrategy.first | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM openjdk:8-jre-alpine | |
RUN mkdir -p /opt/app | |
WORKDIR /opt/app | |
COPY ./run_jar.sh ./app-assembly.jar ./ | |
ENTRYPOINT ["./run_jar.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sbt-assembly for "fat jars" | |
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
java $* -jar app-assembly.jar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment