title: Docker Flask wsl2 ERR_EMPTY_RESPONSE
body: <p>I have the following Dockerfile in my flask application inside WSL2</p>
  <pre><code>FROM python:3.9
  
  WORKDIR /usr/src/app/api
  
  EXPOSE 5000
  
  # install dependencies
  RUN python -m pip install --upgrade pip
  COPY ./requirements.txt /usr/src/app/api/requirements.txt
  RUN pip install -r requirements.txt
  
  # copy project
  COPY . /usr/src/app/api/
  
  # CMD [ &quot;EXPORT&quot;,&quot;FLASK_APP&quot;,&quot;=&quot;,&quot;manage.py&quot; ]
     
  CMD [ &quot;gunicorn&quot;, &quot;-w&quot;, &quot;4&quot;, &quot;-b&quot;,&quot;localhost:5000&quot;,&quot;--reload&quot;,&quot;app:create_app('development')&quot; ]
  
  </code></pre>
  <p>However after building the image and running a container from it:</p>
  <pre><code>docker build -t &quot;backend&quot;
  docker run -p 5000:5000 backend
  </code></pre>
  <p>I get an <strong>&quot;ERR_EMPTY_RESPONSE&quot;</strong> when I open 'localhost:5000' on my local browser.</p>
  <p>NOTE: when I run flask with gunicorn directly inside WSL2 without Docker, the site runs perfectly.</p>
  <p>Thanks in advance</p>