title: is there a difference between running fastapi from uvicorn command in dockerfile and from pythonfile?
body: <p>I am running a fast api and when i was developing i had the following piece of code in my app.py file</p>
  <p>code in app.py:</p>
  <pre><code>import uvicorn
  
  
  if __name__==&quot;__main__&quot;:
      uvicorn.run(&quot;app.app:app&quot;,host='0.0.0.0', port=4557, reload=True, debug=True, workers=3)
  </code></pre>
  <p>so i was about to run <code>CMD [&quot;python3&quot;,&quot;app.py&quot;]</code> in my Dockerfile.</p>
  <p>on the fastapi example they did something like this :</p>
  <pre><code>CMD [&quot;uvicorn&quot;, &quot;app.main:app&quot;, &quot;--host&quot;, &quot;0.0.0.0&quot;, &quot;--port&quot;, &quot;80&quot;]
  </code></pre>
  <p>I want to know what is the difference between these two methods as i think both of them will work.</p>