jeudi 23 juillet 2015

Managing Configurations After Building Ember Application

Looking for a best practice of managing configuration after the ember build if it is possible at all. Although it is not necessarily Docker specific, following must give you a good idea of the requirement even though you are not a Docker veteran.

Motivation: We use Docker + Docker Hub to (automatically) build and deploy our backend and frontend applications separately. There are multiple deployments. Frontend application is based on Ember (using ember-cli). Instead of running ember build --environment deployment-{1..N} in a separate Dockerfile and end up having multiple Docker images, I would prefer having one single Docker image and running the Docker container with required settings passed as environment variables to inject them into the Ember configuration later, such as:

docker run -e ENV_APP_APIURL=deployment1.example.com ... --name deployment1 dockerimage

I would then run a small script as ENTRYPOINT in Dockerfile which consumes these environment variables and inject them into the built Ember application so that web server can serve the re-configured application. In short:

[ember app] >> build >> [compiled generic web app] >> reconfigure(?) >> [final web app]

Is it ember way of doing things or I should go and grab a coffee?




Aucun commentaire:

Enregistrer un commentaire