Hello, I have a question for server side, applicat...
# server
r
Hello, I have a question for server side, application.yaml works exactly as a .env file for websites? It should be a good approach to gitignore it and then setup it manually in each deployment or is better to have all application-dev.yaml, application-prod.yaml and run it server side with specific config?
k
never have env specific config files/profiles within sources. it belongs to given environment
👍 1
💯 1
a
The best way to provision config to your app depends on your deployment architecture. If you're using containers, your orchestration platform will have tools to inject environment variables into your container. I haven't found a wonderful way to get config into instanced deployments yet. In my system currently, each environment has its own VPC and private DNS, and it calls a
config.cloud.internal
, which points to the env-specific config service to get its config. This is pretty advanced from a networking perspective, but it lends to very simple clients. Depending on your cloud provider, you can also have your instance's init script put the config into the ENV or a file, but then you have to worry about refreshing it on new deploys to the same server. You can also have your deployment scripts inject an env file into the deployment package or something. I just prefer having a single deployment package for all environments.
k
not sure if we are talking about spring boot. if so, I wrote article about this in the past https://dzone.com/articles/please-stop-using-springs-profiles-per-environment