|
|
FROM python:3.11-slim |
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \ |
|
|
build-essential \ |
|
|
git \ |
|
|
curl \ |
|
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
|
|
|
COPY requirements.txt /app/requirements.txt |
|
|
RUN pip install --no-cache-dir -U pip \ |
|
|
&& pip install --no-cache-dir -r /app/requirements.txt |
|
|
|
|
|
|
|
|
ENV XDG_CACHE_HOME=/tmp/.cache |
|
|
|
|
|
|
|
|
COPY . /app |
|
|
|
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --retries=3 \ |
|
|
CMD curl -f http://localhost:${PORT:-7860}/health || exit 1 |
|
|
|
|
|
|
|
|
EXPOSE 7860 |
|
|
ENV PORT=7860 \ |
|
|
PYTHONUNBUFFERED=1 |
|
|
|
|
|
CMD ["sh", "-c", "uvicorn app:app --host 0.0.0.0 --port ${PORT:-7860} --log-level info"] |