arcade-mcp/docker/README.md
Sam Partee 09a0784cd5
Improve Docker Build and Deployment for Arcade Worker (#205)
This PR enhances the Docker build and deployment process for the Arcade
Worker by:

- **Modularizing Docker Builds:**
- Introduces a new `INSTALL_TOOLKITS` build argument in the `Dockerfile`
to conditionally include toolkits. this enables the creation of a
`arcadeai/worker-base` which can be used to build custom containers in a
multi-stage build. an example of this is included in the example dir.
- Adds `docker-base` Makefile target to build a lightweight base image
without toolkits.

- **Publishing to GitHub Container Registry (GHCR):**
- Adds Makefile targets `publish-ghcr` and `gh-login` for pushing images
to GHCR.
  - Supports publishing both base and full images with toolkits to GHCR.

- **Docker Compose:**
  - Add Docker compose file and setup
  - Renames the `actor` service to `worker`
- Adds an `nginx` service in `docker-compose.yml` to proxy requests to
the Arcade Engine.
  - Introduces an `nginx.conf` file for the Nginx service.

- **Streamlining Toolkit Installation:**
- Moves toolkit installation from the `start.sh` script to the Docker
build process.
- Creates a `toolkits.txt` file to manage toolkit dependencies which can
be edited easily when we want to add a new toolkit. Developers can also
use this approach as shown in the example.

- **Improving Configuration Files:**
- Updates `docker.engine.yaml` and `env.example` to align with the new
setup.


TODO:
- CI/CD needs to be adjusted so that images are pushed to ghcr on
release.
- AWS resources need to be renamed actor -> worker @EricGustin 

This can go in after the above two items are resolved.

---------

Co-authored-by: Wils Dawson <wils@arcade-ai.com>
Co-authored-by: Eric Gustin <34000337+EricGustin@users.noreply.github.com>
Co-authored-by: sdreyer <sterling@arcade-ai.com>
Co-authored-by: Sterling Dreyer <sdreyer21@gmail.com>
Co-authored-by: Nate Barbettini <nathanaelb@gmail.com>
2025-01-23 12:57:24 -08:00

115 lines
3.2 KiB
Markdown

# Arcade Docker Compose Guide
This guide provides detailed instructions on how to set up and run Arcade using Docker Compose.
## Prerequisites
- **Docker** installed on your system. [Install Docker](https://docs.docker.com/get-docker/)
- **Docker Compose** installed. It comes bundled with Docker Desktop on Windows and macOS. For Linux, follow the [Docker Compose installation guide](https://docs.docker.com/compose/install/).
## Getting Started
### 1. Clone the Repository
Begin by cloning the Arcade repository:
```bash
git clone https://github.com/ArcadeAI/arcade-ai.git
```
Change to the `docker` directory:
```bash
cd arcade-ai/docker
```
### 2. Copy and Configure Environment Variables
Copy the example environment file to `.env`:
```bash
cp env.example .env
```
Open the `.env` file in your preferred text editor and fill in the required values. At a minimum, you **must** provide the `OPENAI_API_KEY`:
```env:.env
### LLM ###
OPENAI_API_KEY=your_openai_api_key_here
```
If you plan to use other Large Language Model (LLM) providers, add their API keys as well:
```env:.env
ANTHROPIC_API_KEY=your_anthropic_api_key_here
```
### 3. Run Docker Compose
Start the Arcade services using Docker Compose:
```bash
docker compose up -p arcade
```
This command will build and start all the services defined in the `docker-compose.yml` file and make their ports available to your host machine.
### 4. Verify the Engine is Running
In a separate terminal window, check if the engine is running:
```bash
curl http://localhost:9099/v1/health
```
You should receive a response indicating that the engine is healthy:
```json
{ "status": "healthy" }
```
You can also view the swagger docs at `http://localhost:9099/swagger/index.html`
## Adding Authentication Providers
Arcade supports various authentication providers. To add an auth provider, follow these steps:
### 1. Enable the Auth Provider in the Configuration
Edit the `docker.engine.yaml` file to enable the desired auth provider. For example, to enable Google authentication, modify the file as follows:
```yaml:docker.engine.yaml
auth:
providers:
- id: google
enabled: true # Change from false to true
```
### 2. Add Client ID and Secret to the `.env` File
Obtain the client ID and client secret from your auth provider and add them to the `.env` file:
```env:.env
GOOGLE_CLIENT_ID="your_google_client_id"
GOOGLE_CLIENT_SECRET="your_google_client_secret"
```
Repeat this step for any other auth providers you wish to enable.
### 3. Restart the Docker Compose Services
After making changes to the configuration, restart the services:
```bash
docker compose down
docker compose up -p arcade
```
## Troubleshooting
- **Engine Health Check Fails**: Ensure that all environment variables are correctly set in the `.env` file and that the services have started without errors.
- **Port Conflicts**: If the default ports are already in use, modify the ports in the `docker-compose.yml` file.
- **Authentication Errors**: Double-check the client IDs and secrets provided for auth providers.
NOTE: `arcade login` will not work within a docker container, you must copy your credentials into the container if you would like to use it.