title: How can I run cypress tests inside a docker container against an external application
body: <p>I have a set of cypress e2e tests.  The code for these tests lives in their own git repo.<br />
  When executing these tests manually through cypress cli I can hit different URL's based on environment DEV/QA/STG and PROD.</p>
  <p>I can run the application locally but prefer not to and what I want to do is execute the tests inside the container and have them access the application outside of the container.</p>
  <p>In trying to accomplish this I have started the application locally on port 4200.  My cypress config has the base url property set in its config file and I can successfully run the tests from the Cypress cli (not in docker).</p>
  <p>In my cypress test repo, I have the following Dockerfile</p>
  <pre><code>FROM cypress/base:12.18.4
  RUN mkdir /app
  WORKDIR /app
  COPY . /app
  RUN npm install
  RUN $(npm bin)/cypress verify
  RUN [&quot;npm&quot;,&quot;run&quot;,&quot;cypress:run&quot;]
  </code></pre>
  <p>Executing <code>docker run</code> I see the following error.</p>
  <pre><code>#12 6.411 Cypress could not verify that this server is running:
  #12 6.411
  #12 6.411   &gt; http://localhost:4200/
  #12 6.411
  #12 6.411 We are verifying this server because it has been configured as your `baseUrl`.
  #12 6.411
  #12 6.411 Cypress automatically waits until your server is accessible before running tests.
  #12 6.411
  #12 6.411 We will try connecting to it 3 more times...
  #12 9.417 We will try connecting to it 2 more times...
  #12 12.42 We will try connecting to it 1 more time...
  #12 12.42
  #12 16.43 Cypress failed to verify that your server is running.
  
  </code></pre>
  <p>Not entirely sure how to &quot;allow&quot; tests to reach out to my <code>localhost:4200</code></p>
  <p>Kind of feel I need to create a docker-compose file but not sure about the networking details.</p>
  <p>Any help or thought greatly appreciated</p>