Using Docker simplifies the deployment process and environment setup, making it easier to run Oxy in a consistent environment across different platforms.
Prerequisites
Before you start, ensure you have:- Docker installed on your host system
- An Oxy workspace with your configuration files, agents, and workflows
- Required API keys and environment variables for your deployment
Quick Start
The fastest way to get started with Oxy on Docker is to use the pre-built image from GitHub Packages:Why Use Docker Compose?
Docker Compose lets you define and manage multi-container applications with a single YAML file. For Oxy, Compose makes it easy to:- Start Oxy and related services (like databases or proxies) with one command
- Configure environment variables, volumes, and ports in one place
- Ensure all containers are networked and started in the right order
- Reproduce your deployment setup easily across machines or teams
Reference Architecture Diagram
Detailed Deployment Steps
1
Prepare Your Workspace
Before deploying, ensure you have an Oxy workspace ready with your configuration files. Your workspace directory should typically include:
config.yml- Main configuration file- Your agent definitions (
.agent.ymlfiles) - Your workflow definitions (
.workflow.ymlfiles) - Any other resources your agents and workflows need
2
Create a Docker Compose File
For easier management, create a
docker-compose.yml file:3
Start the Container
Launch your Oxy container:By default, the container’s working directory is
/app. If you want to use /workspace as your working directory (as in the example above), make sure to set working_dir: /workspace in your Docker Compose file and mount your workspace to /workspace.Your Oxy instance will be available at http://localhost:3000 once the container starts.Volume Mounting Explained
When running Oxy in Docker, you’ll typically need to mount two types of directories:-
Workspace Mount: Maps your local Oxy workspace to the container
This allows Oxy to access your configuration, agents, and workflows.
-
Data Mount: Provides persistent storage for Oxy’s state
When using Docker Compose, your data will persist as long as you don’t remove the volumes. Use
docker-compose down -v with caution as it will delete the volumes.Environment Variables
Common environment variables to configure in your Oxy container:| Variable | Description | Example |
|---|---|---|
OPENAI_API_KEY | Your OpenAI API key | sk-... |
OXY_STATE_DIR | Directory for Oxy state persistence | /var/lib/oxy/data |
DATABASE_URL | Connection URL if using a database | postgres://... |
PORT | Override the default port | 8080 |
Advanced Configuration
Custom Docker Images
If you need to extend the official Oxy image with additional dependencies or configuration, you can create your own Dockerfile:Health Checks
Add health checks to ensure your container is running properly:Next Steps
Once your Docker deployment is up and running, you can:- Set up CI/CD pipelines to automatically update your Oxy instance
- Implement monitoring and logging solutions
- Configure backups for your persistent data
- Scale horizontally for higher availability