# Use Python 3.11 as base image FROM python:3.11-slim # ------------------------------- # Set working directory WORKDIR /app # Copy all application files COPY . . # List files for debugging RUN ls -la /app # ------------------------------- # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ curl \ git \ && rm -rf /var/lib/apt/lists/* # ------------------------------- # Copy and install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # ------------------------------- # Optional: Create necessary data directories if not bind-mounted RUN mkdir -p /app/data/input \ /app/data/output1 \ /app/data/output2 \ /app/data/output3 \ /app/data/csv_notes_bs \ /app/data/csv_notes_cfs \ /app/data/csv_notes_pnl \ /app/data/output \ /app/data/output1 \ /app/data/output2 \ /app/data/output3 \ && chmod -R 777 /app/data # ------------------------------- # Set environment variables ENV PYTHONPATH=/app ENV PYTHONUNBUFFERED=1 # ------------------------------- # Expose the port EXPOSE 7860 # ------------------------------- # Start FastAPI app from app.py CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]