diff --git a/quarto-py-shinylive/Dockerfile.of b/quarto-py-shinylive/Dockerfile similarity index 69% rename from quarto-py-shinylive/Dockerfile.of rename to quarto-py-shinylive/Dockerfile index 5ea499a..4ba5be7 100644 --- a/quarto-py-shinylive/Dockerfile.of +++ b/quarto-py-shinylive/Dockerfile @@ -1,9 +1,14 @@ FROM ghcr.io/openfaas/of-watchdog:0.10.1 AS watchdog FROM alpine:3.20 -COPY app /app + +RUN adduser -D app +USER app +WORKDIR /home/app +COPY app . + COPY --from=watchdog /fwatchdog . ENV mode="static" -ENV static_path="/app" +ENV static_path="/home/app" HEALTHCHECK --interval=3s CMD [ -e /tmp/.lock ] || exit 1 CMD ["./fwatchdog"] diff --git a/quarto-py-shinylive/Dockerfile.multi b/quarto-py-shinylive/Dockerfile.multi index 0845871..b1b5d02 100644 --- a/quarto-py-shinylive/Dockerfile.multi +++ b/quarto-py-shinylive/Dockerfile.multi @@ -16,13 +16,15 @@ RUN pip install --no-cache-dir --upgrade -r requirements.txt RUN quarto add quarto-ext/shinylive --no-prompt RUN quarto render /root/app/index.qmd --output-dir /root/output - FROM ghcr.io/openfaas/of-watchdog:0.10.1 AS watchdog FROM alpine:3.20 -COPY --from=builder /root/output /app +RUN adduser -D app +USER app +WORKDIR /home/app +COPY --from=builder /root/output /home/app COPY --from=watchdog /fwatchdog . ENV mode="static" -ENV static_path="/app" +ENV static_path="/home/app" HEALTHCHECK --interval=3s CMD [ -e /tmp/.lock ] || exit 1 CMD ["./fwatchdog"] diff --git a/quarto-py-shinylive/README.md b/quarto-py-shinylive/README.md index 826e5a8..c0e23ea 100644 --- a/quarto-py-shinylive/README.md +++ b/quarto-py-shinylive/README.md @@ -23,7 +23,7 @@ export DOCKER_DEFAULT_PLATFORM=linux/amd64 export NAME=faithful/quarto-py-shinylive # Build image -docker build -t ${NAME}:of -f Dockerfile.of . +docker build -t ${NAME}:of -f Dockerfile . # Run image, visit http://localhost:8080 docker run --rm -p 8080:8080 ${NAME}:of diff --git a/quarto-r-shinylive/Dockerfile.of b/quarto-r-shinylive/Dockerfile similarity index 69% rename from quarto-r-shinylive/Dockerfile.of rename to quarto-r-shinylive/Dockerfile index 5ea499a..4ba5be7 100644 --- a/quarto-r-shinylive/Dockerfile.of +++ b/quarto-r-shinylive/Dockerfile @@ -1,9 +1,14 @@ FROM ghcr.io/openfaas/of-watchdog:0.10.1 AS watchdog FROM alpine:3.20 -COPY app /app + +RUN adduser -D app +USER app +WORKDIR /home/app +COPY app . + COPY --from=watchdog /fwatchdog . ENV mode="static" -ENV static_path="/app" +ENV static_path="/home/app" HEALTHCHECK --interval=3s CMD [ -e /tmp/.lock ] || exit 1 CMD ["./fwatchdog"] diff --git a/quarto-r-shinylive/Dockerfile.multi b/quarto-r-shinylive/Dockerfile.multi index 56e4b67..1be7c73 100644 --- a/quarto-r-shinylive/Dockerfile.multi +++ b/quarto-r-shinylive/Dockerfile.multi @@ -13,13 +13,15 @@ COPY quarto-r-shinylive/index.qmd /root/app/index.qmd RUN quarto add quarto-ext/shinylive --no-prompt RUN quarto render /root/app/index.qmd --output-dir /root/output - FROM ghcr.io/openfaas/of-watchdog:0.10.1 AS watchdog FROM alpine:3.20 -COPY --from=builder /root/output /app +RUN adduser -D app +USER app +WORKDIR /home/app +COPY --from=builder /root/output /home/app COPY --from=watchdog /fwatchdog . ENV mode="static" -ENV static_path="/app" +ENV static_path="/home/app" HEALTHCHECK --interval=3s CMD [ -e /tmp/.lock ] || exit 1 CMD ["./fwatchdog"] diff --git a/quarto-r-shinylive/README.md b/quarto-r-shinylive/README.md index daa32f5..27659de 100644 --- a/quarto-r-shinylive/README.md +++ b/quarto-r-shinylive/README.md @@ -22,7 +22,7 @@ export DOCKER_DEFAULT_PLATFORM=linux/amd64 export NAME=faithful/quarto-r-shinylive # Build image -docker build -t ${NAME}:of -f Dockerfile.of . +docker build -t ${NAME}:of -f Dockerfile . # Run image, visit http://localhost:8080 docker run --rm -p 8080:8080 ${NAME}:of