Skip to content

Dockerfile runtime stage runs as root — output files on host owned by root #73

@coderabbitai

Description

@coderabbitai

Problem

The runtime stage of the Dockerfile never drops root privileges. As a result, all files written to bind-mounted /data/* paths (outputs, checkpoints, logs, cache, splits) end up owned by root on the host, which is both a security concern (increases the container's blast radius) and a practical inconvenience.

Suggested fix

Add a dedicated non-root system user in the runtime stage, chown the application and data directories to that user, and add a USER directive before ENTRYPOINT:

RUN groupadd --system waterflow \
    && useradd --system --create-home --gid waterflow waterflow

# (after all COPY/mkdir steps)
RUN chown -R waterflow:waterflow /app /data

USER waterflow
ENTRYPOINT ["/app/entrypoint.sh"]

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions