services-garbaye/podman-ntfy/container/Containerfile

41 lines
1.3 KiB
Plaintext
Raw Normal View History

2022-11-15 18:16:59 +00:00
#Build stage
2023-12-03 09:29:28 +00:00
FROM docker.io/library/golang:1.21-bullseye AS build-env
2022-11-15 18:16:59 +00:00
ARG NTFY_VERSION
2023-12-03 09:29:28 +00:00
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/* \
2023-10-26 10:26:31 +00:00
&& git clone --depth=1 -b "${NTFY_VERSION}" https://github.com/binwiederhier/ntfy.git /ntfybuild
WORKDIR /ntfybuild
2023-12-03 09:29:28 +00:00
RUN make web && make docs && make cli-deps-all && make VERSION=$NTFY_VERSION cli-linux-amd64
2022-11-15 18:16:59 +00:00
2023-12-03 09:29:28 +00:00
FROM docker.io/library/alpine:latest
2022-11-15 18:16:59 +00:00
LABEL maintainer="contact@garbaye.fr"
EXPOSE 80/tcp
2023-10-26 10:26:31 +00:00
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
2022-11-15 18:16:59 +00:00
USER ntfy
ENTRYPOINT ["ntfy"]
2023-10-26 10:26:31 +00:00
COPY --from=build-env /ntfybuild/dist/ntfy_linux_amd64_linux_amd64_v1/ntfy /usr/bin/ntfy