| |
| FROM python:3.11-slim |
|
|
| |
| WORKDIR /app |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| build-essential \ |
| curl \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| COPY requirements.txt . |
|
|
| |
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| |
| COPY config.py . |
| COPY main.py . |
| COPY graph.py . |
| COPY tools.py . |
| COPY streamlit_app.py . |
|
|
| |
| RUN mkdir -p /app/data |
|
|
| |
| |
| EXPOSE 7860 |
|
|
| |
| RUN echo '#!/bin/bash\n\ |
| echo "🚀 Starting FastAPI Backend on port 8001..."\n\ |
| python main.py &\n\ |
| BACKEND_PID=$!\n\ |
| echo "Backend PID: $BACKEND_PID"\n\ |
| \n\ |
| echo "⏳ Waiting 10 seconds for backend to initialize..."\n\ |
| sleep 10\n\ |
| \n\ |
| echo "🎨 Starting Streamlit Frontend on port 7860..."\n\ |
| python -m streamlit run streamlit_app.py \ |
| --server.port=7860 \ |
| --server.address=0.0.0.0 \ |
| --server.headless=true \ |
| --server.enableCORS=false \ |
| --server.enableXsrfProtection=false\n\ |
| ' > /app/start.sh && chmod +x /app/start.sh |
|
|
| |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ |
| CMD curl -f http://localhost:7860/_stcore/health || exit 1 |
|
|
| |
| CMD ["/app/start.sh"] |