2023-12-20 08:46:21 +00:00
|
|
|
FROM docker.io/golang:1.21-alpine3.19 AS builder
|
2023-05-09 12:24:48 +00:00
|
|
|
|
|
|
|
RUN echo "ntfy:x:2222:2222:Linux User,,,:/:/ntfy" > /passwd
|
|
|
|
RUN mkdir -p /data/attachments
|
|
|
|
|
|
|
|
RUN apk --no-cache add \
|
|
|
|
git \
|
|
|
|
make \
|
|
|
|
musl-dev \
|
|
|
|
gcc \
|
|
|
|
npm
|
|
|
|
|
2024-03-28 13:48:46 +00:00
|
|
|
ENV VERSION=v2.10.0
|
2023-05-09 12:24:48 +00:00
|
|
|
RUN git clone https://github.com/binwiederhier/ntfy.git
|
|
|
|
|
|
|
|
WORKDIR /go/ntfy
|
|
|
|
RUN git checkout "$VERSION"
|
|
|
|
|
2023-12-20 08:46:21 +00:00
|
|
|
ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE"
|
|
|
|
|
2023-05-09 12:24:48 +00:00
|
|
|
RUN make web
|
|
|
|
RUN make web-build
|
|
|
|
RUN make cli-linux-server
|
|
|
|
|
|
|
|
|
|
|
|
FROM scratch
|
|
|
|
|
|
|
|
COPY --from=builder /passwd /etc/passwd
|
|
|
|
COPY --from=builder --chown=2222:2222 /data /data
|
|
|
|
COPY --from=builder /go/ntfy/dist/ntfy_linux_server/ntfy /ntfy
|
|
|
|
|
|
|
|
USER ntfy
|
|
|
|
|
|
|
|
ENV NTFY_LISTEN_HTTP=:8080
|
|
|
|
ENV NTFY_CACHE_FILE=/data/cache.db
|
|
|
|
ENV NTFY_ATTACHMENT_CACHE_DIR=/data/attachments
|
|
|
|
ENV NTFY_AUTH_FILE=/data/user.db
|
|
|
|
ENV NTFY_ENABLE_LOGIN=true
|
|
|
|
|
|
|
|
CMD ["/ntfy", "serve", "-debug", "--trace"]
|