Spaces:
Running
on
Zero
Running
on
Zero
| # Dockerfile for local development only | |
| # NOTE: Hugging Face Spaces uses Gradio SDK (not Docker) for ZeroGPU support | |
| # This Dockerfile is provided for local testing and development purposes | |
| FROM nvidia/cuda:12.4.0-cudnn-devel-ubuntu22.04 | |
| # 環境変数 | |
| ENV DEBIAN_FRONTEND=noninteractive \ | |
| PYTHONUNBUFFERED=1 \ | |
| GRADIO_SERVER_NAME=0.0.0.0 \ | |
| GRADIO_SERVER_PORT=7860 | |
| # システムパッケージの更新とPython 3.13のインストール | |
| RUN apt-get update && apt-get install -y \ | |
| software-properties-common \ | |
| wget \ | |
| git \ | |
| && add-apt-repository ppa:deadsnakes/ppa \ | |
| && apt-get update \ | |
| && apt-get install -y \ | |
| python3.13 \ | |
| python3.13-dev \ | |
| python3.13-venv \ | |
| python3-pip \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Python 3.13をデフォルトに設定 | |
| RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.13 1 \ | |
| && update-alternatives --install /usr/bin/python python /usr/bin/python3.13 1 | |
| # pipのアップグレード | |
| RUN python3 -m pip install --upgrade pip setuptools wheel | |
| # 作業ディレクトリ | |
| WORKDIR /app | |
| # 依存関係をコピーしてインストール | |
| COPY requirements.txt . | |
| RUN python3 -m pip install --no-cache-dir -r requirements.txt | |
| # アプリケーションファイルをコピー | |
| COPY . . | |
| # ポート公開 | |
| EXPOSE 7860 | |
| # 起動コマンド | |
| CMD ["python3", "app.py"] | |