From 8f7e0aac26ce535e7939058263b75647d1b2c11a Mon Sep 17 00:00:00 2001 From: cde-barros Date: Tue, 13 Feb 2024 15:25:14 +0100 Subject: [PATCH] run Docker image as non-root --- Dockerfile.prod | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile.prod b/Dockerfile.prod index 374d2fd3..228df166 100644 --- a/Dockerfile.prod +++ b/Dockerfile.prod @@ -31,5 +31,9 @@ RUN apk add --no-cache bash # Make our shell script executable RUN chmod +x env.sh +# change to non-root user +USER node +RUN chown -R node:node /usr/share/nginx/html + # Start Nginx server CMD ["/bin/bash", "-c", "/usr/share/nginx/html/env.sh && nginx -g \"daemon off;\""] \ No newline at end of file