Declares env variables with ENV:
ENV thing default_thing_value
ENV thing2 default_thing2_valueThen you can pass the env variables with docker run.
docker run -p 9000:9000 -e thing=bwallberg -e thing2=1337 -d
If using docker-compose
node:
environment:
- environment=dev
- cluster=0Your Dockerfile CMD can use the env variables but you need use sh -c:
CMD ["sh", "-c", "node server.js ${cluster} ${environment}"]