| |
| FROM python:3.9-slim |
|
|
| |
| WORKDIR /code |
|
|
| |
| ENV PYTHONDONTWRITEBYTECODE=1 |
| ENV PYTHONUNBUFFERED=1 |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| build-essential \ |
| curl \ |
| software-properties-common \ |
| git \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| COPY requirements.txt /code/requirements.txt |
|
|
| |
| RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt |
|
|
| |
| COPY . /code |
|
|
| |
| RUN mkdir -p /code/data |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| HEALTHCHECK --interval=30s --timeout=30s --start-period=60s --retries=3 \ |
| CMD curl --fail http://localhost:7860/v1/status || exit 1 |
|
|
| |
| CMD ["python", "app.py"] |