I have to set a environment variable to the absolute path of the docker-compose.yml
file. I tried ${PWD}
(see below). However, as expected, PWD
is the path from where the docker compose command is executed and not the path of the docker-compose.yml
file.
How can I do this?
In case this is not possible, is there a way to configure docker compose that it always changes the PWD
to the location of the docker-compose.yml
file?
services:
environment:
TEST_ENV: ${PWD}/data
3