- prompts/: LFU cache exam + 5-pillar grading rubric - outputs/: 8 model .py outputs (local + cloud baseline) - data/benchmark_history.json: graded results (scores, metrics, bugs, patches) - generate_dashboard.py: builds dashboard.html + pages/*.html from JSON - Dockerfile + DEPLOY.md: Gitea→Coolify deploy (build-step, nginx static) - .gitignore: generated HTML excluded (built on deploy) Co-Authored-By: Claude <noreply@anthropic.com>
77 lines
2.6 KiB
Markdown
77 lines
2.6 KiB
Markdown
# Deploying to Coolify (via Gitea)
|
|
|
|
Repo: `ssh://git@git.itsaygea.com:2222/admin/modelTesting.git`
|
|
|
|
The generated `dashboard.html` and `pages/` are **gitignored** — they're built from
|
|
`data/benchmark_history.json` by `generate_dashboard.py`. So Coolify must run that script
|
|
during build, then serve the result.
|
|
|
|
---
|
|
|
|
## Option A — Build step, regenerate on every push *(recommended)*
|
|
|
|
The site always reflects the latest `benchmark_history.json`. Push a new grade → re-deploy → site updates.
|
|
|
|
### Coolify service setup
|
|
|
|
1. **New Resource** → choose your Gitea project `admin/modelTesting`.
|
|
2. Choose **"Dockerfile"** as the build pack (we ship a tiny one).
|
|
|
|
Add this `Dockerfile` to the repo (already included):
|
|
|
|
```dockerfile
|
|
# build stage: regenerate the site from source
|
|
FROM python:3.12-slim AS build
|
|
WORKDIR /app
|
|
COPY . .
|
|
RUN python3 generate_dashboard.py
|
|
|
|
# serve stage: static files via nginx
|
|
FROM nginx:alpine
|
|
COPY --from=build /app/dashboard.html /usr/share/nginx/html/dashboard.html
|
|
COPY --from=build /app/pages /usr/share/nginx/html/pages
|
|
# root path redirects to the dashboard
|
|
RUN printf 'location = / { return 302 /dashboard.html; }\n' > /etc/nginx/conf.d/default.conf
|
|
EXPOSE 80
|
|
```
|
|
|
|
3. **Port:** set the published port to **80** (Coolify maps it to your domain).
|
|
4. **Domain:** attach your domain. Coolify provisions the HTTPS cert automatically.
|
|
5. **Deploy.** Push to `main` → Coolify rebuilds → site updates.
|
|
|
|
### Why a Dockerfile
|
|
|
|
Coolify's "Nixpacks / static" presets can run a build command, but the Dockerfile path is
|
|
the most predictable: explicit Python build step + nginx static serving, no surprises.
|
|
The image is ~30 MB.
|
|
|
|
---
|
|
|
|
## Option B — Pure static, commit the built HTML *(simplest, no build)*
|
|
|
|
If you'd rather not build on the server:
|
|
|
|
1. Comment out `/dashboard.html` and `/pages/` in `.gitignore`.
|
|
2. Run `python3 generate_dashboard.py` locally, then `git add` + commit the HTML.
|
|
3. In Coolify: **New Resource** → the repo → build pack **"Static Site"** (or Nixpacks with
|
|
`OUTPUT_DIRECTORY=/`), publish dir `/`, port 80.
|
|
|
|
Downside: you must rebuild + commit locally every time you add a model. Use Option A unless
|
|
your Coolify can't run Docker.
|
|
|
|
---
|
|
|
|
## Verifying after deploy
|
|
|
|
Open the domain → you should land on the dashboard. If you see a blank page, check the
|
|
Coolify build logs for `generate_dashboard.py` errors (usually a malformed
|
|
`data/benchmark_history.json`).
|
|
|
|
## Local preview before pushing
|
|
|
|
```bash
|
|
python3 generate_dashboard.py
|
|
python3 -m http.server 8000
|
|
# open http://localhost:8000/dashboard.html
|
|
```
|