Skip to content

Commit

Permalink
Dockerfile (Linux): pyopenjtalkの辞書ダウンロード失敗時にリトライする (#100)
Browse files Browse the repository at this point in the history
* Dockerfile: retry pyopenjtalk dictionary download if failed

* add "each" to comment
  • Loading branch information
aoirint authored Sep 16, 2021
1 parent a5f1af2 commit b8c1c78
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,16 @@ WORKDIR /opt/voicevox_engine
# libsndfile1: soundfile shared object
# ca-certificates: pyopenjtalk dictionary download
# build-essential: pyopenjtalk local build
# parallel: retry download pyopenjtalk dictionary
RUN <<EOF
apt-get update
apt-get install -y \
git \
cmake \
libsndfile1 \
ca-certificates \
build-essential
build-essential \
parallel
apt-get clean
rm -rf /var/lib/apt/lists/*
EOF
Expand Down Expand Up @@ -185,7 +187,12 @@ ADD ./run.py ./check_tts.py ./VERSION.txt ./speakers.json ./LICENSE ./LGPL_LICEN

# Download openjtalk dictionary
RUN <<EOF
gosu user /opt/python/bin/python3 -c "import pyopenjtalk; pyopenjtalk._lazy_init()"
# FIXME: remove first execution delay
# try 5 times, delay 5 seconds before each execution.
# if all tries are failed, `docker build` will be failed.
parallel --retries 5 --delay 5 --ungroup <<EOT
gosu user /opt/python/bin/python3 -c "import pyopenjtalk; pyopenjtalk._lazy_init()"
EOT
EOF

# Update ldconfig on container start
Expand Down

0 comments on commit b8c1c78

Please sign in to comment.