mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 04:39:24 +00:00
Don't run apps in Docker as root
This commit is contained in:
@@ -35,14 +35,18 @@ RUN --mount=type=cache,target=/root/.cargo \
|
||||
FROM debian:bookworm-slim as image
|
||||
LABEL description="STAGE 2: Copy and Run"
|
||||
|
||||
# Upgrade packages
|
||||
RUN apt update && apt upgrade -y
|
||||
|
||||
# Switch to a non-root user
|
||||
RUN useradd --system --home /home/serai --shell /sbin/nologin serai
|
||||
USER serai
|
||||
|
||||
WORKDIR /home/serai
|
||||
|
||||
# Copy necessary files to run node
|
||||
COPY --from=builder /serai/bin/serai-node /bin/
|
||||
COPY --from=builder /serai/AGPL-3.0 .
|
||||
|
||||
# Upgrade packages
|
||||
RUN apt update && apt upgrade -y
|
||||
COPY --from=builder --chown=serai /serai/bin/serai-node /bin/
|
||||
COPY --from=builder --chown=serai /serai/AGPL-3.0 .
|
||||
|
||||
# Run node
|
||||
EXPOSE 30333 9615 9933 9944
|
||||
|
||||
Reference in New Issue
Block a user