Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files1233445678910111213143 unmodified lines1819201421222324172526192728292130313224333435363738293940# Pythonの軽量版を使用FROM python:3.10-slim
# Install system dependenciesRUN apt-get update && apt-get install -y \# 環境変数の設定# .pycファイルを作成しないようにするENV PYTHONDONTWRITEBYTECODE=1# 標準出力をバッファリングせず、リアルタイムにログを表示ENV PYTHONUNBUFFERED=1
# システム依存関係のインストールとクリーンアップRUN apt-get update && apt-get install -y --no-install-recommends \ ffmpeg \ poppler-utils \ libheif-dev \3 unmodified lines
WORKDIR /app
# Setup temporary directory# 一時ディレクトリの作成と権限設定# Hugging Face SpacesはユーザーID 1000で実行されるため、そのユーザーが書き込めるようにするRUN mkdir -p /tmp/media_master && chmod 777 /tmp/media_master
# Install Python libraries# 依存ライブラリのインストールCOPY requirements.txt .RUN pip install --no-cache-dir -r requirements.txtRUN pip install --no-cache-dir -U pip && \ pip install --no-cache-dir -r requirements.txt
# Copy application files# アプリケーションファイルのコピーCOPY . .
# Set permissions for the app directory# セキュリティと動作のため、/app 全体に権限を付与 (Hugging Faceの慣習)RUN chmod -R 777 /app
# デフォルトのポートEXPOSE 7860
# Run the application# アプリケーションの起動CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]Dockerfile+18-8