Merge pull request #45 from ahmedkrmn/non-root-user-docker
Modify docker file to use non-root user fixes #43
This commit is contained in:
commit
44f5d688e9
@ -1,6 +1,9 @@
|
||||
FROM node:10-alpine
|
||||
LABEL maintainer="OhMyForm <admin@ohmyform.com>"
|
||||
|
||||
# Create a group and a user with name "ohmyform".
|
||||
RUN addgroup --gid 9999 ohmyform && adduser -D --uid 9999 -G ohmyform ohmyform
|
||||
|
||||
# Install some needed packages
|
||||
RUN apk add --no-cache git=2.20.1-r0 python=2.7.16-r1 \
|
||||
&& rm -rf /tmp/* \
|
||||
@ -48,5 +51,8 @@ RUN npm install --only=production \
|
||||
&& bower install --allow-root -f \
|
||||
&& grunt build
|
||||
|
||||
# Change to non-root privilege
|
||||
USER ohmyform
|
||||
|
||||
# Run OhMyForm server
|
||||
CMD ["node", "server.js"]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user