title: How to remote debug python code in a Docker Container with VS Code
body: <p>I've just registered for this question. It's about if it's possible to remote debug python code in a Docker Container with VS Code.
  I am having a completely configured Docker Container here. I got a little bit of help with it, and I'm pretty new to docker anyways. In it runs Odoo v10. But I cant get the remote debug in VS Code to work. I have tried <a href="https://github.com/DonJayamanne/pythonVSCode/wiki/Debugging:-Remote-Debuging" rel="noreferrer">this</a> explanation, but I don't really get it. 
  Is it even possible? And if yes, how can I get it to work?
  I'm running Kubuntu 16.04 with VS Code 1.6.1 and the Python Extension from Don Jayamanne.
  Ah yeah and I hope I am at the right location with this question and it's not against any rules.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Just tried the way of Elton Stoneman. With it I'm getting this error:</p>
  
  <pre><code>There was an error in starting the debug server. 
  Error = {"code":"ECONNREFUSED","errno":"ECONNREFUSED","syscall":"connect",
           "address":"172.21.0.4","port":3000}
  </code></pre>
  
  <p>My <code>Dockerfile</code> looks like this:</p>
  
  <pre><code>FROM **cut_out**
  USER root
  # debug/dev settings
  
  RUN pip install \
          watchdog
  
  COPY workspace/pysrc /pysrc
  RUN apt-get update \
   &amp;&amp; apt-get install -y --no-install-recommends \
          build-essential \
          python-dev \
   &amp;&amp; /usr/bin/python /pysrc/setup_cython.py build_ext --inplace \
   &amp;&amp; rm -rf /var/lib/apt/lists/*
  
  EXPOSE 3000
  
  USER odoo
  </code></pre>
  
  <p>The <code>pysrc</code> in my Dockerfile is there because this was intended for working with PyDev (Eclipse) before.</p>
  
  <p>This is the <code>run command</code> I've used:</p>
  
  <pre><code>docker-compose run -d -p 3000:3000 odoo
  </code></pre>
  
  <p>And this is the important part of my <code>launch.json</code>:</p>
  
  <pre><code>    {
          "name": "Attach (Remote Debug)",
          "type": "python",
          "request": "attach",
          "localRoot": "${workspaceRoot}",
          "remoteRoot": "${workspaceRoot}",
          "port": 3000,
          "secret": "my_secret",
          "host": "172.21.0.4"
      }
  </code></pre>
  
  <p>I hope that's enough information for now.</p>
  
  <p><strong>UPDATE 2:</strong></p>
  
  <p>Alright I found the solution. I totally misunderstood how Docker works and tried it completeley wrong. I already had a completeley configured Docker-compose. So everything I needed to do was to adapt my VS Code configs to the docker-compose.yml. This means that I just had to change the launch.json to the port 8069 (default Odoo port) and just need to use <code>docker-compose up</code>, then the debugging works in VS Code. 
  Unfortunately the use of <code>ptvsd</code> kinda destroys my Odoo environment, but at least I'm able to debug now. Thanks!</p>