Skip to content

Commit

Permalink
ignored app/test_main.py from uvicorn reload
Browse files Browse the repository at this point in the history
  • Loading branch information
borolepratik committed Jan 23, 2024
1 parent 29a2a85 commit b3d2dce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ HEALTHCHECK --interval=5m --timeout=3s \
CMD curl -f http://localhost/health || exit 1

# Run the uvicorn command, telling it to use the app object imported from app.main.
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8081", "--reload"]
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8081", "--reload", "--reload-exclude". "app/test_main.py"]

# CMD ["uvicorn", "app.main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "8081" "--reload"]
# CMD ["uvicorn", "app.main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "8081" "--reload", "--reload-exclude". "app/test_main.py"]
7 changes: 6 additions & 1 deletion run.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@

def start_server():
uvicorn.run(
"app.main:app", host="127.0.0.1", port=8081, reload=True, log_level="info"
"app.main:app",
host="127.0.0.1",
port=8081,
reload=True,
log_level="info",
reload_excludes=["app/test_main.py"],
)


Expand Down

0 comments on commit b3d2dce

Please sign in to comment.