Fix storage permissions: use named volume to avoid bind mount chown errors

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-06 05:22:58 +05:00
parent c193bbc32a
commit eaadf86ea1
2 changed files with 10 additions and 2 deletions

View File

@@ -52,9 +52,14 @@ RUN composer install \
--no-autoloader \
--prefer-dist
RUN composer dump-autoload --no-scripts --optimize --classmap-authoritative && \
RUN mkdir -p /var/www/storage/app/public \
/var/www/storage/framework/cache \
/var/www/storage/framework/sessions \
/var/www/storage/framework/views \
/var/www/storage/logs && \
composer dump-autoload --no-scripts --optimize --classmap-authoritative && \
chown -R root:www-data /var/www && \
chmod 755 -R /var/www && \
chmod -R 775 /var/www/bootstrap/cache
chmod -R 775 /var/www/storage /var/www/bootstrap/cache
WORKDIR /var/www

View File

@@ -9,6 +9,7 @@ services:
restart: always
volumes:
- ./:/var/www
- storage_data:/var/www/storage
depends_on:
- db
web:
@@ -17,6 +18,7 @@ services:
restart: always
volumes:
- ./:/var/www
- storage_data:/var/www/storage
- ./_docker/nginx/conf.d:/etc/nginx/conf.d
ports:
- "8005:80"
@@ -37,3 +39,4 @@ services:
volumes:
postgres_data:
storage_data: