From bd6ba154621930bfec0d64aa8feb895fb17c0cf7 Mon Sep 17 00:00:00 2001 From: Muhamad Aditya Prima Date: Thu, 22 May 2025 15:04:20 +0700 Subject: [PATCH] Added user: appuser --- Dockerfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4ec62a9..213886b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,12 @@ ARG TZ=Asia/Jakarta USER root # Install base dependencies, set timezone to designated timezone -RUN /sbin/apk update --no-cache; \ +RUN /bin/mkdir /app; \ + /usr/sbin/addgroup -g 10000 appuser; \ + /usr/sbin/adduser -D -u 10000 -G appuser -s /bin/sh -h /app appuser; \ + /bin/chmod 700 /app; \ + /bin/chown -R appuser:appuser /app; \ + /sbin/apk update --no-cache; \ /sbin/apk upgrade --no-cache; \ /sbin/apk add --update --no-cache \ tzdata; \ @@ -35,4 +40,7 @@ LABEL io.k8s.display-name="Alpine Linux ${OS_VERSION}" COPY --from=builder / / +USER appuser +WORKDIR /app + CMD ["/bin/sh"] \ No newline at end of file