|
| 1 | +# Standalone |
| 2 | + |
| 3 | +A standalone Docker image is available for situations where you want an Oban dashboard without |
| 4 | +mounting Oban.Web within your application. This is useful for: |
| 5 | + |
| 6 | +- Running the dashboard separately from your main application |
| 7 | +- Monitoring jobs created by [Oban for Python][oban-py] applications |
| 8 | + |
| 9 | +[oban-py]: https://github.com/oban-bg/oban-py |
| 10 | + |
| 11 | +> #### Interaction with Oban {: .info} |
| 12 | +> |
| 13 | +> The standalone dashboard operates in a monitoring-only capacity: |
| 14 | +> |
| 15 | +> - It connects to an existing database with Oban tables already present |
| 16 | +> - It does not run migrations or create tables |
| 17 | +> - It does not process jobs (`plugins: false`, `queues: false`) |
| 18 | +> - Queue scaling operations affect the connected application's queues |
| 19 | +> |
| 20 | +> When deploying to a production environment you should add authentication and potentially set |
| 21 | +> read only mode. |
| 22 | +
|
| 23 | +## Quick Start |
| 24 | + |
| 25 | +Pull and run the image with your database connection: |
| 26 | + |
| 27 | +```bash |
| 28 | +docker run -d \ |
| 29 | + -e DATABASE_URL="postgres://user:pass@host:5432/myapp_prod" \ |
| 30 | + -p 4000:4000 \ |
| 31 | + ghcr.io/oban-bg/oban-dash |
| 32 | +``` |
| 33 | + |
| 34 | +Then visit `http://localhost:4000/oban`. |
| 35 | + |
| 36 | +When connecting to a database on your host machine, use `host.docker.internal` instead of |
| 37 | +`localhost`: |
| 38 | + |
| 39 | +```diff |
| 40 | + docker run -d \ |
| 41 | ++ -e DATABASE_URL="postgres://host.docker.internal:5432/myapp_dev" \ |
| 42 | + -p 4000:4000 \ |
| 43 | + ghcr.io/oban-bg/oban-dash |
| 44 | +``` |
| 45 | + |
| 46 | +## Configuration |
| 47 | + |
| 48 | +All configuration is done through environment variables: |
| 49 | + |
| 50 | +| Variable | Required | Default | Description | |
| 51 | +| ----------------- | ---------- | --------- | ------------------------------- | |
| 52 | +| `DATABASE_URL` | Yes | — | PostgreSQL connection URL | |
| 53 | +| `POOL_SIZE` | No | `5` | Database connection pool size | |
| 54 | +| `PORT` | No | `4000` | HTTP port | |
| 55 | +| `OBAN_PREFIX` | No | `public` | Oban table schema prefix | |
| 56 | +| `OBAN_READ_ONLY` | No | `false` | Disable job actions when `true` | |
| 57 | +| `BASIC_AUTH_USER` | No | — | Basic auth username | |
| 58 | +| `BASIC_AUTH_PASS` | No | — | Basic auth password | |
| 59 | +| `LOG_LEVEL` | No | `info` | Log level | |
| 60 | + |
| 61 | +## Authentication & Authorization |
| 62 | + |
| 63 | +A simple authentication mechanism is built in and enabled with environment variables. Enable HTTP |
| 64 | +Basic Authentication by setting both `BASIC_AUTH_USER` and `BASIC_AUTH_PASS`: |
| 65 | + |
| 66 | +```diff |
| 67 | + docker run -d \ |
| 68 | + -e DATABASE_URL="postgres://host.docker.internal:5432/myapp" \ |
| 69 | ++ -e BASIC_AUTH_USER="admin" \ |
| 70 | ++ -e BASIC_AUTH_PASS="secret" \ |
| 71 | + -p 4000:4000 \ |
| 72 | + ghcr.io/oban-bg/oban-dash |
| 73 | +``` |
| 74 | + |
| 75 | +It's also possible to disable job actions such as cancel, retry, delete, etc. by enabling |
| 76 | +read-only mode: |
| 77 | + |
| 78 | +```diff |
| 79 | + docker run -d \ |
| 80 | + -e DATABASE_URL="postgres://host.docker.internal:5432/myapp" \ |
| 81 | ++ -e OBAN_READ_ONLY="true" \ |
| 82 | + -p 4000:4000 \ |
| 83 | + ghcr.io/oban-bg/oban-dash |
| 84 | +``` |
| 85 | + |
| 86 | +## Oban Pro |
| 87 | + |
| 88 | +To use [Oban Pro][pro] features like the Smart Engine, you'll need to build the image with your |
| 89 | +license key. The published `ghcr.io/oban-bg/oban-dash` image only includes the open source |
| 90 | +components. |
| 91 | + |
| 92 | +Build with your Oban Pro license: |
| 93 | + |
| 94 | +```bash |
| 95 | +git clone https://github.com/oban-bg/oban_web.git |
| 96 | +cd oban_web/standalone |
| 97 | +docker build \ |
| 98 | + --build-arg OBAN_LICENSE_KEY="your_license_key" \ |
| 99 | + -t oban-dash-pro . |
| 100 | +``` |
| 101 | + |
| 102 | +Then run your custom image: |
| 103 | + |
| 104 | +```bash |
| 105 | +docker run -d \ |
| 106 | + -e DATABASE_URL="postgres://host.docker.internal:5432/myapp" \ |
| 107 | + -p 4000:4000 \ |
| 108 | + oban-dash-pro |
| 109 | +``` |
| 110 | + |
| 111 | +[pro]: https://oban.pro |
| 112 | + |
| 113 | +## Health Checks |
| 114 | + |
| 115 | +The container exposes a health check endpoint at `/health` that returns `{"status":"ok"}`. |
| 116 | +Docker's built-in `HEALTHCHECK` is configured to monitor this endpoint automatically, making the |
| 117 | +image suitable for orchestration systems like Kubernetes or Amazon ECS. |
0 commit comments