title: How to access entrypoint.sh values in my docker-compose file?
body: <p>How do I access entrypoint.sh values in docker-compose file. I have declared all the values in entrypoint.sh as shown below. I need to access those in my docker-compose file</p>
  
  <p>I have used docker-volumes to copy the entrypoint.sh script to /usr/local/bin directory in the docker container.</p>
  
  <p>entrypoint.sh script</p>
  
  <pre><code>MONGO_ROOT_USERNAME=root
  MONGO_ROOT_PASSWORD=mongo@123
  MONGO_EXPRESS_USERNAME=root
  MONGO_EXPRESS_PASSWORD=express@123
  </code></pre>
  
  <p>docker-compose file</p>
  
  <pre><code>mongo-express:
      image: mongo-express
      ports:
        - 8081:8081
      volumes:
        - "./docker-scripts/entrypoint.sh:/usr/local/bin"
      environment:
        ME_CONFIG_BASICAUTH_USERNAME: ${MONGO_EXPRESS_USERNAME}
        ME_CONFIG_BASICAUTH_PASSWORD: ${MONGO_EXPRESS_PASSWORD}
        ME_CONFIG_MONGODB_PORT: 27017
        ME_CONFIG_MONGODB_ADMINUSERNAME: ${MONGO_ROOT_USERNAME}
        ME_CONFIG_MONGODB_ADMINPASSWORD: ${MONGO_ROOT_PASSWORD}
  </code></pre>
  
  <p>But when I run docker-compose -d I get this message</p>
  
  <pre><code>WARNING: The MONGO_ROOT_USERNAME variable is not set. Defaulting to a blank string.
  WARNING: The MONGO_ROOT_PASSWORD variable is not set. Defaulting to a blank string.
  WARNING: The MONGO_EXPRESS_USERNAME variable is not set. Defaulting to a blank string.
  WARNING: The MONGO_EXPRESS_PASSWORD variable is not set. Defaulting to a blank string.
  </code></pre>