test multistage
This commit is contained in:
parent
9e2da2d30c
commit
6e71cd6976
1
.dockerignore
Normal file
1
.dockerignore
Normal file
@ -0,0 +1 @@
|
|||||||
|
.git
|
||||||
33
Dockerfile
33
Dockerfile
@ -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"
|
FROM "python:3.11-alpine"
|
||||||
LABEL maintainer="Cabillot Julien <dockerimages@cabillot.eu>"
|
LABEL maintainer="Cabillot Julien <dockerimages@cabillot.eu>"
|
||||||
|
|
||||||
|
# TODO: à tester
|
||||||
|
#USER "nobody"
|
||||||
|
|
||||||
COPY app /app
|
COPY app /app
|
||||||
COPY entrypoint.sh /app/entrypoint.sh
|
COPY entrypoint.sh /app/entrypoint.sh
|
||||||
|
|
||||||
WORKDIR "/app"
|
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" ]
|
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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user