test multistage

This commit is contained in:
Julien Cabillot 2023-02-21 16:19:04 -05:00
parent 9e2da2d30c
commit 6e71cd6976
2 changed files with 23 additions and 11 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
.git

View File

@ -1,20 +1,31 @@
# ntfy est pas encore dispo en dehors de testing sur alpine actuellement
FROM "python:3.11-alpine" AS dlntfy
RUN wget https://github.com/binwiederhier/ntfy/releases/download/v2.0.1/ntfy_2.0.1_linux_armv7.tar.gz && \
tar zxvf ntfy_2.0.1_linux_armv7.tar.gz && \
mv ntfy_2.0.1_linux_armv7/ntfy /usr/local/bin/ && \
ntfy --help
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"
# ntfy est pas encore dispo en dehors de testing sur alpine actuellement
RUN pip install --no-cache-dir --requirement requirements.txt && \
wget https://github.com/binwiederhier/ntfy/releases/download/v2.0.1/ntfy_2.0.1_linux_armv7.tar.gz && \
tar zxvf ntfy_2.0.1_linux_armv7.tar.gz && \
cp -a ntfy_2.0.1_linux_armv7/ntfy /usr/local/bin && \
mkdir /etc/ntfy && \
rm -rf ntfy_2.0.1* && \
ntfy --help
#USER "nobody"
ENTRYPOINT [ "/app/entrypoint.sh" ]
COPY --from=dlntfy /usr/local/bin/ntfy /usr/local/bin/ntfy
RUN mkdir /etc/ntfy
COPY --from=pipdependencies /root/.local /root/.local