question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi,

I like to develop within the docker container so that I use the same environment that is used later in prod.

I run: docker run -it --rm -v /c/Users/myuser/chat/api:/app -p 8090:8000 my-image-name:0.0.2 uvicorn main:app --reload

So I map using -v my local directory inside the container. When I change a file locally the reloader within docker detecs it and restarts the application. That works fine. But if I try to connect to http://localhost:8090/ I get a “The connection was reset” message in the webbrowser (firefox).

Uvicorn logs that its running on http://127.0.0.1:8000 so -p 8090:8000 should work - I thought 😃

my-image-name:0.0.2 is based on tiangolo/uvicorn-gunicorn-fastapi:python3.8-slim and basically only installs some python packages and then does a COPY /api /app I develop on Windows 10 using WSL (not WSL2).

Does anyone else had this issue ?

Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
rizkyarlincommented, May 20, 2020

ah you don’t run it as sudo… if you run sudo docker ps you can check the port mapping.

docker run -it --rm -p 8090:8000 tiangolo/uvicorn-gunicorn-fastapi:python3.8-slim uvicorn main:app on your computer can you connect to http://localhost:8090 ?

Yes

One more thing, try to run the uvicorn with --host option uvicorn main:app --host 0.0.0.0

1reaction
yellow-sockcommented, Jun 6, 2020

Now closed … thanks again

Read more comments on GitHub >

github_iconTop Results From Across the Web

9 Ways To Improve Your Personal Development Skills - Indeed
How to improve your personal development skills · 1. Overcome your fears · 2. Read · 3. Learn something new · 4. Ask...
Read more >
Self Development: The 9 Skills You Need to Improve Your Life
1. Develop a growth mindset · 2. Develop your ability to think like an entrepreneur · 3. Calm yourself & de-stress · 4....
Read more >
10 Things You Can Do in Your Daily Life to Improve Your ...
1. Read about what you want to improve. · 2. Find a mentor. · 3. Reflect at the end of each day. ·...
Read more >
42 Practical Ways to Start Working on Self-Improvement
Some good habits to cultivate include reading books, waking up early, exercising, reading a new personal development article a day, and ...
Read more >
How to Develop an App in 9 Easy Steps (2022 Guide) - Upwork
However, between helpful development platforms and software programs that do much of the groundwork, many small businesses are developing mobile apps in-house.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found