Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +18 -0
Dockerfile
CHANGED
|
@@ -14,6 +14,24 @@ COPY --chown=user requirements.txt .
|
|
| 14 |
RUN pip install --no-cache-dir --upgrade pip \
|
| 15 |
&& pip install --no-cache-dir -r requirements.txt
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
COPY --chown=user . .
|
| 18 |
|
| 19 |
EXPOSE 7860
|
|
|
|
| 14 |
RUN pip install --no-cache-dir --upgrade pip \
|
| 15 |
&& pip install --no-cache-dir -r requirements.txt
|
| 16 |
|
| 17 |
+
# Patch Gradio 4.44.x stop_event bug in routes.py
|
| 18 |
+
RUN python3 - << 'PYEOF'
|
| 19 |
+
import site, pathlib
|
| 20 |
+
|
| 21 |
+
# Find gradio routes.py
|
| 22 |
+
for p in site.getsitepackages():
|
| 23 |
+
f = pathlib.Path(p) / "gradio" / "routes.py"
|
| 24 |
+
if f.exists():
|
| 25 |
+
src = f.read_text()
|
| 26 |
+
# Patch: guard stop_event before calling .wait()
|
| 27 |
+
old = "await app.stop_event.wait()"
|
| 28 |
+
new = "await app.stop_event.wait() if app.stop_event else None"
|
| 29 |
+
if old in src:
|
| 30 |
+
f.write_text(src.replace(old, new))
|
| 31 |
+
print(f"Patched {f}")
|
| 32 |
+
break
|
| 33 |
+
PYEOF
|
| 34 |
+
|
| 35 |
COPY --chown=user . .
|
| 36 |
|
| 37 |
EXPOSE 7860
|