Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +29 -8
Dockerfile
CHANGED
|
@@ -29,16 +29,37 @@ RUN pip install -e .
|
|
| 29 |
EXPOSE 7860 8000
|
| 30 |
|
| 31 |
# ─── Environment Variable to Pick Framework ───────────────────
|
| 32 |
-
# Default to Streamlit (change to "gradio" or "chainlit" at runtime)
|
| 33 |
ENV APP_MODE=streamlit
|
| 34 |
|
| 35 |
# ─── Entrypoint ───────────────────────────────────────────────
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
else \
|
| 43 |
-
echo "❌ Unknown APP_MODE: $
|
| 44 |
fi
|
|
|
|
| 29 |
EXPOSE 7860 8000
|
| 30 |
|
| 31 |
# ─── Environment Variable to Pick Framework ───────────────────
|
|
|
|
| 32 |
ENV APP_MODE=streamlit
|
| 33 |
|
| 34 |
# ─── Entrypoint ───────────────────────────────────────────────
|
| 35 |
+
# Detect whether app.py is at /app/app.py or /app/omniscientframework/app.py
|
| 36 |
+
CMD MODE=$(cat .app_mode 2>/dev/null || echo "$APP_MODE") && \
|
| 37 |
+
if [ "$MODE" = "streamlit" ]; then \
|
| 38 |
+
if [ -f "app.py" ]; then \
|
| 39 |
+
echo "🚀 Launching Streamlit (root-level app.py)"; \
|
| 40 |
+
streamlit run app.py --server.port=7860 --server.address=0.0.0.0; \
|
| 41 |
+
elif [ -f "omniscientframework/app.py" ]; then \
|
| 42 |
+
echo "🚀 Launching Streamlit (package-level app.py)"; \
|
| 43 |
+
streamlit run omniscientframework/app.py --server.port=7860 --server.address=0.0.0.0; \
|
| 44 |
+
else \
|
| 45 |
+
echo "❌ Error: app.py not found."; exit 1; \
|
| 46 |
+
fi; \
|
| 47 |
+
elif [ "$MODE" = "gradio" ]; then \
|
| 48 |
+
if [ -f "gradio_app.py" ]; then \
|
| 49 |
+
python gradio_app.py; \
|
| 50 |
+
elif [ -f "omniscientframework/gradio_app.py" ]; then \
|
| 51 |
+
python omniscientframework/gradio_app.py; \
|
| 52 |
+
else \
|
| 53 |
+
echo "❌ Error: gradio_app.py not found."; exit 1; \
|
| 54 |
+
fi; \
|
| 55 |
+
elif [ "$MODE" = "chainlit" ]; then \
|
| 56 |
+
if [ -f "chainlit_app.py" ]; then \
|
| 57 |
+
chainlit run chainlit_app.py --host 0.0.0.0 --port 8000; \
|
| 58 |
+
elif [ -f "omniscientframework/chainlit_app.py" ]; then \
|
| 59 |
+
chainlit run omniscientframework/chainlit_app.py --host 0.0.0.0 --port 8000; \
|
| 60 |
+
else \
|
| 61 |
+
echo "❌ Error: chainlit_app.py not found."; exit 1; \
|
| 62 |
+
fi; \
|
| 63 |
else \
|
| 64 |
+
echo "❌ Unknown APP_MODE: $MODE" && exit 1; \
|
| 65 |
fi
|