Replace all runtime template.ParseFiles() calls with template.ParseFS()
using an embedded filesystem, and serve static assets from an embedded FS
via http.FileServerFS(). This eliminates the need for COPY steps in the
Dockerfile and ensures the binary works with readOnlyRootFilesystem: true.
- Add internal/templates/embed.go exposing templates.FS
- Add static/embed.go exposing static.FS
- Update all handlers to use template.ParseFS(templates.FS, ...)
- Update static file server to use http.FileServerFS(static.FS)
- Remove COPY static/ and COPY internal/templates/ from Dockerfile
- Remove TestMain working directory hack (no longer needed)
Closesleeworks-agents/gitea-mobile#231Closesleeworks-agents/gitea-mobile#220Closesleeworks-agents/gitea-mobile#221
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add empty go.sum file (no external dependencies yet) and update the
Dockerfile build stage to COPY go.sum alongside go.mod for reproducible
module downloads. This ensures the Docker build does not fail when Go
requires go.sum to be present.
Closesleeworks-agents/gitea-mobile#203Closesleeworks-agents/gitea-mobile#180
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The project uses only Go stdlib with zero external dependencies, so go.sum
does not exist. The Dockerfile COPY instruction fails when go.sum is missing.
Closesleeworks-agents/gitea-mobile#89
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add multi-stage Dockerfile producing a minimal distroless image and
Gitea Actions CI workflow for automated testing and image publishing.
- Dockerfile: multi-stage build (golang:1.22-alpine -> distroless/static)
with stripped binary (~15-20MB image), runs as nonroot user
- .dockerignore: excludes .git, docs, nix files from build context
- .gitea/workflows/build.yaml: CI pipeline that runs tests, builds
Docker image, and pushes to Gitea registry with timestamp+SHA tags
for Flux image automation
Closesleeworks-agents/gitea-mobile#7
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>