blob: d38304dad4871db2b4676113bebf07f990cfc1b4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
Quick Start
===========
### Running from source
```bash
go build -o player ./cmd/player
./player
```
Open `http://localhost:8080` — on first visit you'll be redirected to the bootstrap page to create an admin account.
### Running with Docker
```bash
docker build -t player:latest .
docker run -p 8080:8080 \
-v player-data:/data \
-v /path/to/media:/media \
-e MEDIA_ROOT=/media \
-e DB_PATH=/data/media.db \
player:latest
```
### Deploying to Kubernetes
```bash
kubectl apply -f k8s/
```
This creates a Deployment (non-root, probes included), ClusterIP Service, PVCs for `/data` and `/media`, and an optional Secret.
The `Deployment` overrides two settings for K8s:
- `DB_PATH=/data/media.db`
- `MEDIA_ROOT=/media`
Probes:
- **Liveness:** `GET /healthz` (no DB dependency)
- **Readiness:** `GET /readyz` (DB ping)
Security:
- `runAsNonRoot: true`
- `runAsUser: 65534` / `runAsGroup: 65534`
- `allowPrivilegeEscalation: false`
- `readOnlyRootFilesystem: true`
### Mage targets
| Target | Description |
|--------|-------------|
| `mage build` | Compile the binary |
| `mage test` | Run `go test ./...` |
| `mage install` | Build and copy binary to `$GOPATH/bin` |
| `mage clean` | Remove build artifacts |
| `mage docker-build` | Build Docker image as `player:latest` |
| `mage docker-push` | Push `player:latest` to registry |
|