File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,18 +44,26 @@ FROM oven/bun:1-slim AS production
4444
4545WORKDIR /app
4646
47+ # Create non-root user for security (Trivy DS002)
48+ RUN groupadd --gid 1001 tinyclaw && \
49+ useradd --uid 1001 --gid tinyclaw --shell /bin/sh tinyclaw
50+
4751# Copy everything needed at runtime
48- COPY --from=builder /app/package.json ./
49- COPY --from=builder /app/bun.lock ./
50- COPY --from=builder /app/packages ./packages
51- COPY --from=builder /app/src ./src
52- COPY --from=builder /app/plugins ./plugins
53- COPY --from=builder /app/node_modules ./node_modules
52+ COPY --from=builder --chown=tinyclaw:tinyclaw /app/package.json ./
53+ COPY --from=builder --chown=tinyclaw:tinyclaw /app/bun.lock ./
54+ COPY --from=builder --chown=tinyclaw:tinyclaw /app/packages ./packages
55+ COPY --from=builder --chown=tinyclaw:tinyclaw /app/src ./src
56+ COPY --from=builder --chown=tinyclaw:tinyclaw /app/plugins ./plugins
57+ COPY --from=builder --chown=tinyclaw:tinyclaw /app/node_modules ./node_modules
5458
5559# SQLite data volume (defaults to ~/.tinyclaw inside the container)
5660ENV TINYCLAW_DATA_DIR=/data
61+ RUN mkdir -p /data && chown tinyclaw:tinyclaw /data
5762VOLUME /data
5863
64+ # Switch to non-root user
65+ USER tinyclaw
66+
5967# API + Web UI
6068EXPOSE 3000
6169
You can’t perform that action at this time.
0 commit comments