Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +18 -32
Dockerfile
CHANGED
|
@@ -1,49 +1,35 @@
|
|
| 1 |
-
# Use the official Python 3.11.9 image
|
| 2 |
FROM python:3.11.9
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
RUN apt-get update && apt-get install -y jq
|
| 6 |
-
RUN apt-get update && apt-get install -y tree
|
| 7 |
-
|
| 8 |
-
# Set up a new user named "user" with user ID 1000
|
| 9 |
-
RUN useradd -m -u 1000 user
|
| 10 |
-
|
| 11 |
-
# Set the home to the user's home directory and add user's local bin to PATH
|
| 12 |
-
ENV HOME=/home/user \
|
| 13 |
-
PATH=/home/user/.local/bin:$PATH
|
| 14 |
-
|
| 15 |
-
# Switch to the "user" user
|
| 16 |
-
USER user
|
| 17 |
-
|
| 18 |
-
# Create the app directory
|
| 19 |
-
WORKDIR $HOME/app
|
| 20 |
-
|
| 21 |
-
# Copy the application code and the requirements.txt file
|
| 22 |
-
COPY --chown=user . $HOME/app
|
| 23 |
-
|
| 24 |
-
# ---------- Important! https://github.com/VOICEVOX/voicevox_core/issues/1000 ----------
|
| 25 |
-
|
| 26 |
-
# Download VOICEVOX Core from latest Release
|
| 27 |
-
RUN curl -sSfL https://github.com/VOICEVOX/voicevox_core/releases/latest/download/download-linux-x64 --output download
|
| 28 |
-
|
| 29 |
RUN apt-get update && apt-get install -y jq tree locales
|
| 30 |
RUN locale-gen ja_JP.UTF-8
|
| 31 |
|
| 32 |
-
#
|
| 33 |
RUN useradd -m -u 1000 user
|
| 34 |
|
|
|
|
| 35 |
ENV LANG=ja_JP.UTF-8
|
| 36 |
ENV LANGUAGE=ja_JP:ja
|
| 37 |
ENV LC_ALL=ja_JP.UTF-8
|
|
|
|
|
|
|
| 38 |
|
|
|
|
| 39 |
USER user
|
| 40 |
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
RUN echo y | ./download --output voicevox_core
|
| 43 |
|
| 44 |
-
#
|
| 45 |
RUN git clone --branch master https://github.com/VOICEVOX/voicevox_engine.git voicevox_engine
|
| 46 |
|
|
|
|
| 47 |
# ---------- Important! Temporary Downgrade to 0.15.x ----------
|
| 48 |
|
| 49 |
# Download VOICEVOX Core from 0.15.7 Release
|
|
@@ -60,8 +46,8 @@ RUN git clone --branch master https://github.com/VOICEVOX/voicevox_engine.git vo
|
|
| 60 |
|
| 61 |
# ---------- Important! https://github.com/VOICEVOX/voicevox_engine/issues/1568 ----------
|
| 62 |
|
| 63 |
-
|
|
|
|
| 64 |
RUN pip install --requirement voicevox_engine/requirements.txt
|
| 65 |
|
| 66 |
-
|
| 67 |
-
CMD ["python", "voicevox_engine/run.py", "--voicelib_dir", "voicevox_core", "--host", "0.0.0.0", "--port", "7860", "--cors_policy_mode", "all"]
|
|
|
|
|
|
|
| 1 |
FROM python:3.11.9
|
| 2 |
|
| 3 |
+
# rootユーザーのまま依存関係とロケールのインストール
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
RUN apt-get update && apt-get install -y jq tree locales
|
| 5 |
RUN locale-gen ja_JP.UTF-8
|
| 6 |
|
| 7 |
+
# userユーザーを作成
|
| 8 |
RUN useradd -m -u 1000 user
|
| 9 |
|
| 10 |
+
# 環境変数設定
|
| 11 |
ENV LANG=ja_JP.UTF-8
|
| 12 |
ENV LANGUAGE=ja_JP:ja
|
| 13 |
ENV LC_ALL=ja_JP.UTF-8
|
| 14 |
+
ENV HOME=/home/user
|
| 15 |
+
ENV PATH=/home/user/.local/bin:$PATH
|
| 16 |
|
| 17 |
+
# userユーザーに切り替え
|
| 18 |
USER user
|
| 19 |
|
| 20 |
+
WORKDIR $HOME/app
|
| 21 |
+
|
| 22 |
+
COPY --chown=user . $HOME/app
|
| 23 |
+
|
| 24 |
+
# VOICEVOX Coreダウンロードの準備と実行
|
| 25 |
+
RUN curl -sSfL https://github.com/VOICEVOX/voicevox_core/releases/latest/download/download-linux-x64 --output download
|
| 26 |
+
RUN chmod +x ./download
|
| 27 |
RUN echo y | ./download --output voicevox_core
|
| 28 |
|
| 29 |
+
# VOICEVOX Engineをクローン
|
| 30 |
RUN git clone --branch master https://github.com/VOICEVOX/voicevox_engine.git voicevox_engine
|
| 31 |
|
| 32 |
+
|
| 33 |
# ---------- Important! Temporary Downgrade to 0.15.x ----------
|
| 34 |
|
| 35 |
# Download VOICEVOX Core from 0.15.7 Release
|
|
|
|
| 46 |
|
| 47 |
# ---------- Important! https://github.com/VOICEVOX/voicevox_engine/issues/1568 ----------
|
| 48 |
|
| 49 |
+
|
| 50 |
+
# Pythonパッケージをインストール
|
| 51 |
RUN pip install --requirement voicevox_engine/requirements.txt
|
| 52 |
|
| 53 |
+
CMD ["python", "voicevox_engine/run.py", "--voicelib_dir", "voicevox_core", "--host", "0.0.0.0", "--port", "7860", "--cors_policy_mode", "all"]
|
|
|