How to set node ENV process.env.mysql-host with docker run?
Can i somehow do like this? docker run --mysql-host:127.0.0.1 -p 80:80 -d myApp
I am using FROM node:onbuild as image.
I don't know much about node, but I think you just need to do:
docker run -e mysql-host=127.0.0.1 -p 80:80 -d myApp
Note that this will look for mysql-host in the same container, not on the host, if that's what you're expecting. I think what you really want to do is:
$ docker run -d --name db mysql
...
$ docker run -d --link db:mysql-host -p 80:80 -d myApp
Which will run the myApp container linked to the db container and resolvable as "mysql-host" inside the myApp container with no need for environment variables.