Spaces:
Running
Running
| # # Use a slim Python 3.10 base image | |
| # FROM python:3.10-slim | |
| # # Set working directory | |
| # WORKDIR /app | |
| # # Copy all code and files into the container | |
| # COPY . . | |
| # # Upgrade pip and install dependencies | |
| # RUN pip install --upgrade pip | |
| # RUN pip install --no-cache-dir -r requirements.txt | |
| # # Optional: expose port (HF injects this automatically) | |
| # EXPOSE 7860 | |
| # ENV PORT = 7860 | |
| # # Start the FastAPI app on the HF assigned port | |
| # # CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--proxy-headers"] | |
| # CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |
| # Use slim Python image | |
| FROM python:3.10-slim | |
| # Set workdir | |
| WORKDIR /app | |
| # Copy all files | |
| COPY . . | |
| # Upgrade pip and install requirements | |
| RUN pip install --upgrade pip | |
| RUN pip install -r requirements.txt | |
| RUN apt-get update && apt-get install -y ffmpeg libsndfile1 && rm -rf /var/lib/apt/lists/* | |
| # Expose HF Spaces port | |
| EXPOSE 7860 | |
| # Start the app | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |