Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 23, 2025

This PR resolves Docker compatibility issues that prevented Streamlit applications from running properly in containers, especially on Apple Silicon machines.

Issues Fixed

1. Missing ARM64 Support for Apple Silicon

The Docker release workflows only built AMD64 images, causing compatibility issues on Apple Silicon Macs (M1/M2/M3/M4). Users would get architecture mismatch errors or have to use emulation which is slow and unreliable.

2. Module Import Failures in Docker

When running Streamlit in Docker containers, users encountered:

docker run ks6088ts/template-langgraph:0.0.23 streamlit run template_langgraph/services/streamlits/main.py
# ModuleNotFoundError: No module named 'template_langgraph'

This happened because the Docker container's Python path didn't include the working directory where the template_langgraph module is located.

Solution

Multi-Architecture Docker Builds

  • Updated both .github/workflows/docker-release.yaml and .github/workflows/ghcr-release.yaml to use Docker Buildx
  • Added platforms: linux/amd64,linux/arm64 to build images for both Intel and ARM architectures
  • Images are now published to both Docker Hub and GitHub Container Registry with full architecture support

Fixed Python Module Resolution

  • Added ENV PYTHONPATH="${PYTHONPATH}:/app" to the Dockerfile
  • This ensures Python can find the template_langgraph module without manual path manipulation

Enhanced Developer Experience

  • Added make docker-run-streamlit target for easy one-command execution
  • Updated documentation with comprehensive Docker usage examples
  • Added troubleshooting guidance for common Docker issues

Usage

Users can now run Streamlit apps seamlessly across all platforms:

# Using the new make target
make docker-run-streamlit

# Or directly with Docker
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

The application will be accessible at http://localhost:8501 on both Intel and Apple Silicon machines.

Fixes #156.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] add brief procedure to run streamlit apps on Docker Add Docker multi-architecture support and fix Streamlit module imports Sep 23, 2025
@Copilot Copilot AI requested a review from ks6088ts September 23, 2025 08:17
Copilot finished work on behalf of ks6088ts September 23, 2025 08:17
@ks6088ts ks6088ts marked this pull request as ready for review September 23, 2025 08:30
@ks6088ts ks6088ts merged commit 246c722 into main Sep 23, 2025
4 checks passed
@ks6088ts ks6088ts deleted the copilot/fix-156 branch September 23, 2025 08:33
@ks6088ts ks6088ts restored the copilot/fix-156 branch September 23, 2025 08:33
@ks6088ts ks6088ts deleted the copilot/fix-156 branch September 23, 2025 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add brief procedure to run streamlit apps on Docker
2 participants