Skip to content

Commit 65a88fb

Browse files
committed
experimental: fix DockerfileHierarchical
1 parent a038dd9 commit 65a88fb

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

DockerfileHierarchical

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,44 @@
1-
# ベースイメージとしてPythonとNode.jsを含むイメージを使用
21
FROM python:3.10-slim
32

43
# 作業ディレクトリを設定
54
WORKDIR /app
65

76
# 必要なシステムパッケージをインストール
8-
RUN apt-get update && apt-get install -y curl gcc build-essential && rm -rf /var/lib/apt/lists/*
7+
RUN apt-get update && apt-get install -y \
8+
curl \
9+
gcc \
10+
build-essential \
11+
&& apt-get clean \
12+
&& rm -rf /var/lib/apt/lists/*
913

1014
# Node.jsをインストール
1115
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
12-
&& apt-get install -y nodejs
16+
&& apt-get install -y nodejs \
17+
&& apt-get clean \
18+
&& rm -rf /var/lib/apt/lists/*
1319

14-
# プロジェクトのファイルをコピー
15-
COPY . .
20+
# プロジェクトの依存関係ファイルをコピー
21+
COPY scatter/requirements.txt scatter/requirements.txt
22+
COPY scatter/report/package.json scatter/report/package.json
23+
COPY scatter/report/package-lock.json scatter/report/package-lock.json
1624

1725
# Pythonの依存関係をインストール
1826
RUN pip install --no-cache-dir -r scatter/requirements.txt
1927

2028
# JavaScriptの依存関係をインストール
2129
RUN cd scatter/report && npm install
2230

31+
# プロジェクトのファイルをコピー
32+
COPY . .
33+
2334
# NLTKのデータをダウンロード
2435
RUN python -c "import nltk; nltk.download('stopwords')"
2536

26-
# 環境変数を設定
27-
ENV REPORT=${REPORT}
28-
ENV OPENAI_API_KEY=${OPENAI_API_KEY}
29-
3037
# パイプラインを実行し、レポートを生成
31-
CMD ["bash", "-c", "cd scatter/pipeline && python hierarchical_main.py configs/${REPORT}.json --skip-interaction && cd outputs/${REPORT}/report && python -m http.server 8000"]
38+
RUN cd scatter/pipeline && python hierarchical_main.py configs/${REPORT}.json --skip-interaction
39+
40+
# ポートを公開
41+
EXPOSE 8080
42+
43+
# ホスティングのためのエントリーポイント
44+
CMD ["sh", "-c", "cd outputs/${REPORT}/report && python -m http.server 8080"]

0 commit comments

Comments
 (0)