fix: unbuffer python stdout so cold-start progress is visible
Browse files- Dockerfile +7 -2
Dockerfile
CHANGED
|
@@ -25,8 +25,13 @@ COPY assets/ ./assets/
|
|
| 25 |
COPY benchmarks/ ./benchmarks/
|
| 26 |
|
| 27 |
# HuggingFace Spaces expect the app to listen on 0.0.0.0:7860.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
ENV GRADIO_SERVER_NAME=0.0.0.0 \
|
| 29 |
-
GRADIO_SERVER_PORT=7860
|
|
|
|
| 30 |
EXPOSE 7860
|
| 31 |
|
| 32 |
-
CMD ["python", "app.py"]
|
|
|
|
| 25 |
COPY benchmarks/ ./benchmarks/
|
| 26 |
|
| 27 |
# HuggingFace Spaces expect the app to listen on 0.0.0.0:7860.
|
| 28 |
+
# PYTHONUNBUFFERED + `python -u` so cold-import progress (pennylane,
|
| 29 |
+
# qiskit, qiskit-ibm-runtime — ~60–120 s on CPU Basic) is visible in
|
| 30 |
+
# the Space's container logs in real time, instead of appearing only
|
| 31 |
+
# after Gradio finishes booting.
|
| 32 |
ENV GRADIO_SERVER_NAME=0.0.0.0 \
|
| 33 |
+
GRADIO_SERVER_PORT=7860 \
|
| 34 |
+
PYTHONUNBUFFERED=1
|
| 35 |
EXPOSE 7860
|
| 36 |
|
| 37 |
+
CMD ["python", "-u", "app.py"]
|