Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ RUN mkdir -p .mf && \
chown -R worker:nodejs /app && \
chown -R worker:nodejs /home/worker

# Copy and setup start script with proper permissions and ownership
COPY --chmod=755 --chown=worker:nodejs start.sh /app/start.sh

Copilot AI Oct 21, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script is copied with permissions 755 before switching to the non-root user. If the start.sh file contains sensitive information or credentials, this could allow other users on the system to read it. Consider using more restrictive permissions like 750 or 700 to limit access to the owner and group only.

Suggested change
COPY --chmod=755 --chown=worker:nodejs start.sh /app/start.sh
COPY --chmod=700 --chown=worker:nodejs start.sh /app/start.sh

Copilot uses AI. Check for mistakes.

# Switch to non-root user for security
USER worker

Expand All @@ -50,9 +53,5 @@ EXPOSE 8787
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:8787/health || exit 1

# Create a startup script to handle environment variables
COPY --chown=worker:nodejs start.sh /app/start.sh
RUN chmod +x /app/start.sh

# Use the startup script as entrypoint
# Run the startup script
ENTRYPOINT ["/app/start.sh"]