# syntax=docker.io/docker/dockerfile:1

FROM "python:3.11-alpine" AS pipdependencies

COPY app/requirements.txt /requirements.txt

RUN pip3 install --no-cache-dir --user --requirement requirements.txt

FROM "python:3.11-alpine"
LABEL maintainer="Cabillot Julien <dockerimages@cabillot.eu>"

# TODO: à tester
#USER "nobody"

COPY app /app
COPY entrypoint.sh /app/entrypoint.sh

WORKDIR "/app"

ENTRYPOINT [ "/app/entrypoint.sh" ]

COPY --from=binwiederhier/ntfy:v2.0.1 /usr/bin/ntfy /usr/local/bin/ntfy
RUN mkdir /etc/ntfy

COPY --from=pipdependencies /root/.local /root/.local
