Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse filesoptional hf interfaces
- Dockerfile +19 -5
Dockerfile
CHANGED
|
@@ -19,12 +19,26 @@ COPY --chown=user requirements.txt requirements.txt
|
|
| 19 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 20 |
|
| 21 |
# ─── Install Package in Editable Mode ─────────────────────────
|
| 22 |
-
# (because setup.py exists at project root)
|
| 23 |
COPY --chown=user . /app
|
| 24 |
RUN pip install -e .
|
| 25 |
|
| 26 |
-
# ─── Expose
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
-
# ───
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 20 |
|
| 21 |
# ─── Install Package in Editable Mode ─────────────────────────
|
|
|
|
| 22 |
COPY --chown=user . /app
|
| 23 |
RUN pip install -e .
|
| 24 |
|
| 25 |
+
# ─── Expose Ports ────────────────────────────────────────────
|
| 26 |
+
# Streamlit default = 7860
|
| 27 |
+
# Gradio default = 7860
|
| 28 |
+
# Chainlit default = 8000
|
| 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 |
+
CMD if [ "$APP_MODE" = "streamlit" ]; then \
|
| 37 |
+
streamlit run app.py --server.port=7860 --server.address=0.0.0.0; \
|
| 38 |
+
elif [ "$APP_MODE" = "gradio" ]; then \
|
| 39 |
+
python gradio_app.py; \
|
| 40 |
+
elif [ "$APP_MODE" = "chainlit" ]; then \
|
| 41 |
+
chainlit run chainlit_app.py --host 0.0.0.0 --port 8000; \
|
| 42 |
+
else \
|
| 43 |
+
echo "Unknown APP_MODE: $APP_MODE" && exit 1; \
|
| 44 |
+
fi
|