From 9ad2ab23956e6be85525c80f17774a5b0a818192 Mon Sep 17 00:00:00 2001 From: Bruno Paz <184563+brpaz@users.noreply.github.com> Date: Sat, 6 Apr 2024 16:07:55 +0100 Subject: [PATCH] feat: add non root user (#7) --- Dockerfile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e5c4ed7..255c408 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,20 @@ # Use Alpine base image with edge repository FROM --platform=${BUILDPLATFORM} alpine:edge +ARG PGID=1000 +ARG PUID=1000 +ENV PGID=${PGID} +ENV PUID=${PUID} +ENV USER=app +ENV TZ="UTC" + # hadolint ignore=DL3018 -RUN apk update && \ +RUN addgroup -g ${PGID} ${USER} && \ + adduser -D -u ${PUID} -G ${USER} ${USER} && \ + apk update && \ apk add --no-cache curl bash ffmpeg yt-dlp && \ yt-dlp --version +USER app + ENTRYPOINT ["yt-dlp"]