docker: support running the container as www-data (uid 33)
Build and Deploy (dev) / build (push) Successful in 4m23s
Build and Deploy (dev) / build (push) Successful in 4m23s
- Set ownership of storage, bootstrap/cache and public/assets/vendor at build time - Entrypoint only creates/chowns directories when running as root Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1fdc5559cf
commit
da971e1646
2 files changed
+21
-16
No files matched your search
+5
-2
@@ -77,8 +77,11 @@ RUN mkdir -p \
|
||||
# Generate the optimized autoloader and run composer scripts (package:discover)
|
||||
RUN composer dump-autoload --no-dev --optimize --no-interaction
|
||||
|
||||
# Copy the npm packages into public/assets/vendor
|
||||
RUN node scripts/setup-vendor.js
|
||||
# Copy the npm packages into public/assets/vendor, then make the directories
|
||||
# Laravel writes to owned by www-data, so the container can run as uid 33
|
||||
RUN node scripts/setup-vendor.js \
|
||||
&& chown -R www-data:www-data storage bootstrap/cache public/assets/vendor \
|
||||
&& chmod -R ug+rwX storage bootstrap/cache public/assets/vendor
|
||||
|
||||
# Copy and set up entrypoint script
|
||||
COPY docker-entrypoint.sh /usr/local/bin/
|
||||
|
||||
Reference in new issue
Block a user