arcade-mcp/docker/Dockerfile
Sam Partee 2eb46a3a98
Client Fixes and LangGraph Examples (#50)
This PR includes several improvements to the Arcade client and adds
LangGraph examples:

1. Enhanced error handling in the Arcade client:
   - Improved HTTP error handling in `BaseArcadeClient`
- Simplified request methods in `SyncArcadeClient` and
`AsyncArcadeClient`

2. Updated `ToolResource` class:
   - Changed base path from `/v1/tool` to `/v1/tools`
   - Added `tool_version` parameter to `authorize` method

3. Improved Toolkit discovery:
- Updated `find_all_arcade_toolkits` to search only in the current
Python interpreter's site-packages

5. Added LangGraph examples:
   - New `langgraph_auth.py` example demonstrating Gmail authentication
- New `langgraph_with_tool_exec.py` example showing tool execution
within a LangGraph

6. Minor updates:
   - Changed default `BASE_URL` to `https://api.arcade.com/`
   - Updated import error message for eval dependencies

---------

Co-authored-by: Nate Barbettini <nate@arcade-ai.com>
2024-09-24 10:13:45 -07:00

57 lines
1.2 KiB
Docker

# Use a lightweight Python image
FROM python:3.10-slim
# Define build arguments with default values
ARG PORT=8001
ARG HOST=0.0.0.0
# Set environment variables using the build arguments
ENV PORT=${PORT}
ENV HOST=${HOST}
ENV ARCADE_WORK_DIR=/app
# Install system dependencies
RUN apt-get update && apt-get install -y \
apt-utils \
build-essential \
libssl-dev \
libffi-dev \
python3-dev \
curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN pip install build poetry
# Copy the parent directory contents into the container
COPY . .
WORKDIR /app/arcade
# Build the project
RUN python -m build
# Build the project and install the wheel with extras
RUN poetry export --with fastapi,dev,evals --output requirements.txt
# This doesnt install the optional packages for some reason
RUN python -m pip install dist/arcade_ai-0.1.0-py3-none-any.whl[fastapi,dev,evals] uvicorn
RUN python -m pip install -r requirements.txt
WORKDIR /app/toolkits
# Install toolkits from the toolkits directory
RUN set -e; \
for toolkit in ./*; do \
echo "Installing toolkit $toolkit"; \
pip install $toolkit; \
done
# Expose the port
EXPOSE $PORT
# Run the arcade dev command
CMD arcade dev --host $HOST --port $PORT