blumeops/containers/ntfy/Dockerfile
Erich Blume d1dac0c241
All checks were successful
Build Container (Nix) / detect (push) Successful in 1s
Build Container / detect (push) Successful in 3s
Build Container (Nix) / build (ntfy) (push) Successful in 4s
Build Container / build (ntfy) (push) Successful in 11s
Upgrade ntfy v2.17.0 → v2.19.2 (#305)
## Summary
- Upgrade ntfy from v2.17.0 to v2.19.2
- Update Dockerfile and Nix build definitions with new version, commit SHA, and hashes
- Add `subPackages = [ "." ]` to Nix build to handle new `tools/loadtest` module in upstream

## Upstream changes (no breaking changes)
- **v2.18.0:** Experimental PostgreSQL backend support
- **v2.19.0:** PostgreSQL read replica support, notification sound throttling
- **v2.19.1-2:** PostgreSQL bug fixes, web push race condition fix

## Test plan
- [ ] Container builds complete on Forgejo Actions (both Dockerfile and Nix)
- [ ] Update kustomization.yaml `newTag` to the built nix image tag
- [ ] `argocd app set ntfy --revision upgrade/ntfy-v2.19.2 && argocd app sync ntfy`
- [ ] Verify ntfy health: `curl https://ntfy.ops.eblu.me/v1/health`
- [ ] Send a test notification

Reviewed-on: #305
2026-03-23 10:32:06 -07:00

66 lines
1.8 KiB
Docker

# ntfy push notification server
# Three-stage build: Web UI (Node), server (Go+SQLite), runtime (Alpine)
ARG CONTAINER_APP_VERSION=v2.19.2
ARG NTFY_VERSION=${CONTAINER_APP_VERSION}
ARG NTFY_COMMIT=2ad78edca12f1a43c566ffab9e93b3ed26426a6c
FROM node:22-alpine AS web-build
ARG NTFY_COMMIT
RUN apk add --no-cache git
RUN mkdir /app && cd /app \
&& git init \
&& git remote add origin https://forge.ops.eblu.me/mirrors/ntfy.git \
&& git fetch --depth 1 origin ${NTFY_COMMIT} \
&& git checkout FETCH_HEAD
WORKDIR /app/web
RUN npm ci
RUN npm run build
FROM golang:alpine3.22 AS build
ARG NTFY_VERSION
ARG NTFY_COMMIT
RUN apk add --no-cache build-base git
RUN mkdir /app && cd /app \
&& git init \
&& git remote add origin https://forge.ops.eblu.me/mirrors/ntfy.git \
&& git fetch --depth 1 origin ${NTFY_COMMIT} \
&& git checkout FETCH_HEAD
WORKDIR /app
# Copy pre-built web UI assets
COPY --from=web-build /app/web/build /app/server/site
# Create docs placeholder with dummy file (go:embed requires non-empty dir)
RUN mkdir -p server/docs && touch server/docs/placeholder
ENV CGO_ENABLED=1
RUN go build \
-o /ntfy \
-tags sqlite_omit_load_extension,osusergo,netgo \
-ldflags "-linkmode=external -extldflags=-static -s -w -X main.version=${NTFY_VERSION}"
FROM alpine:3.22
ARG CONTAINER_APP_VERSION
LABEL org.opencontainers.image.title="ntfy"
LABEL org.opencontainers.image.description="ntfy is a simple HTTP-based pub-sub notification service"
LABEL org.opencontainers.image.version="${CONTAINER_APP_VERSION}"
LABEL org.opencontainers.image.source="https://forge.eblu.me/eblume/blumeops"
LABEL org.opencontainers.image.vendor="blumeops"
RUN apk --no-cache add tzdata
COPY --from=build /ntfy /usr/bin/ntfy
EXPOSE 80
USER 65534
ENTRYPOINT ["/usr/bin/ntfy"]