Spaces:
Runtime error
Runtime error
| # FROM python:3.10-slim | |
| # WORKDIR /app | |
| # COPY . /app | |
| # RUN pip install --upgrade pip | |
| # RUN pip install -r requirements.txt | |
| # EXPOSE 7860 | |
| # CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |
| FROM python:3.10 | |
| # Set up working directory | |
| WORKDIR /code | |
| # Install dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy app code | |
| COPY . . | |
| # Expose default Streamlit port | |
| EXPOSE 7860 | |
| # Install tmux to run both apps | |
| RUN apt-get update && apt-get install -y tmux | |
| # Run FastAPI backend and Streamlit frontend together | |
| CMD tmux new-session -d "uvicorn app:app --host 0.0.0.0 --port 7861" \; \ | |
| new-window -n streamlit "streamlit run streamlit_app.py --server.port 7860 --server.enableCORS false" \; \ | |
| attach |