The variables are being read by Compose when the file is parsed. But setting environment
only provides values to the container, not to the file parsing.
If you’re trying to pass those variables into the container, you need to escape them in the command using an extra $
-Dconfig.home=$${CONF_HOME} -Dcomponent.name=LMS -Denv=$${APP_ENV} -Duser.dir=/tmp/ -DLMS_UUID=$${UUID
If you’re just trying to use variables in the Compose file, you need to put those variables into an .env
file.
See https://docs.docker.com/compose/compose-file/compose-file-v3/#variable-substitution for the full documentation