Skip to content

Commit 4f4f996

Browse files
author
Singebob
committed
🐳 add user in dockerfile
1 parent bb4658e commit 4f4f996

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Dockerfile

+8-1
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,15 @@ FROM node:16.13.2-alpine
3030
# Define some ENV Vars
3131
ENV PORT=80 \
3232
DIRECTORY=/app \
33-
IS_DOCKER=true
33+
IS_DOCKER=true \
34+
UID=1000 \
35+
GUID=1000
3436

37+
# Create a group and user
38+
RUN addgroup --gid ${GUID} application \
39+
&& adduser --no-create-home --uid ${UID} application application
40+
41+
USER application
3542
# Create and set the working directory
3643
WORKDIR ${DIRECTORY}
3744

0 commit comments

Comments
 (0)