Spaces:
Runtime error
Runtime error
Move Dockerfile to root, merge frontend + backend
Browse files- Dockerfile +6 -1
- frontend/start.sh +2 -3
Dockerfile
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
WORKDIR /app
|
|
@@ -5,6 +6,7 @@ WORKDIR /app
|
|
| 5 |
ENV PYTHONPATH="${PYTHONPATH}:/app"
|
| 6 |
ENV STREAMLIT_HOME=/app/.streamlit
|
| 7 |
ENV HF_HOME=/app/.cache
|
|
|
|
| 8 |
|
| 9 |
COPY ./backend/requirements.txt /app/backend_requirements.txt
|
| 10 |
COPY ./frontend/requirements.txt /app/frontend_requirements.txt
|
|
@@ -17,8 +19,11 @@ RUN pip install --no-cache-dir --upgrade pip && \
|
|
| 17 |
COPY ./backend /app/backend
|
| 18 |
COPY ./frontend /app/frontend
|
| 19 |
|
|
|
|
| 20 |
RUN chmod +x /app/frontend/start.sh
|
|
|
|
| 21 |
RUN chown -R 1000:1000 /app
|
| 22 |
|
| 23 |
-
|
|
|
|
| 24 |
CMD sh -c "uvicorn backend.app.main:app --host 0.0.0.0 --port 8000 & /app/frontend/start.sh & wait"
|
|
|
|
| 1 |
+
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
WORKDIR /app
|
|
|
|
| 6 |
ENV PYTHONPATH="${PYTHONPATH}:/app"
|
| 7 |
ENV STREAMLIT_HOME=/app/.streamlit
|
| 8 |
ENV HF_HOME=/app/.cache
|
| 9 |
+
# -------------------------------------------------------------
|
| 10 |
|
| 11 |
COPY ./backend/requirements.txt /app/backend_requirements.txt
|
| 12 |
COPY ./frontend/requirements.txt /app/frontend_requirements.txt
|
|
|
|
| 19 |
COPY ./backend /app/backend
|
| 20 |
COPY ./frontend /app/frontend
|
| 21 |
|
| 22 |
+
|
| 23 |
RUN chmod +x /app/frontend/start.sh
|
| 24 |
+
|
| 25 |
RUN chown -R 1000:1000 /app
|
| 26 |
|
| 27 |
+
EXPOSE 8501
|
| 28 |
+
|
| 29 |
CMD sh -c "uvicorn backend.app.main:app --host 0.0.0.0 --port 8000 & /app/frontend/start.sh & wait"
|
frontend/start.sh
CHANGED
|
@@ -9,8 +9,7 @@ cd /app/frontend
|
|
| 9 |
mkdir -p /app/.streamlit
|
| 10 |
export STREAMLIT_HOME=/app/.streamlit
|
| 11 |
|
| 12 |
-
# Use HF Space APP_PORT or fallback to 8501
|
| 13 |
PORT=${APP_PORT:-8501}
|
| 14 |
|
| 15 |
-
echo "Launching Streamlit app
|
| 16 |
-
streamlit run dashboard.py --server.port=$PORT --server.address=0.0.0.0
|
|
|
|
| 9 |
mkdir -p /app/.streamlit
|
| 10 |
export STREAMLIT_HOME=/app/.streamlit
|
| 11 |
|
|
|
|
| 12 |
PORT=${APP_PORT:-8501}
|
| 13 |
|
| 14 |
+
echo "Launching Streamlit app..."
|
| 15 |
+
streamlit run dashboard.py --server.port=$PORT --server.address=0.0.0.0
|