title: Set PyCharm Python interpreter to Docker
body: <p>I've setup a Python <code>Flask</code> project to point at an <code>interpreter</code> running in <code>Docker</code>:</p>
  <p>Starting the <code>Flask</code> app from <code>PyCharm IDE</code> results in following output:</p>
  <pre><code>51be5e336622:python3 -u /opt/project/app.py
  Starting server
   * Serving Flask app &quot;app&quot; (lazy loading)
   * Environment: production
     WARNING: This is a development server. Do not use it in a production deployment.
     Use a production WSGI server instead.
   * Debug mode: on
   * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
   * Restarting with stat
  Starting server
   * Debugger is active!
   * Debugger PIN: 328-461-278
  </code></pre>
  <p>Trying to open http://localhost:5000/ results in a page not found error.</p>
  <p>If I run the app using Docker with Dockerfile:</p>
  <pre><code>FROM python:3.8-slim-buster
  
  WORKDIR /app
  
  COPY requirements.txt requirements.txt
  
  RUN pip3 install -r requirements.txt
  
  COPY . .
  
  EXPOSE 5000
  
  #CMD [ &quot;python3&quot;, &quot;-m&quot; , &quot;flask&quot;, &quot;run&quot;, &quot;--host=0.0.0.0&quot;]
  
  CMD [ &quot;python3&quot;, &quot;-u&quot; , &quot;/app/app.py&quot;]
  </code></pre>
  <p>The above Dockerfile builds the container PyCharm connects to and is configured within Pycharm as:</p>
  <p><a href="https://i.stack.imgur.com/WGy3g.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WGy3g.png" alt="enter image description here" /></a></p>
  <p>Running the <code>Docker</code> container using command <code>docker run  -p 5000:5000 services</code>, the app is started on http://localhost:5000/ successfully.</p>
  <p>Do I need to map the port 5000 from PyCharm IDE to the Docker container running on port 5000? How to achieve this, there does not seem to be an option within PyCharm IDE?</p>