Merge pull request #667 from turbo124/debian

Patches for copying files
This commit is contained in:
David Bomba
2024-12-03 15:01:54 +11:00
committed by GitHub
2 changed files with 6 additions and 5 deletions

View File

@@ -13,13 +13,14 @@ services:
env_file: env_file:
- ./.env - ./.env
volumes: volumes:
- ./scripts/init.sh:/usr/local/bin/init.sh
- ./.env:/var/www/html/.env:ro - ./.env:/var/www/html/.env:ro
- ./php/php.ini:/usr/local/etc/php/conf.d/zzz-php.ini:ro - ./php/php.ini:/usr/local/etc/php/conf.d/zzz-php.ini:ro
- ./php/php-fpm.conf:/usr/local/etc/php-fpm.d/zzz-php-fpm.conf:ro - ./php/php-fpm.conf:/usr/local/etc/php-fpm.d/zzz-php-fpm.conf:ro
- ./supervisor/supervisord.conf:/etc/supervisor/conf.d/supervisord.conf:ro - ./supervisor/supervisord.conf:/etc/supervisor/conf.d/supervisord.conf:ro
- app_storage:/var/www/html/storage - app_storage:/var/www/html/storage
- app_cache:/var/www/html/bootstrap/cache - app_cache:/var/www/html/bootstrap/cache
- image_public:/var/www/html/public:ro - image_public:/var/www/html/public
networks: networks:
- app-network - app-network
depends_on: depends_on:
@@ -37,7 +38,7 @@ services:
volumes: volumes:
- ./nginx:/etc/nginx/conf.d:ro - ./nginx:/etc/nginx/conf.d:ro
- app_storage:/var/www/html/storage:ro - app_storage:/var/www/html/storage:ro
- image_public:/var/www/html/public:ro - image_public:/var/www/html/public
networks: networks:
- app-network - app-network
depends_on: depends_on:

View File

@@ -54,13 +54,13 @@ fi
# Clean the existing public/ directory but exclude .js and .css files # Clean the existing public/ directory but exclude .js and .css files
if [ -d /var/www/html/public ]; then if [ -d /var/www/html/public ]; then
echo "Cleaning up stale files in public/ directory, retaining .js and .css files..." echo "Cleaning up .js and .css files in public/ directory..."
find /var/www/html/public -type f ! -name '*.js' ! -name '*.css' -exec rm -f {} \; find /var/www/html/public -type f \( -name '*.js' -o -name '*.css' \) -exec rm -f {} \;
fi fi
# Copy the public/ directory from the image to the mounted volume # Copy the public/ directory from the image to the mounted volume
echo "Copying public/ directory from image to volume..." echo "Copying public/ directory from image to volume..."
cp -r /image-original/public/* /var/www/html/public/ cp -r /image-original/public/* /var/www/html/
# Clear and cache config in production # Clear and cache config in production