Adding custom folder to Docker using sbt-native-packager in Play JPA project Adding custom folder to Docker using sbt-native-packager in Play JPA project docker docker

Adding custom folder to Docker using sbt-native-packager in Play JPA project


The playExternalizeResources:= false setting just prevents sbtfrom adding the playExternalizedResources to your mappings in Universal, which are the mappings available for all target package formats including docker.

Your build sbt can be lightenend with the MappingsHelper ( ScalaDocs )

import NativePackagerHelper._mappings in Universal ++= contentOf("conf")

You can also filter the mappings to remove the unwanted files, e.g

import NativePackagerHelper._mappings in Universal ++= contentOf("conf").filter(_.2.contains("persistence.xml")

Hope that helps,Muki


Simply add the files that you want to be mapped inside a universal/conf directory. As a result of this, when you're creating the docker image the files get added to the /opt/docker/conf directory.