- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 606
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
- Loading branch information
1 parent
6e046e5
commit 08660a3
Showing
1 changed file
with
8 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,15 @@ | ||
FROM alpine:3.18 | ||
|
||
RUN apk --no-cache upgrade && apk --no-cache add ca-certificates | ||
ARG USER=centrifugo | ||
|
||
COPY centrifugo /usr/local/bin/centrifugo | ||
RUN adduser -H -D $USER \ | ||
&& apk --no-cache upgrade \ | ||
&& apk --no-cache add ca-certificates | ||
|
||
USER $USER | ||
|
||
WORKDIR /centrifugo | ||
|
||
COPY centrifugo /usr/local/bin/centrifugo | ||
|
||
CMD ["centrifugo"] |