yym68686 commited on
Commit
52fb331
·
1 Parent(s): a0bdc85

🐛 Bug: Fix the bug where uvicorn cannot monitor changes to the api.yaml file inside docker.

Browse files
Files changed (2) hide show
  1. Dockerfile +2 -1
  2. requirements.txt +1 -0
Dockerfile CHANGED
@@ -7,4 +7,5 @@ EXPOSE 8000
7
  WORKDIR /home
8
  COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
9
  COPY . /home
10
- ENTRYPOINT ["python", "-u", "/home/main.py"]
 
 
7
  WORKDIR /home
8
  COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
9
  COPY . /home
10
+ ENV WATCHFILES_FORCE_POLLING=true
11
+ ENTRYPOINT ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--reload", "--reload-include", "*.yaml"]
requirements.txt CHANGED
@@ -3,5 +3,6 @@ pytest
3
  uvicorn
4
  fastapi
5
  aiofiles
 
6
  httpx[http2]
7
  cryptography
 
3
  uvicorn
4
  fastapi
5
  aiofiles
6
+ watchfiles
7
  httpx[http2]
8
  cryptography