Spaces:
Sleeping
Sleeping
File size: 852 Bytes
cc571ea |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
FROM python:3.10-slim
ENV PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
HF_HOME=/root/.cache/huggingface
# 必要最低限のOSパッケージ
RUN apt-get update && apt-get install -y --no-install-recommends \
git curl ca-certificates build-essential \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# 依存インストール(分けてキャッシュを効かせる)
COPY requirements.txt /app/requirements.txt
RUN pip install --upgrade pip && pip install -r /app/requirements.txt
# アプリ本体
COPY app.py /app/app.py
COPY modules /app/modules
COPY .env.example /app/.env.example
# ポート(HF側で割り当てられるが、明示しておく)
ENV PORT=7860
EXPOSE 7860
# Uvicorn で FastAPI(+Gradio) を明示起動
CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--log-level", "info"]
|