Skip to content

Commit

Permalink
Change Dockerfile to run app under non-root user
Browse files Browse the repository at this point in the history
  • Loading branch information
dmeremyanin committed Dec 12, 2024
1 parent 6e046e5 commit 08660a3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Dockerfile
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"]

0 comments on commit 08660a3

Please sign in to comment.