Switch demo service to a Go binary on scratch

The python:3.12-slim base pushed a 30 MB layer that timed out on the way
to Harbor (Cloudflare 524). A static Go binary keeps the image near 5 MB
with the same endpoints, port and APP_MESSAGE variable.
This commit is contained in:
2026-10-23 08:50:10 +00:00
parent 2c21665d0e
commit fdb7ee666d
5 changed files with 66 additions and 47 deletions

View File

@@ -6,8 +6,9 @@ Release → deploy.
- `GET /` trả JSON gồm `version`, `message` (từ biến `APP_MESSAGE`) và hostname của Pod.
- `GET /healthz` dùng cho readiness check.
- Lắng nghe cổng `8080`, chạy non-root (UID 10001).
- Viết bằng Go, image cuối là `scratch` chỉ vài MB để push lên Harbor nhanh.
Thử thay đổi: sửa `VERSION` trong `app.py`, commit và push, rồi build lại trên console để thấy
Thử thay đổi: sửa hằng `version` trong `main.go`, commit và push, rồi build lại trên console để thấy
phiên bản mới sau khi deploy.
Chạy local: `docker build -t aisp-ci-demo . && docker run --rm -p 8080:8080 aisp-ci-demo`