| FROM python:3.11-slim |
|
|
| WORKDIR /app |
|
|
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| build-essential \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| COPY requirements.txt . |
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| COPY . . |
|
|
| ENV API_BASE_URL=https://api.openai.com/v1 |
| ENV MODEL_NAME=gpt-4o-mini |
| ENV PORT=7860 |
|
|
| EXPOSE 7860 |
|
|
| HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ |
| CMD python -c "import requests; requests.get('http://localhost:7860/health').raise_for_status()" |
|
|
| CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"] |
|
|