I have defined a variable in my docker-compose:
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://lidardata:5432/Lidar
Inside container I can see this value when I run echo command.
In java code I try to fetch it as:
String dbUrl = System.getenv("SPRING_DATASOURCE_URL");
But dbUrl is null.
What am I missing?
2