Spaces:
Sleeping
Sleeping
| #FROM python:3.11 | |
| #WORKDIR /app | |
| #COPY requirements.txt . | |
| #RUN pip install -r requirements.txt | |
| #COPY . . | |
| #CMD ["uvicorn","app.main:app","--host","0.0.0.0","--port","7860"] | |
| FROM python:3.11 | |
| # Inside the container, we'll work from /app. This is just a path. | |
| WORKDIR /app | |
| # Install dependencies first (better layer caching) | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy your source files | |
| COPY . . | |
| # Helpful envs | |
| ENV PYTHONUNBUFFERED=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 | |
| RUN mkdir -p /data && chmod -R 777 /data | |
| # Expose your port (change if you prefer 8000) | |
| EXPOSE 7860 | |
| # Run Uvicorn pointing to your ASGI app in main.py | |
| # Using `python -m uvicorn` is more reliable in containers | |
| CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |