From 808beb645b2771898d78f0b02687dcf1cf950543 Mon Sep 17 00:00:00 2001 From: Aditya Prima Date: Mon, 19 Aug 2024 13:28:30 +0700 Subject: [PATCH] Updated nginx rootless dockerfile --- Dockerfile.alpine-rootless | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile.alpine-rootless b/Dockerfile.alpine-rootless index 4181286..6be6f1a 100644 --- a/Dockerfile.alpine-rootless +++ b/Dockerfile.alpine-rootless @@ -4,10 +4,8 @@ ARG ALPINE_VERSION=3.20 FROM ${REGISTRY_URL}/alpine:${ALPINE_VERSION} LABEL maintainer=" aprimediet@gmail.com" -WORKDIR /app - # ADD USER -RUN addgroup -g 10001 nginx && adduser -D -u 10001 -G nginx -s /bin/bash -h /app nginx +RUN addgroup -g 10001 nginx && adduser -D -u 10001 -G nginx -s /sbin/nologin -h /app nginx # INSTALL WGET AND REQUIRED BUILD TOOLS RUN --mount=type=cache,target=/var/cache/apk \ @@ -31,8 +29,9 @@ RUN apk del curl && \ # SET AS USER NODE WORKDIR /app + USER nginx -CMD ["nginx"] +CMD ["nginx", "-g", "daemon off;"] EXPOSE 80 \ No newline at end of file