Use non-root user to run deeplx

This commit is contained in:
Chao Tzu-Hsien 2026-05-23 19:12:30 +08:00
parent 432c0a223c
commit a987c82641
No known key found for this signature in database

View File

@ -6,5 +6,8 @@ RUN CGO_ENABLED=0 go build -a -installsuffix cgo -o deeplx .
FROM alpine:latest FROM alpine:latest
WORKDIR /app WORKDIR /app
COPY --from=builder /go/src/github.com/OwO-Network/DeepLX/deeplx /app/deeplx RUN addgroup -S deeplx && adduser -h /app -G deeplx -SH deeplx
CMD ["/app/deeplx"] USER deeplx
COPY --from=builder --chown=deeplx /go/src/github.com/OwO-Network/DeepLX/deeplx /app/deeplx
EXPOSE 1188
ENTRYPOINT ["/app/deeplx"]