Spaces:
Sleeping
Sleeping
| # Use Debian as base for reliable MSSQL support | |
| FROM debian:bullseye-slim | |
| # Set environment variables | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| ENV PYTHONUNBUFFERED=1 | |
| WORKDIR /app | |
| # Install Python + system dependencies | |
| RUN apt-get update && \ | |
| apt-get install -y curl gnupg2 unixodbc unixodbc-dev gcc g++ python3 python3-pip python3-dev | |
| # Add Microsoft ODBC Driver 17 repo | |
| RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \ | |
| curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list && \ | |
| apt-get update && \ | |
| ACCEPT_EULA=Y apt-get install -y msodbcsql17 | |
| # Copy dependencies and install Python packages | |
| COPY requirements.txt . | |
| RUN pip3 install --upgrade pip | |
| RUN pip3 install --no-cache-dir -r requirements.txt | |
| # Copy app files | |
| COPY . . | |
| # Expose FastAPI port | |
| EXPOSE 7860 | |
| # Run FastAPI app | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |