From 1cabb27dcb0eba70508871cacc59c34473c6d160 Mon Sep 17 00:00:00 2001 From: ks6088ts Date: Sat, 23 Aug 2025 09:03:42 +0900 Subject: [PATCH 1/2] rename compose file --- docker-compose.yml => tools.docker-compose.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docker-compose.yml => tools.docker-compose.yml (100%) diff --git a/docker-compose.yml b/tools.docker-compose.yml similarity index 100% rename from docker-compose.yml rename to tools.docker-compose.yml From 9f8b201f8ef4d4b0fa07a1f42907703cf8b08686 Mon Sep 17 00:00:00 2001 From: ks6088ts Date: Sat, 23 Aug 2025 09:06:17 +0900 Subject: [PATCH 2/2] uv run langgraph dockerfile --add-docker-compose langgraph.Dockerfile --- .dockerignore | 48 +++++++++++++++++++++++++++++++++---- docker-compose.yml | 56 ++++++++++++++++++++++++++++++++++++++++++++ langgraph.Dockerfile | 26 ++++++++++++++++++++ 3 files changed, 125 insertions(+), 5 deletions(-) create mode 100644 docker-compose.yml create mode 100644 langgraph.Dockerfile diff --git a/.dockerignore b/.dockerignore index 281e568..2e4935a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,13 +1,51 @@ +# Ignore node_modules and other dependency directories +node_modules +bower_components +vendor + +# Ignore logs and temporary files +*.log +*.tmp +*.swp + +# Ignore .env files and other environment files +.env +.env.* +*.local + +# Ignore git-related files .git +.gitignore + +# Ignore Docker-related files and configs +.dockerignore +docker-compose.yml + +# Ignore build and cache directories +dist +build +.cache +__pycache__ + +# Ignore IDE and editor configurations +.vscode +.idea +*.sublime-project +*.sublime-workspace +.DS_Store # macOS-specific + +# Ignore test and coverage files +coverage +*.coverage +*.test.js +*.spec.js +tests + +# Project .github .venv *.pyc -*.env -.coverage .devcontainer -.gitignore .pre-commit-config.yaml .pytest_cache .ruff_cache -__pycache__ -tests diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..15d6d7f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,56 @@ +volumes: + langgraph-data: + driver: local + +services: + langgraph-redis: + image: redis:6 + healthcheck: + test: redis-cli ping + interval: 5s + timeout: 1s + retries: 5 + + langgraph-postgres: + image: pgvector/pgvector:pg16 + ports: + - "5433:5432" + environment: + POSTGRES_DB: postgres + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + command: + - postgres + - -c + - shared_preload_libraries=vector + volumes: + - langgraph-data:/var/lib/postgresql/data + healthcheck: + test: pg_isready -U postgres + start_period: 10s + timeout: 1s + retries: 5 + interval: 60s + start_interval: 1s + + langgraph-api: + ports: + - "8123:8000" + depends_on: + langgraph-redis: + condition: service_healthy + langgraph-postgres: + condition: service_healthy + environment: + REDIS_URI: redis://langgraph-redis:6379 + POSTGRES_URI: postgres://postgres:postgres@langgraph-postgres:5432/postgres?sslmode=disable + healthcheck: + test: python /api/healthcheck.py + interval: 60s + start_interval: 1s + start_period: 10s + env_file: + - .env + build: + context: . + dockerfile: langgraph.Dockerfile diff --git a/langgraph.Dockerfile b/langgraph.Dockerfile new file mode 100644 index 0000000..b62ea66 --- /dev/null +++ b/langgraph.Dockerfile @@ -0,0 +1,26 @@ +FROM langchain/langgraph-api:3.11 + + + +# -- Adding local package . -- +ADD . /deps/template-langgraph +# -- End of local package . -- + +# -- Installing all local dependencies -- +RUN PYTHONDONTWRITEBYTECODE=1 uv pip install --system --no-cache-dir -c /api/constraints.txt -e /deps/* +# -- End of local dependencies install -- +ENV LANGSERVE_GRAPHS='{"chat_with_tools_agent": "template_langgraph.agents.chat_with_tools_agent.agent:graph", "demo_agents_parallel_rag_agent": "template_langgraph.agents.demo_agents.parallel_rag_agent.agent:graph", "demo_agents_multi_agent": "template_langgraph.agents.demo_agents.multi_agent:graph", "demo_agents_research_deep_agent": "template_langgraph.agents.demo_agents.research_deep_agent:graph", "demo_agents_weather_agent": "template_langgraph.agents.demo_agents.weather_agent:graph", "image_classifier_agent": "template_langgraph.agents.image_classifier_agent.agent:graph", "issue_formatter_agent": "template_langgraph.agents.issue_formatter_agent.agent:graph", "kabuto_helpdesk_agent": "template_langgraph.agents.kabuto_helpdesk_agent.agent:graph", "news_summarizer_agent": "template_langgraph.agents.news_summarizer_agent.agent:graph", "supervisor_agent": "template_langgraph.agents.supervisor_agent.agent:graph", "task_decomposer_agent": "template_langgraph.agents.task_decomposer_agent.agent:graph"}' + + + +# -- Ensure user deps didn't inadvertently overwrite langgraph-api +RUN mkdir -p /api/langgraph_api /api/langgraph_runtime /api/langgraph_license && touch /api/langgraph_api/__init__.py /api/langgraph_runtime/__init__.py /api/langgraph_license/__init__.py +RUN PYTHONDONTWRITEBYTECODE=1 uv pip install --system --no-cache-dir --no-deps -e /api +# -- End of ensuring user deps didn't inadvertently overwrite langgraph-api -- +# -- Removing build deps from the final image ~<:===~~~ -- +RUN pip uninstall -y pip setuptools wheel +RUN rm -rf /usr/local/lib/python*/site-packages/pip* /usr/local/lib/python*/site-packages/setuptools* /usr/local/lib/python*/site-packages/wheel* && find /usr/local/bin -name "pip*" -delete || true +RUN rm -rf /usr/lib/python*/site-packages/pip* /usr/lib/python*/site-packages/setuptools* /usr/lib/python*/site-packages/wheel* && find /usr/bin -name "pip*" -delete || true +RUN uv pip uninstall --system pip setuptools wheel && rm /usr/bin/uv /usr/bin/uvx + +WORKDIR /deps/template-langgraph