Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/docker-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ghcr-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -43,5 +45,6 @@ jobs:
with:
push: true
context: .
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
52 changes: 52 additions & 0 deletions docs/index.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(構造化出力):
Expand Down
57 changes: 57 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,63 @@ 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
```

#### 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:
- 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):
Expand Down