# ベースイメージを指定 FROM python:3.11-slim RUN apt-get update -y && apt-get upgrade -y && apt-get install -y ffmpeg RUN apt-get update -y && apt-get upgrade -y && apt-get install --reinstall -y wget RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb && dpkg -i cuda-keyring_1.0-1_all.deb && apt-get update -y && apt-get upgrade -y && apt-get install -y libcudnn8 libcudnn8-dev # Set up a new user named "user" with user ID 1000 RUN useradd -m -u 1000 user # Switch to the "user" user USER user # Set home to the user"s home directory ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH # 作業ディレクトリを設定 WORKDIR $HOME/app # 必要なパッケージをインストール COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # アプリケーションのソースコードをコピー COPY --chown=user . $HOME/app # .cacheディレクトリを作成 RUN mkdir -p .cache # サーバーを起動するコマンドを指定 CMD ["python", "app.py", "--host", "0.0.0.0", "--port", "7860", "--lan", "en", "--model", "tiny", "--min-chunk-size", "1.5", "--generate-audio", "True"] # CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]