hey! when creating my fat-jar and then docker-imag...
# ktor
l
hey! when creating my fat-jar and then docker-images the way the documentation suggests, i'm also including the full application.conf and all resources in my fat-jar. Is there a way to build my server such that i can mount these config-files in a volume, making them accessible and changable without needing to rebuild the server?
d
Yes.
l
you can use a system prop to force the config library to use a specific file:
Copy code
-Dconfig.file=path/to/config-file
d
You can use docker-compose, specifying the files to map in the
docker-compose.yml
file:
Copy code
version: '3'
services:
  my-service:
    image: my-image
    build: 
      context: .
      dockerfile: path/to/my-service.Dockerfile
    volumes:
      ${PWD}/application.conf:/app/application.conf
l
@Dico thanks, i know how to mount files into my container, but the problem was that i didn't know how to tell ktor where to look for it's config file. Luke's solution works, thanks!
d
in that case your question seems very misleading.
l
is it? i'm asking how to "build my server" such that i don't "includ[e] the full application.conf [...] in my fat-jar" but instead "mount these config-files in a volume",... thats pretty clear, isn't it?
d
okay I see, the default is for the conf to be packed into the jar... my bad
l
no problem ;D