Skip to content

Commit e84acce

Browse files
committed
Add watchfiles for hot reloading
1 parent 991a8d5 commit e84acce

4 files changed

Lines changed: 131 additions & 2 deletions

File tree

.diploi/helm/app.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ spec:
4949
elif [ -f requirements.txt ]; then
5050
uv pip install -r requirements.txt
5151
fi
52+
echo "Checking and Installing watchfiles if missing for live reloading in development..."
53+
uv pip show --python .venv/bin/python watchfiles >/dev/null 2>&1 || \
54+
uv pip install --python .venv/bin/python watchfiles --link-mode=copy
5255
env:
5356
- name: UV_PYTHON
5457
value: {{ ((.Values.envMap.PYTHON_VERSION).value | default "3.12") | quote }}

Dockerfile.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ ENV PATH="$FOLDER/.venv/bin:$PATH"
1717

1818
USER 1000:1000
1919

20-
CMD ["uv", "run", "python", "src/main.py"]
20+
CMD ["uv", "run", "watchfiles", "python", "src/main.py"]

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ version = "0.1.0"
44
description = "Add your description here"
55
readme = "README.md"
66
requires-python = ">=3.11"
7-
dependencies = []
7+
dependencies = [
8+
"watchfiles>=1.1.1",
9+
]

0 commit comments

Comments
 (0)