Use -e to pass environment variable or --env-file to provide file of environment variables.
e.g. with -e option

docker run -m 8GB -d -p 3000:3000 -p 5432:5432 --name BrowserStackCodeQuality -e gamma_ui_public_host=http://<IP/domain name>:<Port> -e ACCEPT_EULA=Y -e EMB_USE_NATIVE_PYPARSER=TRUE -e RISK_XMX=-Xmx1024m -e ANALYSER_XMX=-Xmx3072m -e no_proxy=localhost,127.0.0.0/8,::1 -e http_proxy=http://PROXY_IP:PROXY_PORT -e https_proxy=http://PROXY_IP:PROXY_PORT -e CATALINA_OPTS="-Dhttps.proxyHost=PROXY_IP -Dhttps.proxyPort=PROXY_PORT -Dhttp.proxyHost=PROXY_IP -Dhttp.proxyPort=PROXY_PORT -Dhttp.NoproxyHost='localhost|127.*|::1|192.168.*' -DGAMMA_ROOT=/opt/gamma -Xmx1024m -Djava.awt.headless=true -Djava.library.path=/usr/lib/x86_64-linux-gnu/jni/:/usr/lib64/" -v /home/${USER}/docker/data:/opt/gamma_data -v /home/${USER}/docker/db:/var/lib/postgresql -v /home/${USER}/docker/logs:/opt/gamma/logs browserstack/code-quality:${VERSION}

With --env-file option,
Use --env-file=env.list to read a file of environment variables.

env.list file looks like this:

ACCEPT_EULA=Y
RISK_XMX=-Xmx1024m
ANALYSER_XMX=-Xmx3072m
http_proxy=http://PROXY_IP:PROXY_PORT
https_proxy=http://PROXY_IP:PROXY_PORT
no_proxy=localhost,127.0.0.0/8,::1
-e gamma_ui_public_host=http://<IP/domain name>:<Port>
CATALINA_OPTS=-Dhttps.proxyHost=PROXY_IP -Dhttps.proxyPort=PROXY_PORT -Dhttp.proxyHost=PROXY_IP -Dhttp.proxyPort=PROXY_PORT -Dhttp.NoproxyHost='localhost|127.*|::1|192.168.*' -DGAMMA_ROOT=/opt/gamma -Xmx1024m -Djava.awt.headless=true -Djava.library.path=/usr/lib/x86_64-linux-gnu/jni/:/usr/lib64/
Note: Use your proxy host and port by replacing text “PROXY_IP” and “PROXY_PORT” respectively.