| FROM python:3.10-slim |
|
|
| WORKDIR /app |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| libgl1 \ |
| libglib2.0-0 \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| COPY requirements.txt . |
| RUN pip install --no-cache-dir -r requirements.txt |
| RUN pip install --no-cache-dir huggingface_hub |
|
|
| COPY . . |
|
|
| |
| CMD python -c "from huggingface_hub import snapshot_download;import os;snapshot_download(repo_id='William941008/air-quality-model',local_dir='./models',token=os.getenv('AirPollutionToken'))" && uvicorn main:app --host 0.0.0.0 --port 7860 |