Closed duro closed 9 years ago
Unlikely this is a result of envify: it uses Node's built in process.env
object. I suspect something in Docker is swallowing up your environment variables, and while envify is still running there aren't any available environment variables to replace.
@yoshuawuyts is more familiar with Docker than I and might be able to provide some insight :)
Docker relies heavily on ENV vars, so them being set during build is a core and critical part of the platform. While I will look into that, my guess is that may lead to a dead end.
I think I found out what's up. It's not Docker swallowing the ENV vars, it's the fact that the NODE_ENV var I am setting is not available based on the way I have this setup via Vagrant. Thanks for the nudge in the right direction, even if I was a doubter. :)
All good! Hope the rest goes smoothly :)
My app is Containerized inside of Docker. I am using gulp to build my client side app. In order to ensure that the client bundle is ready to go when the container starts I run my
gulp build
via the Dockerfile.For some reason when the build run via the Docker file, everything builds just fine, but envify has no impact on the build. None of the
process.env
references are replaced. However, if I open a shell into the container after it has started, and then re-rungulp build
, envify takes effect.I have analized the bundles created before and after the second run of
gulp build
, and browserify is definitely running and other transforms are executed in both cases. It just seems thatenvify
is not running when triggered by the Docker build.Any ideas what could be causing this? Does envify depend on some kind of shell state (since it works when I run via a shell command, but not when the run happens automatically via the Docker build)?