Skip to content

Chmod first - #47

Merged
GewoonJaap merged 2 commits into
mainfrom
fix/docker-issue
Oct 21, 2025
Merged

Chmod first#47
GewoonJaap merged 2 commits into
mainfrom
fix/docker-issue

Conversation

@GewoonJaap

Copy link
Copy Markdown
Owner

Fixes #14
This pull request updates the Dockerfile to streamline the setup and permissions of the start.sh startup script. The changes simplify the process by using Docker's built-in features for file permissions and remove redundant commands.

Improvements to Dockerfile setup and permissions:

  • Replaced the manual chmod and chown commands for start.sh with a single COPY --chmod=755 instruction, ensuring the script has execute permissions immediately upon copying.
  • Removed redundant COPY --chown and RUN chmod +x lines for start.sh, relying on the updated COPY command for both placement and permissions.

Entrypoint configuration:

  • Clarified the use of the startup script by directly setting it as the Docker entrypoint, ensuring consistent container initialization.

Copilot AI review requested due to automatic review settings October 21, 2025 13:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR simplifies the Dockerfile by consolidating the setup of the start.sh startup script into a single COPY command with built-in permission settings, eliminating redundant operations.

Key changes:

  • Consolidated script copying and permission setting into one COPY --chmod=755 instruction
  • Removed duplicate COPY --chown and RUN chmod +x commands
  • Moved the script setup earlier in the Dockerfile (before USER switch)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread Dockerfile Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings October 21, 2025 13:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread Dockerfile
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.
@GewoonJaap
GewoonJaap merged commit 5fc929e into main Oct 21, 2025
2 checks passed
@GewoonJaap
GewoonJaap deleted the fix/docker-issue branch October 21, 2025 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Permission denied to /app/start.sh when trying to start Docker container

2 participants