Skip to content

Commit 1b88e42

Browse files
authored
feat(docker): non-root user + ENTRYPOINT (OwO-Network#222)
Closes OwO-Network#221. - Run as non-root using an Alpine system account (UID auto-assigned from the 100-999 system range, referenced by name to avoid hard-coding). - Replace CMD with ENTRYPOINT so args passed to `docker run` flow through to the deeplx binary. - EXPOSE 1188 for documentation.
1 parent 432c0a2 commit 1b88e42

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ RUN CGO_ENABLED=0 go build -a -installsuffix cgo -o deeplx .
66

77
FROM alpine:latest
88
WORKDIR /app
9-
COPY --from=builder /go/src/github.com/OwO-Network/DeepLX/deeplx /app/deeplx
10-
CMD ["/app/deeplx"]
9+
RUN addgroup -S deeplx && adduser -h /app -G deeplx -SH deeplx
10+
USER deeplx:deeplx
11+
COPY --from=builder --chown=deeplx:deeplx /go/src/github.com/OwO-Network/DeepLX/deeplx /app/deeplx
12+
EXPOSE 1188
13+
ENTRYPOINT ["/app/deeplx"]

0 commit comments

Comments
 (0)