Unable to use own environment variable docker

#Login API URL
API_URL=

#API URL
API_GATEWAY_URL=

#Chat server URL
SOCKETIO_CHAT_URL=

#Google API key used for meeting schedule in google calendar
GOOGLE_API_KEY=

#Google Auth ID for meeting schedule in google calendar
GOOGLE_AUTH_ID=

#Firebase configuration details
FIREBASE_CONFIG_APIKEY=
FIREBASE_CONFIG_AUTH_DOMAIN=
FIREBASE_CONFIG_DATABASE_URL=
FIREBASE_CONFIG_PROJECTID=
FIREBASE_CONFIG_STORAGE_BUCKET=
FIREBASE_CONFIG_MESSAGING_SENDERID=
FIREBASE_CONFIG_APPID=
FIREBASE_CONFIG_MEASUREMENTID=

#Dial-In Pin API URL
PIN_MAPPER_URL=https://jitsi-api.jitsi.net/
I have defined the above in .env file, made the corresponding entry in docker-compose.yml file under web service.
under ~/docker-jitsi-meet/web/rootfs/dist/assets folder , I want to use environment configuration like this , but unable to use like below.
(function(window) {
window.env = window.env || {};
// Environment variables
window[“env”][“API_URL”] = ‘{{ .Env.API_URL }}’;
window[“env”][“API_GATEWAY_URL”] = ‘{{ .Env.API_GATEWAY_URL }}’;
window[“env”][“SocketIOChatUrl”]=’{{ .Env.SOCKETIO_CHAT_URL }}’;
window[“env”][“GoogleApiKey”]=’{{ .Env.GOOGLE_API_KEY }}’;
window[“env”][“GoogleAuthId”]=’{{ .Env.GOOGLE_AUTH_ID }}’;
window[“env”][“firebaseConfig_apiKey”]=’{{ .Env.FIREBASE_CONFIG_APIKEY }}’;
window[“env”][“firebaseConfig_authDomain”]=’{{ .Env.FIREBASE_CONFIG_AUTH_DOMAIN }}’;
window[“env”][“firebaseConfig_databaseURL”]=’{{ .Env.FIREBASE_CONFIG_DATABASE_URL }}’;
window[“env”][“firebaseConfig_projectId”]=’{{ .Env.FIREBASE_CONFIG_PROJECTID }}’;
window[“env”][“firebaseConfig_storageBucket”]=’{{ .Env.FIREBASE_CONFIG_STORAGE_BUCKET }}’;
window[“env”][“firebaseConfig_messagingSenderId”]=’{{ .Env.FIREBASE_CONFIG_MESSAGING_SENDERID }}’;
window[“env”][“firebaseConfig_appId”]=’{{ .Env.FIREBASE_CONFIG_APPID }}’;
window[“env”][“firebaseConfig_measurementId”]=’{{ .Env.FIREBASE_CONFIG_MEASUREMENTID }}’;
window[“env”][“PIN_MAPPER_URL”]= ‘{{ .Env.PIN_MAPPER_URL }}’;
})(this);
I have mounted the dist folder at /usr/share/jitsi-meet/admin/ in web container.
like this

  • ./web/rootfs/dist/:/usr/share/jitsi-meet/admin/:rw under web service
    I have another question, How the .Env is used to access environment configuration

exec into the container and use command echo $FIREBASE_CONFIG_MEASUREMENTID and check if its print something or not.
Are you putting all these env variables here?

exec into the container and use command echo $FIREBASE_CONFIG_MEASUREMENTID and check if its print something or not.
It prints nothing
Are you putting all these env variables
yes. like below
- API_URL
- API_GATEWAY_URL
- SOCKETIO_CHAT_URL
- GOOGLE_API_KEY
- GOOGLE_AUTH_ID
- FIREBASE_CONFIG_APIKEY
- FIREBASE_CONFIG_AUTH_DOMAIN
- FIREBASE_CONFIG_DATABASE_URL
- FIREBASE_CONFIG_PROJECTID
- FIREBASE_CONFIG_STORAGE_BUCKET
- FIREBASE_CONFIG_MESSAGING_SENDERID
- FIREBASE_CONFIG_APPID
- PIN_MAPPER_URL
- FIREBASE_CONFIG_MEASUREMENTID
Thanks for reply.

working fine for me.

I have added HELLO=hello-world env variable in .env file and then use this HELLO env variable in docker-compose.yaml file under web services. After that spin up the containers and then exec into web container and then use command printenv inside web container.
OR simply run docker exec docker-jitsi-meet_web_1 printenv command

snippet below

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=0a1f2605fa99
HELLO=hello-world              <-------------------- I have added this env variable
ENABLE_XMPP_WEBSOCKET=1
ENABLE_COLIBRI_WEBSOCKET=1
DISABLE_DEEP_LINKING=true
PUBLIC_URL=https://localhost:8443
TZ=Asia/Kolkata
DEPLOYMENTINFO_SHARD=shard1
DEPLOYMENTINFO_REGION=Region1
DEPLOYMENTINFO_USERREGION=Region1
ENABLE_AUTH=0
ENABLE_NO_AUDIO_DETECTION=true
ENABLE_P2P=true
ENABLE_RECORDING=1
ENABLE_SUBDOMAINS=true
ENABLE_TALK_WHILE_MUTED=true
ENABLE_VIDEOQUALITY=true
ETHERPAD_PUBLIC_URL=https://localhost:8443/p/etherpad
ETHERPAD_URL_BASE=http://localhost:9001
JICOFO_AUTH_USER=focus
P2P_PREFERRED_CODEC=VP9
TESTING_OCTO_PROBABILITY=0
XMPP_AUTH_DOMAIN=auth.meet.jitsi
XMPP_BOSH_URL_BASE=http://xmpp.meet.jitsi:5280
XMPP_DOMAIN=meet.jitsi
XMPP_GUEST_DOMAIN=guest.meet.jitsi
XMPP_MUC_DOMAIN=muc.meet.jitsi
XMPP_RECORDER_DOMAIN=recorder.meet.jitsi
VIDEOQUALITY_PREFERRED_CODEC=VP9
S6_BEHAVIOUR_IF_STAGE2_FAILS=2
HOME=/root

To use these env variables use $HELLO instead of '{{ .Env.HELLO }}'.
'{{ .Env.HELLO }}' is used for templating and tool used is frep

image
docker.compose.yml configuration


my dist/assets/hello file content
You can see the output i am getting nothing.
But i get the output when i run echo $HELLO inside web container