Corin1998's picture
Update Dockerfile
f93a922 verified
raw
history blame contribute delete
761 Bytes
FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
ENV PORT=7860
# FastAPI のエントリ
ENV APP_MODULE=app.main:app
# UMAP/Numba のキャッシュ絡み対策(HF 環境での既知回避)
ENV NUMBA_CACHE_DIR=/tmp/numba_cache
ENV NUMBA_DISABLE_CACHING=1
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential g++ git curl && \
rm -rf /var/lib/apt/lists/* && \
mkdir -p /tmp/numba_cache && chmod -R 777 /tmp/numba_cache
COPY requirements.txt /app/
RUN pip install -U pip && pip install -r requirements.txt
COPY . /app
# start.sh は使わず uvicorn を直起動
CMD uvicorn ${APP_MODULE} --host 0.0.0.0 --port ${PORT} --proxy-headers