init
This commit is contained in:
30
Dockerfile
Normal file
30
Dockerfile
Normal file
@@ -0,0 +1,30 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
# Build Go binary
|
||||
FROM golang:1.22-alpine AS builder
|
||||
WORKDIR /src
|
||||
RUN apk add --no-cache ca-certificates tzdata
|
||||
COPY go.mod ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/ntfywui ./cmd/ntfywui
|
||||
|
||||
# Grab ntfy CLI binary from official image
|
||||
FROM binwiederhier/ntfy:latest AS ntfy
|
||||
|
||||
# Runtime
|
||||
FROM alpine:3.20
|
||||
RUN apk add --no-cache ca-certificates tzdata \
|
||||
&& addgroup -S ntfywui && adduser -S -G ntfywui -h /home/ntfywui ntfywui
|
||||
WORKDIR /app
|
||||
COPY --from=builder /out/ntfywui /usr/local/bin/ntfywui
|
||||
COPY --from=ntfy /usr/bin/ntfy /usr/bin/ntfy
|
||||
USER ntfywui
|
||||
EXPOSE 8080
|
||||
ENV NTFYWUI_LISTEN=:8080 \
|
||||
NTFYWUI_DATA_DIR=/data \
|
||||
NTFYWUI_NTFY_BIN=/usr/bin/ntfy \
|
||||
NTFYWUI_NTFY_CONFIG=/etc/ntfy/server.yml \
|
||||
NTFYWUI_COOKIE_SECURE=true
|
||||
VOLUME ["/data"]
|
||||
ENTRYPOINT ["/usr/local/bin/ntfywui"]
|
||||
Reference in New Issue
Block a user