I’m working on an app that will be deployed into multiple locations. To work on it locally I’m running multiple copies side by side, using different environment variables in each.
I’m trying to work out the best way to configure code reloader so it doesn’t clash.
The docs for Phoenix.Endpoint say:
Keep in mind code reloading is based on the file-system, therefore it is not possible to run two instances of the same app at the same time with code reloading in development, as they will race each other and only one will effectively recompile the files. In such cases, tweak your config files so code reloading is enabled in only one of the apps or set the MIX_BUILD environment variable to give them distinct build directories
However, I can’t see any reference to the MIX_BUILD
env var anywhere in the Mix environment variables documentation. MIX_TARGET
looks like it does what I want, but the use case described isn’t quite what I want, and I’m not sure if I’m setting myself up for problems further down the line by using it.
Does anyone know if there’s a blessed way to do this? I’ll have a go at updating the Phoenix documentation if so!