Commit ·
d93a08f
1
Parent(s): f945e3e
feat: Add development Dockerfile and update devcontainer configuration
Browse files
.devcontainer/Dockerfile.dev
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Development Dockerfile for Yomitalk
|
| 2 |
+
# Based on the production Dockerfile but includes development tools
|
| 3 |
+
|
| 4 |
+
FROM python:3.11-slim
|
| 5 |
+
|
| 6 |
+
WORKDIR /app
|
| 7 |
+
|
| 8 |
+
# VOICEVOX規約に自動同意するための環境変数を設定
|
| 9 |
+
ENV VOICEVOX_ACCEPT_AGREEMENT=true
|
| 10 |
+
# 対話型プロンプトを無効化し、ページャーをcatに置き換える
|
| 11 |
+
ENV PAGER=cat
|
| 12 |
+
ENV LESSCHARSET=utf-8
|
| 13 |
+
|
| 14 |
+
# システム依存パッケージのインストール(開発用ツールを追加)
|
| 15 |
+
RUN apt-get update \
|
| 16 |
+
&& apt-get install -y --no-install-recommends \
|
| 17 |
+
make \
|
| 18 |
+
sudo \
|
| 19 |
+
curl \
|
| 20 |
+
ffmpeg \
|
| 21 |
+
git \
|
| 22 |
+
wget \
|
| 23 |
+
unzip \
|
| 24 |
+
build-essential \
|
| 25 |
+
pkg-config \
|
| 26 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 27 |
+
|
| 28 |
+
# リポジトリのコードをコピー
|
| 29 |
+
COPY . /app/
|
| 30 |
+
|
| 31 |
+
# Python依存関係のインストール(Docker内では仮想環境を使わない)
|
| 32 |
+
RUN pip install --upgrade pip
|
| 33 |
+
|
| 34 |
+
# 開発用依存関係をインストール
|
| 35 |
+
RUN pip install --timeout 300 --retries 3 \
|
| 36 |
+
pre-commit \
|
| 37 |
+
playwright \
|
| 38 |
+
pytest \
|
| 39 |
+
pytest-playwright \
|
| 40 |
+
pytest-bdd \
|
| 41 |
+
pytest-asyncio \
|
| 42 |
+
pytest-mock \
|
| 43 |
+
black \
|
| 44 |
+
isort \
|
| 45 |
+
flake8 \
|
| 46 |
+
mypy \
|
| 47 |
+
autoflake \
|
| 48 |
+
autopep8
|
| 49 |
+
|
| 50 |
+
# 大きなパッケージを段階的にインストール
|
| 51 |
+
# PyTorch関連のパッケージを先にインストール
|
| 52 |
+
RUN pip install --timeout 600 --retries 5 torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
|
| 53 |
+
|
| 54 |
+
# 残りの依存関係をインストール
|
| 55 |
+
RUN pip install --timeout 300 --retries 3 -r requirements.txt
|
| 56 |
+
|
| 57 |
+
# パーミッション問題を解決するため、dataディレクトリの権限を設定
|
| 58 |
+
RUN mkdir -p /app/data/temp /app/data/output && chmod -R 777 /app/data
|
| 59 |
+
|
| 60 |
+
# ポート設定
|
| 61 |
+
ENV PORT=7860
|
| 62 |
+
|
| 63 |
+
# 開発環境では setup.sh が VOICEVOX Core のセットアップを行うため、
|
| 64 |
+
# ここではスキップ(マウントされたボリュームにインストールされる)
|
| 65 |
+
|
| 66 |
+
# 開発環境用の起動コマンド(実際にはdevcontainerのpostCreateCommandでsetup.shが実行される)
|
| 67 |
+
CMD ["python", "app.py"]
|
.devcontainer/devcontainer.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"name": "Yomitalk Development Environment",
|
| 3 |
"build": {
|
| 4 |
-
"dockerfile": "
|
| 5 |
"context": ".."
|
| 6 |
},
|
| 7 |
"workspaceFolder": "/app",
|
|
|
|
| 1 |
{
|
| 2 |
"name": "Yomitalk Development Environment",
|
| 3 |
"build": {
|
| 4 |
+
"dockerfile": "Dockerfile.dev",
|
| 5 |
"context": ".."
|
| 6 |
},
|
| 7 |
"workspaceFolder": "/app",
|