Docker Compose Deployment
Deploy Onera with Docker Compose
Docker Compose Deployment
The recommended way to self-host Onera is with Docker Compose. The provided docker-compose.yml runs three services: PostgreSQL, the backend server, and the web frontend.
Prerequisites
- Docker Engine 20.10+ and Docker Compose v2+
- A Supabase project (free tier works for small deployments)
Step 1: Clone and Configure
git clone https://github.com/onera-app/onera.git
cd onera
cp .env.example .envEdit .env and set the required values:
# Required — generate a strong password
POSTGRES_PASSWORD=your-secure-password-here
# Required — from Supabase Dashboard → Settings → API
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SECRET_KEY=sb_secret_...
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_PUBLISHABLE_KEY=sb_publishable_...
# Set these to your domain in production
FRONTEND_URL=https://chat.example.com
VITE_API_URL=https://chat.example.com
VITE_WS_URL=https://chat.example.comSee Configuration for all available environment variables.
Step 2: Start Services
docker compose up -dThis will:
- Start PostgreSQL and wait for it to be healthy
- Build and start the backend server (runs database migrations automatically)
- Build and start the web frontend with Nginx
Step 3: Verify
Check that all services are running:
docker compose psAll three containers should show Up (healthy):
NAME STATUS
onera-postgres Up (healthy)
onera-server Up (healthy)
onera-web Up (healthy)Test the health endpoints:
# Backend health
curl http://localhost:3000/health
# → {"status":"ok","timestamp":"..."}
# Frontend health
curl http://localhost:5173/health
# → healthy
# Backend health via frontend proxy
curl http://localhost:5173/api/health
# → {"status":"ok","timestamp":"..."}Step 4: Access Onera
Open http://localhost:5173 in your browser. You should see the Onera login screen.
Updating
To update to the latest version:
cd onera
git pull
docker compose build
docker compose up -dThe server container runs database migrations automatically on startup, so schema changes are applied during the update.
Stopping
# Stop all services (data is preserved in the postgres_data volume)
docker compose down
# Stop and remove all data (destructive)
docker compose down -vResource Requirements
The default docker-compose.yml includes resource limits:
| Service | Memory Limit | Memory Reserved |
|---|---|---|
| PostgreSQL | 256 MB | 64 MB |
| Server | 512 MB | 128 MB |
| Web | 128 MB | 32 MB |
For larger deployments, adjust these in docker-compose.yml under deploy.resources.
Logs
# All services
docker compose logs -f
# Specific service
docker compose logs -f server
# Last 100 lines
docker compose logs --tail 100 serverLogs are configured with a 10 MB max size and 3 rotated files per service.
Next Steps
- Configuration — All environment variables and Supabase setup
- Production Hardening — TLS, reverse proxy, and domain configuration
- Backup & Restore — Database backup strategies