Commit 619d4e9
committed
Implement Docker rootless user with reviewer feedback improvements
This commit implements the rootless user functionality for both production
and development Docker images with all improvements from PR #837 review:
Changes made:
- Added rootless user setup using 'rails' username (not 'rails_api_base')
- Used ARG instead of ENV for USERNAME, USER_UID, and USER_GID build variables
- Set proper file ownership and permissions (700) for security
- Added explanatory comment for temporary root switch in jemalloc symlink creation
- Applied --chown and --chmod flags to all COPY operations
Security improvements:
- Application now runs as non-root user (UID/GID 1000)
- Reduced attack surface by limiting privileges
- Follows Docker security best practices
Files modified:
- Dockerfile: Added rootless user for production image
- Dockerfile.dev: Added rootless user for development image
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent c114ef8 commit 619d4e9
2 files changed
+42
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
66 | 79 | | |
67 | 80 | | |
68 | 81 | | |
69 | 82 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
75 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
76 | 92 | | |
| 93 | + | |
77 | 94 | | |
78 | 95 | | |
79 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
25 | 38 | | |
26 | 39 | | |
27 | 40 | | |
28 | 41 | | |
29 | 42 | | |
30 | 43 | | |
31 | 44 | | |
32 | | - | |
| 45 | + | |
33 | 46 | | |
34 | 47 | | |
35 | 48 | | |
36 | 49 | | |
37 | | - | |
| 50 | + | |
38 | 51 | | |
39 | 52 | | |
40 | | - | |
| 53 | + | |
41 | 54 | | |
42 | 55 | | |
43 | 56 | | |
| |||
0 commit comments