[dancer-users] Passing environment to dockerized Dancer2

Mikko Johannes Koivunalho mikko.koivunalho at iki.fi
Fri Jun 18 19:42:58 EDT 2021


Dear Dancer users,

I want to run my Dancer2 application in a docker but I want to run the
docker without mounting any local directories and I want to run the same
container in all environments, not compile it separately for different
environments.

Problem:
How do I pass the environment dependent parts of the configuration to
the docker? I cannot use file `config_local.yaml` because then I would
need to copy that file somehow into the container when it starts.

Possible solution:
I would pass parts of the configuration as environment variables, e.g.
/DB_HOST/ and /SITE_URL/, and then apply these over the values in
config.yaml when I am creating the endpoints.

Suggestion:
Change the command `/config/` (or the underlying file reader function)
so that it can transpose environment variables into config strings, e.g.
plugins->database->connections->main->host = '${DB_HOST}'.


-- 
Mikko Koivunalho
[ This message has been signed with PGP. Public key available at request. ]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20210618/d5ee5632/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20210618/d5ee5632/attachment.sig>


More information about the dancer-users mailing list