title: Docker / Flask - Client sent an HTTP request to an HTTPS server
body: <p>everyone. I try to use Docker. I follow this guide:</p>
  <p><a href="https://cloud.croc.ru/blog/byt-v-teme/flask-prilozheniya-v-docker/" rel="nofollow noreferrer">https://cloud.croc.ru/blog/byt-v-teme/flask-prilozheniya-v-docker/</a></p>
  <p>My app.py:</p>
  <pre><code>#!/usr/bin/env python
  # -*- coding: utf-8 -*-
  from flask import Flask
  app = Flask(__name__)
   
  @app.route('/')
  def hello_world():
      return 'Moe Flask приложение в контейнере Docker.'
   
  if __name__ == '__main__':
      app.run(debug=True,host='0.0.0.0')
  </code></pre>
  <p>Dockerfile:</p>
  <pre><code>FROM ubuntu:latest
  RUN apt-get update -y
  RUN apt-get install -y software-properties-common
  RUN apt-add-repository -y universe
  RUN apt-get install -y python3-pip python-dev build-essential
  COPY . /app
  WORKDIR /app 
  RUN pip3 install -r requirements.txt
  ENTRYPOINT ['python']
  CMD ['app.py']
  </code></pre>
  <p>App is working by itself, but in Docker returns:</p>
  <pre><code>Client sent an HTTP request to an HTTPS server.
  </code></pre>
  <p>I use Win7 x64, and Docker Quickstart Terminal</p>
  <p>Thank you.</p>
  <p><strong>UPD</strong></p>
  <p>Thing is I build with:</p>
  <p>docker run -d -p <strong>5000</strong>:<strong>5000</strong> my_flask_app:v0.1</p>
  <p>But in browser use:</p>
  <p><a href="http://192.168.99.100:2376/" rel="nofollow noreferrer">http://192.168.99.100:2376/</a></p>
  <p>Added in Dockerfile:</p>
  <pre><code>EXPOSE 5000/tcp
  EXPOSE 2376/tcp
  </code></pre>
  <p>Result is the same</p>
  <p><strong>UPD2</strong></p>
  <p>Tried to use</p>
  <pre><code>docker run -d -p 2376:2376 my_flask_app:v0.1
  </code></pre>
  <p>But error appears: <em><strong>port is already allocated</strong></em></p>
  <p>docker ps - empty</p>
  <p>docker ps -a - gives my_flask_app container</p>
  <p>I use docker rm -f $(docker ps -a -q) to delete all containers, then</p>
  <p>docker ps -a is empty</p>
  <p>But again I see <em><strong>port is already allocated</strong></em></p>