FROM python:3.11.9 # rootユーザーのまま依存関係とロケールのインストール RUN apt-get update && apt-get install -y jq tree locales RUN locale-gen ja_JP.UTF-8 # userユーザーを作成 RUN useradd -m -u 1000 user # 環境変数設定 ENV LANG=ja_JP.UTF-8 ENV LANGUAGE=ja_JP:ja ENV LC_ALL=ja_JP.UTF-8 ENV HOME=/home/user ENV PATH=/home/user/.local/bin:$PATH # userユーザーに切り替え USER user WORKDIR $HOME/app COPY --chown=user . $HOME/app # VOICEVOX Coreダウンロードの準備と実行 RUN curl -sSfL https://github.com/VOICEVOX/voicevox_core/releases/latest/download/download-linux-x64 --output download RUN chmod +x ./download RUN echo y | ./download --output voicevox_core # VOICEVOX Engineをクローン RUN git clone --branch master https://github.com/VOICEVOX/voicevox_engine.git voicevox_engine # ---------- Important! Temporary Downgrade to 0.15.x ---------- # Download VOICEVOX Core from 0.15.7 Release RUN curl -sSfL https://github.com/VOICEVOX/voicevox_core/releases/download/0.15.7/download.sh --output download.sh # Give execution permissions RUN chmod +x ./download.sh # Install VOICEVOX Core RUN ./download.sh --output voicevox_core --version 0.15.7 RUN rm -rf voicevox_engine && mkdir voicevox_engine # Clone VOICEVOX Engine from 0.23.0 Repository RUN git clone --branch release-0.23 https://github.com/VOICEVOX/voicevox_engine.git voicevox_engine # ---------- Important! https://github.com/VOICEVOX/voicevox_engine/issues/1568 ---------- # Pythonパッケージをインストール RUN pip install --requirement voicevox_engine/requirements.txt CMD ["python", "voicevox_engine/run.py", "--voicelib_dir", "voicevox_core", "--host", "0.0.0.0", "--port", "7860", "--cors_policy_mode", "all", "--load_all_models"]