-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat : ci and docker file updated for usergroup
- Loading branch information
1 parent
be98501
commit b443ba1
Showing
2 changed files
with
75 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
FROM node:18-alpine3.16 AS build | ||
|
||
RUN addgroup -S puzzgroup && adduser -S -G puzzgroup puzzuser | ||
ARG USERGROUP | ||
|
||
RUN addgroup allusers && adduser -S -G allusers $USERGROUP | ||
RUN mkdir /.npm | ||
RUN mkdir /.npm/_cacache | ||
|
||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
RUN npm ci --only=production | ||
COPY . . | ||
|
||
RUN chown -R puzzuser:puzzgroup /app | ||
USER puzzuser | ||
RUN chown -R $USERGROUP:allusers . | ||
RUN chown -R $USERGROUP:allusers ~/.npm | ||
RUN chown -R $USERGROUP:allusers /.npm | ||
RUN chmod -R 777 . | ||
|
||
EXPOSE 9191 | ||
|
||
USER $USERGROUP | ||
|
||
CMD ["npm", "run", "start"] |