From 1c18cda09f360877a99ddbe5ee2f7cce62fd0d3e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 23 Sep 2025 08:07:23 +0000 Subject: [PATCH 1/4] Initial plan From 8f2dfe1acb0bb8f0539e8ec8e5df811a848eefc1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 23 Sep 2025 08:13:01 +0000 Subject: [PATCH 2/4] Fix Docker multi-architecture support and PYTHONPATH issues Co-authored-by: ks6088ts <1254960+ks6088ts@users.noreply.github.com> --- .github/workflows/docker-release.yaml | 5 +++- Dockerfile | 3 +++ Makefile | 8 ++++++ docs/index.md | 37 +++++++++++++++++++++++++++ 4 files changed, 52 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-release.yaml b/.github/workflows/docker-release.yaml index 94bc474..40f1979 100644 --- a/.github/workflows/docker-release.yaml +++ b/.github/workflows/docker-release.yaml @@ -6,10 +6,12 @@ on: jobs: release: runs-on: "ubuntu-latest" - timeout-minutes: 5 + timeout-minutes: 10 steps: - name: Check out the repo uses: actions/checkout@v5 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Log in to Docker Hub uses: docker/login-action@v3 with: @@ -32,6 +34,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . + platforms: linux/amd64,linux/arm64 push: true build-args: | GIT_REVISION=${{ github.sha }} diff --git a/Dockerfile b/Dockerfile index 44974f7..3384fc8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,4 +37,7 @@ RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt # Copy application code after dependencies are installed COPY . . +# Set PYTHONPATH to include the working directory for module imports +ENV PYTHONPATH="${PYTHONPATH}:/app" + CMD ["python", "template_langgraph/core.py"] diff --git a/Makefile b/Makefile index fbc6224..bd2ae48 100644 --- a/Makefile +++ b/Makefile @@ -76,6 +76,14 @@ docker-build: ## build Docker image docker-run: ## run Docker container docker run --rm $(DOCKER_REPO_NAME)/$(DOCKER_IMAGE_NAME):$(GIT_TAG) $(DOCKER_COMMAND) +.PHONY: docker-run-streamlit +docker-run-streamlit: ## run Docker container with Streamlit app + docker run --rm \ + -p 8501:8501 \ + -v $(PWD)/.env:/app/.env \ + $(DOCKER_REPO_NAME)/$(DOCKER_IMAGE_NAME):$(GIT_TAG) \ + streamlit run template_langgraph/services/streamlits/main.py --server.address 0.0.0.0 + .PHONY: docker-lint docker-lint: ## lint Dockerfile docker run --rm -i hadolint/hadolint < Dockerfile diff --git a/docs/index.md b/docs/index.md index 6dcdae6..a258231 100644 --- a/docs/index.md +++ b/docs/index.md @@ -240,6 +240,43 @@ Demonstration of the Streamlit app: [![streamlit.png](./images/streamlit.png)](https://youtu.be/undxBwyJ3Sc) +### Option 6: Docker (Production deployment) + +You can run the application in Docker for consistent deployment across environments: + +#### Building the Docker Image + +```shell +# Build the Docker image locally +make docker-build + +# Or build with specific tag +docker build -t ks6088ts/template-langgraph:latest . +``` + +#### Running Streamlit in Docker + +```shell +# Run Streamlit app with Docker +make docker-run-streamlit + +# Or run manually with environment file +docker run --rm \ + -p 8501:8501 \ + -v ./.env:/app/.env \ + ks6088ts/template-langgraph:latest \ + streamlit run template_langgraph/services/streamlits/main.py --server.address 0.0.0.0 +``` + +#### Multi-Architecture Support + +The Docker images are built for both `amd64` and `arm64` architectures, making them compatible with: +- Intel/AMD x64 processors +- Apple Silicon (M1/M2/M3/M4) processors +- ARM-based servers + +Access the Streamlit app at [http://localhost:8501](http://localhost:8501) after running the container. + ### More agent runs - Issue formatter (structured output): From ad40c585930051f64790ea80af7f4eef97855dc8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 23 Sep 2025 08:15:06 +0000 Subject: [PATCH 3/4] Add multi-architecture support to GHCR workflow and enhance documentation Co-authored-by: ks6088ts <1254960+ks6088ts@users.noreply.github.com> --- .github/workflows/ghcr-release.yaml | 5 ++++- docs/index.md | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ghcr-release.yaml b/.github/workflows/ghcr-release.yaml index fa264cf..7d55b80 100644 --- a/.github/workflows/ghcr-release.yaml +++ b/.github/workflows/ghcr-release.yaml @@ -8,12 +8,14 @@ env: jobs: ghcr: runs-on: ubuntu-latest - timeout-minutes: 5 + timeout-minutes: 10 permissions: packages: write contents: read steps: - uses: actions/checkout@v5 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - uses: docker/login-action@v3 with: registry: ghcr.io @@ -43,5 +45,6 @@ jobs: with: push: true context: . + platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/docs/index.md b/docs/index.md index a258231..cb4f6f0 100644 --- a/docs/index.md +++ b/docs/index.md @@ -268,6 +268,26 @@ docker run --rm \ streamlit run template_langgraph/services/streamlits/main.py --server.address 0.0.0.0 ``` +#### Using Pre-built Images + +You can also use pre-built images from Docker Hub or GitHub Container Registry: + +```shell +# From Docker Hub +docker run --rm \ + -p 8501:8501 \ + -v ./.env:/app/.env \ + ks6088ts/template-langgraph:latest \ + streamlit run template_langgraph/services/streamlits/main.py --server.address 0.0.0.0 + +# From GitHub Container Registry +docker run --rm \ + -p 8501:8501 \ + -v ./.env:/app/.env \ + ghcr.io/ks6088ts-labs/template-langgraph:latest \ + streamlit run template_langgraph/services/streamlits/main.py --server.address 0.0.0.0 +``` + #### Multi-Architecture Support The Docker images are built for both `amd64` and `arm64` architectures, making them compatible with: From 8c1462e43332f2b724b9c67332b974238364df8c Mon Sep 17 00:00:00 2001 From: ks6088ts Date: Tue, 23 Sep 2025 17:29:41 +0900 Subject: [PATCH 4/4] =?UTF-8?q?gen:=20#file:index.md=20=E3=81=AE=20option?= =?UTF-8?q?=206=20=E3=81=8C=E3=81=9D=E3=81=AE=E6=97=A5=E6=9C=AC=E8=AA=9E?= =?UTF-8?q?=E8=A8=B3=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=20#file:index.ja.?= =?UTF-8?q?md=20=E3=81=AB=E7=84=A1=E3=81=84=E3=81=AE=E3=81=A7=E8=BF=BD?= =?UTF-8?q?=E8=A8=98=E3=81=97=E3=81=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/index.ja.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/docs/index.ja.md b/docs/index.ja.md index ef19e9a..f4642f9 100644 --- a/docs/index.ja.md +++ b/docs/index.ja.md @@ -240,6 +240,58 @@ Streamlit アプリのデモ: [![streamlit.png](./images/streamlit.png)](https://youtu.be/undxBwyJ3Sc) +### オプション 6: Docker(本番デプロイ) + +アプリケーションを Docker で実行すると、環境差による違いを減らし、一貫したデプロイが可能になります。ここではイメージのビルド、Streamlit のコンテナ実行、事前ビルド済みイメージの利用、マルチアーキテクチャ対応について説明します。 + +#### Docker イメージのビルド + +```shell +# ローカルで Docker イメージをビルド +make docker-build + +# または特定のタグでビルド +docker build -t ks6088ts/template-langgraph:latest . +``` + +#### Streamlit を Docker で実行 + +```shell +# Docker で Streamlit アプリを実行する(Makefile ターゲット) +make docker-run-streamlit + +# または .env をコンテナにマウントして手動で実行 +docker run --rm \ + -p 8501:8501 \ + -v ./.env:/app/.env \ + ks6088ts/template-langgraph:latest \ + streamlit run template_langgraph/services/streamlits/main.py --server.address 0.0.0.0 +``` + +#### 事前ビルド済みイメージの使用 + +```shell +# Docker Hub から実行 +docker run --rm \ + -p 8501:8501 \ + -v ./.env:/app/.env \ + ks6088ts/template-langgraph:latest \ + streamlit run template_langgraph/services/streamlits/main.py --server.address 0.0.0.0 + +# GitHub Container Registry から実行 +docker run --rm \ + -p 8501:8501 \ + -v ./.env:/app/.env \ + ghcr.io/ks6088ts-labs/template-langgraph:latest \ + streamlit run template_langgraph/services/streamlits/main.py --server.address 0.0.0.0 +``` + +#### マルチアーキテクチャ対応 + +このリポジトリの Docker イメージは `amd64` と `arm64` 両アーキテクチャ向けにビルドされています。これにより、Intel/AMD の x64 マシンや Apple Silicon(M1/M2/M3/M4)などの ARM 環境でも動作します。 + +コンテナを起動したら、ブラウザで [http://localhost:8501](http://localhost:8501) にアクセスして Streamlit アプリを確認できます。 + ### 追加の実行例 - Issue formatter(構造化出力):