Spaces:
Sleeping
Sleeping
Melika Kheirieh
commited on
Commit
·
98694e9
1
Parent(s):
e156859
fix(demo): ensure Gradio binds to 0.0.0.0:7860 via env + Docker config
Browse files- Dockerfile +4 -0
- demo/app.py +6 -1
Dockerfile
CHANGED
|
@@ -10,6 +10,10 @@ COPY requirements.txt .
|
|
| 10 |
RUN pip install --no-cache-dir -r requirements.txt \
|
| 11 |
&& pip install --no-cache-dir supervisor
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
# ---------- Copy source ----------
|
| 14 |
COPY . .
|
| 15 |
|
|
|
|
| 10 |
RUN pip install --no-cache-dir -r requirements.txt \
|
| 11 |
&& pip install --no-cache-dir supervisor
|
| 12 |
|
| 13 |
+
# ---------- Gradio env (for Hugging Face) ----------
|
| 14 |
+
ENV GRADIO_SERVER_NAME=0.0.0.0
|
| 15 |
+
ENV GRADIO_SERVER_PORT=7860
|
| 16 |
+
|
| 17 |
# ---------- Copy source ----------
|
| 18 |
COPY . .
|
| 19 |
|
demo/app.py
CHANGED
|
@@ -186,4 +186,9 @@ with gr.Blocks(title="NL2SQL Copilot") as demo:
|
|
| 186 |
)
|
| 187 |
|
| 188 |
if __name__ == "__main__":
|
| 189 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 186 |
)
|
| 187 |
|
| 188 |
if __name__ == "__main__":
|
| 189 |
+
import os
|
| 190 |
+
|
| 191 |
+
demo.launch(
|
| 192 |
+
server_name=os.getenv("GRADIO_SERVER_NAME", "0.0.0.0"),
|
| 193 |
+
server_port=int(os.getenv("GRADIO_SERVER_PORT", "7860")),
|
| 194 |
+
)
|