Skip to content

Commit f1134f6

Browse files
committed
Add flag to force reload on watchfiles
1 parent b1c8cc4 commit f1134f6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/local_with_uvicorn/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,15 @@ COPY --from=builder --chown=app:app /app/.venv /app/.venv
3333
# Ensure the virtual environment is in the PATH
3434
ENV PATH="/app/.venv/bin:$PATH"
3535

36+
# Force file watching to use polling, which is more reliable in some Docker environments (like WSL/macOS)
37+
ENV WATCHFILES_FORCE_POLLING=true
38+
3639
# Switch to the non-root user
3740
USER app
3841

3942
# Set the working directory
4043
WORKDIR /code
4144

4245
# -------- replace with comment to run with gunicorn --------
43-
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload", "--reload-include", "/code/.env"]
46+
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload", "--reload-include", ".env"]
4447
# CMD ["gunicorn", "app.main:app", "-w", "4", "-k", "uvicorn.workers.UvicornWorker", "-b", "0.0.0.0:8000"]

0 commit comments

Comments
 (0)