Skip to content

Commit

Permalink
change Dockerfile to run app under non-root user (#922)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmeremyanin authored Dec 21, 2024
1 parent e046d6e commit 74b714a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Dockerfile
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"]

0 comments on commit 74b714a

Please sign in to comment.