Skip to content

Commit 8f2dfe1

Browse files
Copilotks6088ts
andcommitted
Fix Docker multi-architecture support and PYTHONPATH issues
Co-authored-by: ks6088ts <[email protected]>
1 parent 1c18cda commit 8f2dfe1

File tree

4 files changed

+52
-1
lines changed

4 files changed

+52
-1
lines changed

.github/workflows/docker-release.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ on:
66
jobs:
77
release:
88
runs-on: "ubuntu-latest"
9-
timeout-minutes: 5
9+
timeout-minutes: 10
1010
steps:
1111
- name: Check out the repo
1212
uses: actions/checkout@v5
13+
- name: Set up Docker Buildx
14+
uses: docker/setup-buildx-action@v3
1315
- name: Log in to Docker Hub
1416
uses: docker/login-action@v3
1517
with:
@@ -32,6 +34,7 @@ jobs:
3234
uses: docker/build-push-action@v6
3335
with:
3436
context: .
37+
platforms: linux/amd64,linux/arm64
3538
push: true
3639
build-args: |
3740
GIT_REVISION=${{ github.sha }}

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,7 @@ RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
3737
# Copy application code after dependencies are installed
3838
COPY . .
3939

40+
# Set PYTHONPATH to include the working directory for module imports
41+
ENV PYTHONPATH="${PYTHONPATH}:/app"
42+
4043
CMD ["python", "template_langgraph/core.py"]

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ docker-build: ## build Docker image
7676
docker-run: ## run Docker container
7777
docker run --rm $(DOCKER_REPO_NAME)/$(DOCKER_IMAGE_NAME):$(GIT_TAG) $(DOCKER_COMMAND)
7878

79+
.PHONY: docker-run-streamlit
80+
docker-run-streamlit: ## run Docker container with Streamlit app
81+
docker run --rm \
82+
-p 8501:8501 \
83+
-v $(PWD)/.env:/app/.env \
84+
$(DOCKER_REPO_NAME)/$(DOCKER_IMAGE_NAME):$(GIT_TAG) \
85+
streamlit run template_langgraph/services/streamlits/main.py --server.address 0.0.0.0
86+
7987
.PHONY: docker-lint
8088
docker-lint: ## lint Dockerfile
8189
docker run --rm -i hadolint/hadolint < Dockerfile

docs/index.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,43 @@ Demonstration of the Streamlit app:
240240

241241
[![streamlit.png](./images/streamlit.png)](https://youtu.be/undxBwyJ3Sc)
242242

243+
### Option 6: Docker (Production deployment)
244+
245+
You can run the application in Docker for consistent deployment across environments:
246+
247+
#### Building the Docker Image
248+
249+
```shell
250+
# Build the Docker image locally
251+
make docker-build
252+
253+
# Or build with specific tag
254+
docker build -t ks6088ts/template-langgraph:latest .
255+
```
256+
257+
#### Running Streamlit in Docker
258+
259+
```shell
260+
# Run Streamlit app with Docker
261+
make docker-run-streamlit
262+
263+
# Or run manually with environment file
264+
docker run --rm \
265+
-p 8501:8501 \
266+
-v ./.env:/app/.env \
267+
ks6088ts/template-langgraph:latest \
268+
streamlit run template_langgraph/services/streamlits/main.py --server.address 0.0.0.0
269+
```
270+
271+
#### Multi-Architecture Support
272+
273+
The Docker images are built for both `amd64` and `arm64` architectures, making them compatible with:
274+
- Intel/AMD x64 processors
275+
- Apple Silicon (M1/M2/M3/M4) processors
276+
- ARM-based servers
277+
278+
Access the Streamlit app at [http://localhost:8501](http://localhost:8501) after running the container.
279+
243280
### More agent runs
244281

245282
- Issue formatter (structured output):

0 commit comments

Comments
 (0)