There's an environment variable defined in frontend's Dockerfile
:
ENV APP_BACKEND_URL=http://localhost/
and gets read when Docker builds a frontend image, and the same variable is defined in app.yml
:
services:
backend:
[...]
frontend:
[...]
environment:
APP_BACKEND_URL: 'backend'
The config file above gets given as an argument to docker stack deploy -c app.yml appli
.
I wonder which value gets eventually set up as the final one: the one from Dockerfile
(built into the image), or the other one, from the app.yml
file, that gets read last. In case of operating with Docker Compose, all variables present both in Dockerfile
and docker-compose.yml
were given values from Dockerfile
; docker-compose.yml
values were ignored. Does it work the same in case of Docker Swarm?
I ask the question because in the end my frontend doesn't read any value of the variable (console logs say about undefined
value) and I'd like to know how to supply the value to be accessible/readable by the application.