blumeops/containers/miniflux/container.py
Erich Blume 352b95c141
All checks were successful
Build Container / detect (push) Successful in 3s
Build Container / build-dagger (miniflux) (push) Successful in 10m2s
Build Container / build-dagger (forgejo-runner) (push) Successful in 10m2s
Refactor Dagger go_build() helper and standardize Alpine 3.23
Extend go_build() with buildmode and extra_env params, migrate miniflux
and forgejo-runner to use it, and bump all Alpine bases from 3.22 to 3.23.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 10:10:46 -07:00

48 lines
1.3 KiB
Python

"""Miniflux RSS feed reader — native Dagger build.
Two-stage build: Go (backend with PIE), Alpine (runtime).
Source cloned from forge mirror.
"""
import dagger
from blumeops.containers import (
alpine_runtime,
clone_from_forge,
go_build,
oci_labels,
)
VERSION = "2.2.19"
async def build(src: dagger.Directory) -> dagger.Container:
source = clone_from_forge("miniflux", VERSION)
# Stage 1: Build Go backend (PIE mode, matching upstream Makefile)
backend = go_build(
source,
"/miniflux",
buildmode="pie",
ldflags=f"-s -w -X 'miniflux.app/v2/internal/version.Version={VERSION}'",
cgo_enabled=True,
)
# Stage 2: Runtime (uses Alpine's built-in nobody:65534)
runtime = alpine_runtime(
extra_apk=["ca-certificates", "tzdata"],
create_user=False,
)
runtime = oci_labels(
runtime,
title="Miniflux",
description="Miniflux is a minimalist and opinionated feed reader",
version=VERSION,
)
return (
runtime.with_file("/usr/bin/miniflux", backend.file("/miniflux"))
.with_exposed_port(8080)
.with_env_variable("LISTEN_ADDR", "0.0.0.0:8080")
.with_user("65534")
.with_default_args(args=["/usr/bin/miniflux"])
)