title: run flask and golang server in docker
body: <p>I am trying to run a go web server and a flask server in the same docker container. I have 1 Docker file to build the flask app. How can I update the Dockerfile to build a container to run both python and golang.</p>
  <p>ProjectFolder</p>
  <ul>
  <li>pyfolder
  /app.py,
  Dockerfile</li>
  <li>main.go</li>
  </ul>
  <p>main.go</p>
  <pre><code>package main
  
  import (
      &quot;fmt&quot;
      &quot;log&quot;
      &quot;net/http&quot;
  )
  
  func handler(w http.ResponseWriter, r *http.Request) {
      fmt.Println(&quot;func called&quot;)
  }
  
  func main() {
      http.HandleFunc(&quot;/&quot;, handler)
      log.Fatal(http.ListenAndServe(&quot;:8080&quot;, nil))
  }
  </code></pre>
  <p>app.py</p>
  <pre><code>from flask import Flask
  import os
  
  app = Flask(__name__)
  
  @app.route(&quot;/&quot;)
  def hello():
      return &quot;Flask inside Docker!!&quot;
  
  
  if __name__ == &quot;__main__&quot;:
      port = int(os.environ.get(&quot;PORT&quot;, 5000))
      app.run(debug=True,host='0.0.0.0',port=port)
  </code></pre>
  <p>Dockerfile</p>
  <pre><code>FROM python:3.6
  
  COPY . /app
  WORKDIR /app
  RUN pip install -r requirements.txt
  ENTRYPOINT [&quot;python&quot;]
  CMD [&quot;app.py&quot;]
  </code></pre>