This post is related to this but none of the solutions worked.
Context
I am trying to run a Scala application using the Play Framework in production using Docker.
Running the container throws a Bad root server path: /opt/docker/-Dconfig.resource=/opt/docker/conf/production.conf
and stops.
Steps to build and run the docker container:
build.sbt
...
Docker / version := sys.env.getOrElse("BUILD_NUMBER", "0")
Docker / daemonUserUid := None
Docker / daemonUser := "daemon"
dockerExposedPorts := Seq(9000)
dockerBaseImage := "openjdk:8-jre-alpine"
dockerUpdateLatest := true
dockerEntrypoint := Seq("/opt/docker/bin/play-scala-seed", "-Dconfig.resource=/opt/docker/conf/production.conf")
sbt "Docker / publishLocal"
Produces the following Dockerfile:
FROM openjdk:8-jre-alpine
LABEL MAINTAINER="[email protected]
WORKDIR /opt/docker
COPY --chown=daemon:root opt /opt
EXPOSE 9000
USER daemon
ENTRYPOINT ["/opt/docker/bin/play-scala-seed", "-Dconfig.resource=/opt/docker/conf/production.conf"]
CMD []
docker run --rm -p 9000:9000 playground-api
/opt/docker/bin/play-scala-seed: line 99: is_cygwin: not found
Bad root server path: /opt/docker/-Dconfig.resource=/opt/docker/conf/production.conf
As per this link one can ignore the is_cygwin
error message.
What I've tried:
Changing the
dockerEntrypoint
from thebuild.sbt
file to "-Dconfig.resource=/conf/production.conf" or "-Dconfig.resource=production.conf"Putting the -Dconfig.resource to the
docker run
command:docker run ... playground-api -Dconfig.resource=./conf/production.conf
Setup:
sbt 1.7.2, Play Version 2.8.19, Java 1.8.0_362, Ubuntu 22.04.2 LTS
Any help is appreciated, thanks!