You can use docker run -e envkey=envvalue ....
to setup environment variables inside the container when it starts (docker run | Docker Docs).
If you’re using docker-compose, you can do the same in multiple ways as described in their documentation Ways to set environment variables in Compose | Docker Docs
Note that the environment variables must be set INSIDE the docker container. The options above will do that.