Files
ntfy-bridge/Dockerfile
T
bruno e5eb4125af
CI / test (push) Successful in 3m50s
fix: Dockerfile pin V to 0.5.2 commit (not latest)
V latest (git clone --depth 1) has incompatible APIs with
the source code written for V 0.5.2. Pin to exact commit
45ae01d to match local dev environment.
2026-08-03 20:03:56 -04:00

31 lines
1.1 KiB
Docker

# ── Build stage: compile ntfy-bridge from source ──────────────────────────
FROM alpine:3.20 AS builder
RUN apk add --no-cache gcc musl-dev git make
# Build V from source, pinned to V 0.5.2 commit
RUN git clone https://github.com/vlang/v /opt/v
WORKDIR /opt/v
RUN git checkout 45ae01d23168b6372f734eeb38a77360bbcf184a
RUN make
# Copy project source and build
WORKDIR /src
COPY . .
RUN /opt/v/v -prod -o /ntfy-bridge .
# ── Runtime stage: minimal image ───────────────────────────────────────────
FROM alpine:3.20
RUN apk add --no-cache ca-certificates tzdata curl
COPY --from=builder /ntfy-bridge /usr/local/bin/ntfy-bridge
WORKDIR /etc/ntfy-bridge
EXPOSE 9090
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:9090/health || exit 1
ENTRYPOINT ["/usr/local/bin/ntfy-bridge"]
CMD ["--quiet", "--config", "/etc/ntfy-bridge/ntfy-bridge.yaml"]