Fix nginx temp directory permissions in Dockerfile

- Create nginx temp directories during build
- Set proper ownership (www-data) and permissions (775)
- Fixes 'Permission denied' error on PDF uploads
This commit is contained in:
TheMaddax 2025-12-18 10:49:12 -07:00
parent b2b061b57a
commit a81f26ce88

View file

@ -55,9 +55,16 @@ RUN composer dump-autoload --optimize
# Create log directory for supervisor
RUN mkdir -p /var/log/supervisor
# Create nginx temp directories and set permissions
RUN mkdir -p /var/lib/nginx/tmp/client_body \
/var/lib/nginx/tmp/proxy \
/var/lib/nginx/tmp/fastcgi \
/var/lib/nginx/tmp/uwsgi \
/var/lib/nginx/tmp/scgi
# Set permissions
RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache
RUN chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache
RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache /var/lib/nginx/tmp
RUN chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache /var/lib/nginx/tmp
# Copy nginx configuration
COPY docker/nginx.conf /etc/nginx/nginx.conf