Skip to content

Commit 9f8b201

Browse files
committed
uv run langgraph dockerfile --add-docker-compose langgraph.Dockerfile
1 parent 1cabb27 commit 9f8b201

File tree

3 files changed

+125
-5
lines changed

3 files changed

+125
-5
lines changed

.dockerignore

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,51 @@
1+
# Ignore node_modules and other dependency directories
2+
node_modules
3+
bower_components
4+
vendor
5+
6+
# Ignore logs and temporary files
7+
*.log
8+
*.tmp
9+
*.swp
10+
11+
# Ignore .env files and other environment files
12+
.env
13+
.env.*
14+
*.local
15+
16+
# Ignore git-related files
117
.git
18+
.gitignore
19+
20+
# Ignore Docker-related files and configs
21+
.dockerignore
22+
docker-compose.yml
23+
24+
# Ignore build and cache directories
25+
dist
26+
build
27+
.cache
28+
__pycache__
29+
30+
# Ignore IDE and editor configurations
31+
.vscode
32+
.idea
33+
*.sublime-project
34+
*.sublime-workspace
35+
.DS_Store # macOS-specific
36+
37+
# Ignore test and coverage files
38+
coverage
39+
*.coverage
40+
*.test.js
41+
*.spec.js
42+
tests
43+
44+
# Project
245
.github
346
.venv
447
*.pyc
5-
*.env
6-
.coverage
748
.devcontainer
8-
.gitignore
949
.pre-commit-config.yaml
1050
.pytest_cache
1151
.ruff_cache
12-
__pycache__
13-
tests

docker-compose.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
volumes:
2+
langgraph-data:
3+
driver: local
4+
5+
services:
6+
langgraph-redis:
7+
image: redis:6
8+
healthcheck:
9+
test: redis-cli ping
10+
interval: 5s
11+
timeout: 1s
12+
retries: 5
13+
14+
langgraph-postgres:
15+
image: pgvector/pgvector:pg16
16+
ports:
17+
- "5433:5432"
18+
environment:
19+
POSTGRES_DB: postgres
20+
POSTGRES_USER: postgres
21+
POSTGRES_PASSWORD: postgres
22+
command:
23+
- postgres
24+
- -c
25+
- shared_preload_libraries=vector
26+
volumes:
27+
- langgraph-data:/var/lib/postgresql/data
28+
healthcheck:
29+
test: pg_isready -U postgres
30+
start_period: 10s
31+
timeout: 1s
32+
retries: 5
33+
interval: 60s
34+
start_interval: 1s
35+
36+
langgraph-api:
37+
ports:
38+
- "8123:8000"
39+
depends_on:
40+
langgraph-redis:
41+
condition: service_healthy
42+
langgraph-postgres:
43+
condition: service_healthy
44+
environment:
45+
REDIS_URI: redis://langgraph-redis:6379
46+
POSTGRES_URI: postgres://postgres:postgres@langgraph-postgres:5432/postgres?sslmode=disable
47+
healthcheck:
48+
test: python /api/healthcheck.py
49+
interval: 60s
50+
start_interval: 1s
51+
start_period: 10s
52+
env_file:
53+
- .env
54+
build:
55+
context: .
56+
dockerfile: langgraph.Dockerfile

langgraph.Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM langchain/langgraph-api:3.11
2+
3+
4+
5+
# -- Adding local package . --
6+
ADD . /deps/template-langgraph
7+
# -- End of local package . --
8+
9+
# -- Installing all local dependencies --
10+
RUN PYTHONDONTWRITEBYTECODE=1 uv pip install --system --no-cache-dir -c /api/constraints.txt -e /deps/*
11+
# -- End of local dependencies install --
12+
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"}'
13+
14+
15+
16+
# -- Ensure user deps didn't inadvertently overwrite langgraph-api
17+
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
18+
RUN PYTHONDONTWRITEBYTECODE=1 uv pip install --system --no-cache-dir --no-deps -e /api
19+
# -- End of ensuring user deps didn't inadvertently overwrite langgraph-api --
20+
# -- Removing build deps from the final image ~<:===~~~ --
21+
RUN pip uninstall -y pip setuptools wheel
22+
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
23+
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
24+
RUN uv pip uninstall --system pip setuptools wheel && rm /usr/bin/uv /usr/bin/uvx
25+
26+
WORKDIR /deps/template-langgraph

0 commit comments

Comments
 (0)