Skip to content

Optimize Nut-server Docker configuration and security#1

Open
eskwisit wants to merge 1 commit intomainfrom
optimize-nut-server-17297820138796096883
Open

Optimize Nut-server Docker configuration and security#1
eskwisit wants to merge 1 commit intomainfrom
optimize-nut-server-17297820138796096883

Conversation

@eskwisit
Copy link
Owner

@eskwisit eskwisit commented Mar 5, 2026

I have optimized the Docker configuration and repository structure for the nut-server. Key improvements include:

  1. Security: The container now runs as a non-root user (nut, UID 1000) by default.
  2. Image Optimization: Multiple RUN layers have been consolidated, and build-time dependencies (like gcc and libssl-dev) are now purged in the same layer to minimize final image size.
  3. Streamlined Build: The nut codebase is now fetched using curl and extracted directly into /app, avoiding temporary ZIP files.
  4. Dependency Management: GUI-related packages are automatically removed from requirements.txt to keep the server-only image slim.
  5. Repository Best Practices: Added a .dockerignore file to prevent local development artifacts from bloating the build context.
  6. Documentation Update: The README.md has been updated with the new volume paths and notes on host directory permissions for the non-root user.

PR created automatically by Jules for task 17297820138796096883 started by @eskwisit

- Consolidate multiple RUN layers into a single instruction to reduce image size.
- Implement a non-root user 'nut' (UID 1000) for improved security.
- Refactor the fetching and patching logic using curl and tar.
- Add a .dockerignore file to exclude unnecessary files from the build context.
- Update the README.md to reflect the new non-root user and revised volume paths (/app/conf, /app/_NSPOUT).
- Ensure build-time dependencies (gcc, -dev libraries) are removed after installation.
- Patch requirements.txt to remove GUI dependencies and add markupsafe==2.0.1 for stability.

Co-authored-by: eskwisit <47784621+eskwisit@users.noreply.github.com>
@google-labs-jules
Copy link

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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.

1 participant