Skip to content

Conversation

@GitTimeraider
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings October 6, 2025 16:38
@GitTimeraider GitTimeraider merged commit f58ba48 into main Oct 6, 2025
3 of 4 checks passed
Copy link

Copilot AI left a comment

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 enhances Docker security and read-only filesystem compatibility by refactoring the container entrypoint and user management. The changes introduce multiple deployment methods to support both traditional PUID/GUID setups and security-hardened environments with read-only filesystems.

Key changes:

  • Refactored entrypoint script with modular functions for user mapping, directory setup, and privilege management
  • Added comprehensive security-hardened Docker Compose configuration with read-only filesystem support
  • Updated environment variable naming from PGID to GUID for consistency
  • Created extensive documentation for PUID/GUID configuration methods

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
docker-entrypoint.sh Complete rewrite with modular functions supporting read-only filesystems and enhanced security
docker-compose.yml Updated PGID to GUID and reorganized environment variables for clarity
docker-compose.security.yml New security-hardened configuration with read-only filesystem, capability restrictions, and resource limits
PUID_GUID_GUIDE.md Comprehensive documentation covering multiple deployment methods and troubleshooting
Dockerfile Added build-time user creation and ownership settings for security hardening
.env.example Updated PGID to GUID and added performance configuration examples

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

Comment on lines +16 to +20
is_readonly_fs() {
# Try to create a test file in /tmp to check if filesystem is writable
touch /tmp/.write-test 2>/dev/null && rm -f /tmp/.write-test 2>/dev/null
return $?
}
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

The function name is_readonly_fs() suggests it returns true when the filesystem is read-only, but the logic returns true when the filesystem is writable. This creates confusion as the return value is opposite to what the name implies.

Copilot uses AI. Check for mistakes.
postgres_data:
driver: local
mariadb_data:

Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

There's an extra blank line between the volume name and its configuration. This should be removed for consistency with the other volume definitions.

Suggested change

Copilot uses AI. Check for mistakes.
# These should be mounted as volumes in production
ensure_writable_dirs() {
# Only attempt directory creation if we can write
if is_readonly_fs; then
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

Due to the inverted logic in is_readonly_fs(), this condition will execute read-only filesystem handling when the filesystem is actually writable, and vice versa. The function should be renamed to is_writable_fs() or the logic should be inverted.

Copilot uses AI. Check for mistakes.
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.

2 participants