services-garbaye/podman-ntfy/container/Containerfile
2023-12-03 10:29:28 +01:00

41 lines
1.3 KiB
Docker

#Build stage
FROM docker.io/library/golang:1.21-bullseye AS build-env
ARG NTFY_VERSION
ARG VERSION=dev
ARG COMMIT=unknown
ARG NODE_MAJOR=18
RUN apt-get update && apt-get install -y \
build-essential ca-certificates curl gnupg \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" >> /etc/apt/sources.list.d/nodesource.list \
&& apt-get update \
&& apt-get install -y \
python3-pip \
python3-venv \
nodejs \
&& rm -rf /var/lib/apt/lists/* \
&& git clone --depth=1 -b "${NTFY_VERSION}" https://github.com/binwiederhier/ntfy.git /ntfybuild
WORKDIR /ntfybuild
RUN make web && make docs && make cli-deps-all && make VERSION=$NTFY_VERSION cli-linux-amd64
FROM docker.io/library/alpine:latest
LABEL maintainer="contact@garbaye.fr"
EXPOSE 80/tcp
RUN apk add --no-cache tzdata \
&& adduser -S -H -D ntfy \
&& mkdir /etc/ntfy \
&& chown ntfy:nogroup /etc/ntfy \
&& mkdir /var/cache/ntfy \
&& chown ntfy:nogroup /var/cache/ntfy
USER ntfy
ENTRYPOINT ["ntfy"]
COPY --from=build-env /ntfybuild/dist/ntfy_linux_amd64_linux_amd64_v1/ntfy /usr/bin/ntfy