122 lines
2.6 KiB
Markdown
122 lines
2.6 KiB
Markdown
# Deployment
|
|
|
|
## Docker
|
|
|
|
The WebUI ships as a multi-stage Docker image.
|
|
|
|
### Build
|
|
|
|
```bash
|
|
git clone https://git.danhenry.dev/thelab/work-queue-webui.git
|
|
cd work-queue-webui
|
|
docker build -t git.danhenry.dev/thelab/work-queue-webui:latest .
|
|
```
|
|
|
|
### Run
|
|
|
|
```bash
|
|
docker run -d \
|
|
--name work-queue-webui \
|
|
-p 8081:80 \
|
|
git.danhenry.dev/thelab/work-queue-webui:latest
|
|
```
|
|
|
|
The WebUI will be available at `http://localhost:8081`.
|
|
|
|
### Environment
|
|
|
|
| Variable | Default | Description |
|
|
|---|---|---|
|
|
| `WORK_QUEUE_API_URL` | `http://app-01:8080` | Work Queue API endpoint |
|
|
|
|
### Volumes
|
|
|
|
| Path | Description |
|
|
|---|---|
|
|
| `/app/data` | Persistent data directory |
|
|
|
|
---
|
|
|
|
## Docker Compose
|
|
|
|
```yaml
|
|
services:
|
|
webui:
|
|
image: git.danhenry.dev/thelab/work-queue-webui:latest
|
|
volumes:
|
|
- ./data:/app/data
|
|
restart: unless-stopped
|
|
|
|
proxy:
|
|
image: nginx:alpine
|
|
ports:
|
|
- "8081:80"
|
|
volumes:
|
|
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
|
depends_on:
|
|
webui:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
data:
|
|
```
|
|
|
|
---
|
|
|
|
## Ansible
|
|
|
|
An Ansible role is available in `roles/work_queue_webui/`. See the role's `defaults/main.yml` for configuration options.
|
|
|
|
### Variables
|
|
|
|
| Variable | Default | Description |
|
|
|---|---|---|
|
|
| `work_queue_webui_image_tag` | `latest` | Docker image tag |
|
|
| `work_queue_webui_proxy_port` | `8081` | External port |
|
|
| `work_queue_webui_data_path` | `.../work-queue-webui/data` | Data volume path |
|
|
|
|
### Deploy
|
|
|
|
```bash
|
|
cd infrastructure/ansible
|
|
ansible-playbook -i inventory playbooks/services/work_queue_webui.yml
|
|
```
|
|
|
|
---
|
|
|
|
## Nginx Reverse Proxy
|
|
|
|
If deploying behind an existing nginx instance, proxy to the container port:
|
|
|
|
```nginx
|
|
location / {
|
|
proxy_pass http://localhost:8081;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
## Health Check
|
|
|
|
The WebUI exposes a basic health endpoint at `/health` (returns `{"status": "ok"}`). The container uses `wget` to verify the nginx frontend is responding.
|
|
|
|
---
|
|
|
|
## CI Pipeline
|
|
|
|
A Gitea Actions workflow (`.gitea/workflows/docker.yml`) automatically builds and pushes the image on every push to `main`:
|
|
|
|
- **Triggers:** push to `main`
|
|
- **Platforms:** `linux/amd64`, `linux/arm64`
|
|
- **Tags:** `git.danhenry.dev/thelab/work-queue-webui:<sha>` and `:latest`
|
|
- **Registry:** Gitea container registry at `git.danhenry.dev`
|
|
|
|
Required secrets in the repo:
|
|
- `DOCKER_REGISTRY_USER` — Gitea username
|
|
- `DOCKER_REGISTRY_TOKEN` — Gitea API token
|