ENV variable in linuxser Ubuntu base image

I am using the linuxserver Ubuntu base image to create my own docker image.

My Problem is that I i use UID/GID 1000 and it seems that in that context the ENV variables set in the docker compose are not available. Any ideas how to get the env variables in this scenario?

How are you checking their existence?

I tested bit in my python code via eg.

user_passwd = os.environ[‘PASSWORD’]

The script is started via

CMD [ “python3”, “script.py”]

In the docker file

The strange thing is if I enter the docker container via:
docker exec -it containername bash
And then start the python script with python3 script.py
It can read the env variables.

Nothing strange is happening here. GitHub - just-containers/s6-overlay: s6 overlay for containers (includes execline, s6-linux-utils & a custom init)

Keep in mind our base images are not designed to be used by providing a command in the dockerfile, as it has a init system.