title: gitlab-ci: provide environment variable(s) to custom docker image in a pipeline
body: <p>I want to set up a test stage for my gitlab-ci which depends on a custom docker image. I want to know how will I provide some config (like setting env variable to providing a .env file) to it so that the custom image runs properly and hence the stage.
  Current config:</p>
  
  <pre><code>test_job:
    only:
    refs:
      - master
      - merge_requests
      - web
  stage: test
  services:
    - mongo:4.0.4
    - redis:5.0.1
    - registry.gitlab.com/myteam/myprivaterepo:latest 
  variables:
    - PORT=3000
    - SERVER_HOST=myprivaterepo
    - SERVER_PORT=9090
  script: npm test
  </code></pre>
  
  <p>I want to provide environment variables to <code>myprivaterepo</code> docker image which connects to <code>mongo:4.0.4</code> and <code>redis:5.0.1</code> services for its functioning.</p>
  
  <p><strong>EDIT:</strong> The variables are <code>MONGODB_URI="mongodb://mongo:27017/aics"</code> and <code>REDIS_CLIENT_HOST: "redis"</code>. These have no meaning for the app being tested but has meaning for the <code>myprivaterepo</code> image without which the test stage will fail.</p>