- Dockerhub: ysihaoy/scala-play
- Docker image for Scala, Play framework and SBT project with different versions
-
2.12.3-2.6.2-sbt-0.13.15, Dockerfile
-
2.12.2-2.6.0-sbt-0.13.15, Dockerfile
-
2.11.8-2.5.4-sbt-0.13.11, Dockerfile
-
2.11.7-2.4.6-sbt-0.13.8, Dockerfile
-
Choose a image tag, e.g
2.12.3-2.6.2-sbt-0.13.15
is highly recommended instead oflatest
version -
Sample of your minimal project structure
your-play-project
│ build.sbt
│ Dockerfile
│
├───project
| build.properties
| plugins.sbt
|
├───app
│ │ ...
|
└───test
- Sample of your
Dockerfile
should be like:
FROM ysihaoy/scala-play:2.12.2-2.6.0-sbt-0.13.15
# caching dependencies
COPY ["build.sbt", "/tmp/build/"]
COPY ["project/plugins.sbt", "project/build.properties", "/tmp/build/project/"]
RUN cd /tmp/build && \
sbt compile && \
sbt test:compile && \
rm -rf /tmp/build
# copy code
COPY . /root/app/
WORKDIR /root/app
RUN sbt compile && sbt test:compile
EXPOSE 9000
CMD ["sbt"]
In order to have fast CI (continuous integration) build process, sample of your project/build.properties
, project/plugins.sbt
and build.sbt
should be like:
project/build.properties
sbt.version = 0.13.15
project/plugins.sbt
// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.0")
build.sbt
scalaVersion := "2.12.2"