mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2025-12-31 19:47:25 +01:00
Set correct owner, file and directory permissions.
This commit is contained in:
20
debian/scripts/init.sh
vendored
20
debian/scripts/init.sh
vendored
@@ -29,22 +29,10 @@ docker_process_init_files() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create directories if they don't exist
|
# Ensure owner, file and directory permissions are correct
|
||||||
mkdir -p \
|
chown -R www-data:www-data /var/www/html/
|
||||||
/var/www/html/storage/app/public \
|
find /var/www/html/ -type f -exec chmod 644 {} \;
|
||||||
/var/www/html/storage/framework/cache \
|
find /var/www/html/ -type d -exec chmod 755 {} \;
|
||||||
/var/www/html/storage/framework/sessions \
|
|
||||||
/var/www/html/storage/framework/views \
|
|
||||||
/var/www/html/storage/logs \
|
|
||||||
/var/www/html/public/storage
|
|
||||||
|
|
||||||
# Set directory permissions without changing ownership
|
|
||||||
chmod -R 775 \
|
|
||||||
/var/www/html/storage \
|
|
||||||
/var/www/html/bootstrap/cache \
|
|
||||||
/var/www/html/public/storage
|
|
||||||
|
|
||||||
chown -R www-data:www-data /var/www/html/storage
|
|
||||||
|
|
||||||
# Clear and cache config in production
|
# Clear and cache config in production
|
||||||
if [ "$APP_ENV" = "production" ]; then
|
if [ "$APP_ENV" = "production" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user