diff options
Diffstat (limited to 'Containerfile')
| -rw-r--r-- | Containerfile | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..3f52aef --- /dev/null +++ b/Containerfile @@ -0,0 +1,31 @@ +# fluxrec serve container (rss + status on :8080, state in /data). +# +# build: docker build -f Containerfile -t fluxrec . +# run: docker run -d --name fluxrec \ +# --env-file /srv/fluxrec/env \ +# -v /srv/fluxrec:/data \ +# -p 127.0.0.1:8080:8080 \ +# fluxrec +# +# The env file holds MINIFLUX_URL and MINIFLUX_TOKEN (plus optional TZ — +# refresh times are computed in it; default UTC, tzdata is installed). The +# env file lives on the server only, never in this repo. /data holds +# model.json (scp'd by `just deploy`), cursor.json and runs.jsonl. +FROM golang:1.25-alpine AS build +WORKDIR /src +COPY . . +RUN CGO_ENABLED=0 go build -trimpath -o /out/fluxrec . + +FROM alpine:3.21 +RUN apk add --no-cache tzdata \ + && adduser -D fluxrec \ + && mkdir -p /data && chown fluxrec:fluxrec /data +USER fluxrec +COPY --from=build /out/fluxrec /usr/local/bin/fluxrec +EXPOSE 8080 +ENTRYPOINT ["fluxrec", "serve", \ + "--model", "/data/model.json", \ + "--cursor", "/data/cursor.json", \ + "--runs", "/data/runs.jsonl"] +# Override refresh times / rec feed ID via extra args after the image name, e.g.: +# docker run ... fluxrec --refresh-at "06:00,12:00,18:00" --rec-feed-id 123 |
