Apologies, I just found
netlify dev, which seems to get us most of the way there, but if I use the
sed technique from the documentation (https://docs.netlify.com/configure-builds/file-based-configuration/#inject-environment-variable-values), in the
[dev] block, it permanently changes
netlify.toml. I would need to use the
sed backup feature and replace
netlify.toml with that once the server goes down, it seems. However, there doesn’t appear to be a way to add a teardown script, yet.
I am aware there is a Netlify build Docker image for testing, but how about a deploy one?
The biggest use case here is in testing redirects and build switches which can be set in the
netlify.toml file. It is currently impossible to see if certain redirects work as expected without a complete deploy to Netlify, which soon eats up build minutes.
It would be great to be able to set up a local Docker cluster with something that closely mimics a Netlify deployment, with config switches for the dev environment.
Even something akin to the Zeit
now-dev would help solve the problem.
Thanks for your time