-
-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change Dockerfile to run app under non-root user (#922)
- Loading branch information
1 parent
e046d6e
commit 74b714a
Showing
1 changed file
with
13 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
FROM alpine:3.18 | ||
|
||
RUN apk --no-cache upgrade && apk --no-cache add ca-certificates | ||
ARG USER=centrifugo | ||
ARG UID=1000 | ||
ARG GID=1000 | ||
|
||
COPY centrifugo /usr/local/bin/centrifugo | ||
RUN addgroup -S -g $GID $USER && \ | ||
adduser -S -G $USER -u $UID $USER | ||
|
||
RUN apk --no-cache upgrade && \ | ||
apk --no-cache add ca-certificates && \ | ||
update-ca-certificates | ||
|
||
USER $USER | ||
|
||
WORKDIR /centrifugo | ||
|
||
COPY centrifugo /usr/local/bin/centrifugo | ||
|
||
CMD ["centrifugo"] |