We should aim for universal docker images. Currently, our docker image is built with (mostly) static configuration so the result image is not configurable. This renders the image unusable in others environments, since it has the configuration hardcoded.
Following docker good practices, we should avoid static configuration so we can change application parameters without rebuilding the image. Environment variables are the way to go.
In the Node.js ecosystem we have the dotenv package which allows us to merge environment variables with variables from a local file named .env.
We should aim for universal docker images. Currently, our docker image is built with (mostly) static configuration so the result image is not configurable. This renders the image unusable in others environments, since it has the configuration hardcoded.
Following docker good practices, we should avoid static configuration so we can change application parameters without rebuilding the image. Environment variables are the way to go.
In the Node.js ecosystem we have the dotenv package which allows us to merge environment variables with variables from a local file named
.env
.