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
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
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
This ensures your data is preserved even if the container is restarted.
Data Persistence
Oxy uses PostgreSQL for data storage, which means proper database configuration is essential for maintaining your data across container restarts or updates.Storage Location
- Oxy connects to PostgreSQL using the
OXY_DATABASE_URLenvironment variable - For development: Use
oxy startto automatically set up PostgreSQL in Docker - For production: Connect to an external PostgreSQL instance (AWS RDS, Supabase, etc.)
What Data Is Stored
Oxy stores several types of data in PostgreSQL:- Application state and metadata
- User information and authentication data
- Semantic information from synchronized databases
- Cached query results and intermediate data
- Workflow execution history and checkpoints
Example Docker Setup with PostgreSQL
When using Docker Compose, your database data persists in the
oxy-postgres-data volume. Use docker-compose down -v with caution as it
will delete all data.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