1+ FROM langchain/langgraph-api:3.13
12
2- # Get a distribution that has uv already installed
3- FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
43
5- # Add user - this is the user that will run the app
6- # If you do not set user, the app will run as root (undesirable)
7- RUN useradd -m -u 1000 user
8- USER user
94
10- # Set the home directory and path
11- ENV HOME=/home/user \
12- PATH=/home/user/. local/bin:$PATH
5+ # -- Adding local package . --
6+ ADD . /deps/lets-talk
7+ # -- End of local package . --
138
14- ENV UVICORN_WS_PROTOCOL=websockets
9+ # -- Installing all local dependencies --
10+ RUN PYTHONDONTWRITEBYTECODE=1 pip install --no-cache-dir -c /api/constraints.txt -e /deps/*
11+ # -- End of local dependencies install --
12+ ENV LANGGRAPH_HTTP='{"disable_meta": true, "disable_store": true}'
13+ ENV LANGSERVE_GRAPHS='{"the_data_guy_chat": "/deps/lets-talk/py-src/lets_talk/agent_v2.py:agent"}'
1514
1615
17- # Set the working directory
18- WORKDIR $HOME/app
1916
20- COPY --chown=user ./pyproject.toml $HOME/app
21- COPY --chown=user ./uv.lock $HOME/app
17+ # -- Ensure user deps didn't inadvertently overwrite langgraph-api
18+ 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
19+ RUN PYTHONDONTWRITEBYTECODE=1 pip install --no-cache-dir --no-deps -e /api
20+ # -- End of ensuring user deps didn't inadvertently overwrite langgraph-api --
21+ # -- Removing pip from the final image ~<:===~~~ --
22+ RUN pip uninstall -y pip setuptools wheel && 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
23+ # -- End of pip removal --
2224
23- # Install the dependencies
24- # RUN uv sync --frozen
25- RUN uv sync
26-
27- # Copy the app to the container
28- COPY --chown=user ./py-src/ $HOME/app
29- COPY --chown=user ./.chainlit/ $HOME/app
30- COPY --chown=user ./chainlit.md $HOME/app
31-
32- # TODO: Fix this to download
33- # copy posts to container
34- COPY --chown=user ./data/ $HOME/app/data
35-
36- # Expose the port
37- EXPOSE 7860
38-
39- # Run the app
40- CMD ["uv" , "run" , "chainlit" , "run" , "app.py" , "--host" , "0.0.0.0" , "--port" , "7860" ]
25+ WORKDIR /deps/lets-talk
0 commit comments