From c4e1d0e3a5ae30c0b955d230911d1bbf95732cc5 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 3 Dec 2024 14:49:58 +1100 Subject: [PATCH 1/3] Updates for copy files --- debian/docker-compose.yml | 6 +++--- debian/scripts/init.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/debian/docker-compose.yml b/debian/docker-compose.yml index e5b96c0..2a9a34d 100644 --- a/debian/docker-compose.yml +++ b/debian/docker-compose.yml @@ -19,7 +19,7 @@ services: - ./supervisor/supervisord.conf:/etc/supervisor/conf.d/supervisord.conf:ro - app_storage:/var/www/html/storage - app_cache:/var/www/html/bootstrap/cache - - image_public:/var/www/html/public:ro + - image_public:/var/www/html/public networks: - app-network depends_on: @@ -33,11 +33,11 @@ services: image: nginx:alpine restart: unless-stopped ports: - - "80:80" + - "8012:80" volumes: - ./nginx:/etc/nginx/conf.d:ro - app_storage:/var/www/html/storage:ro - - image_public:/var/www/html/public:ro + - image_public:/var/www/html/public networks: - app-network depends_on: diff --git a/debian/scripts/init.sh b/debian/scripts/init.sh index d62cb94..d231146 100755 --- a/debian/scripts/init.sh +++ b/debian/scripts/init.sh @@ -54,13 +54,13 @@ fi # Clean the existing public/ directory but exclude .js and .css files if [ -d /var/www/html/public ]; then - echo "Cleaning up stale files in public/ directory, retaining .js and .css files..." - find /var/www/html/public -type f ! -name '*.js' ! -name '*.css' -exec rm -f {} \; + echo "Cleaning up .js and .css files in public/ directory..." + find /var/www/html/public -type f \( -name '*.js' -o -name '*.css' \) -exec rm -f {} \; fi # Copy the public/ directory from the image to the mounted 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 From 5e40e349439b873bec60497cbd8c8603b76e1d50 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 3 Dec 2024 14:59:41 +1100 Subject: [PATCH 2/3] run local init.sh file --- debian/docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/docker-compose.yml b/debian/docker-compose.yml index 2a9a34d..eaf37c6 100644 --- a/debian/docker-compose.yml +++ b/debian/docker-compose.yml @@ -13,6 +13,7 @@ services: env_file: - ./.env volumes: + - ./scripts/init.sh:/usr/local/bin/init.sh - ./.env:/var/www/html/.env: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 From d5ed1935f7b8a2d7f93a1ef4e5b5d955c901222a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 3 Dec 2024 15:01:08 +1100 Subject: [PATCH 3/3] set port 80 --- debian/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/docker-compose.yml b/debian/docker-compose.yml index eaf37c6..f00bc1d 100644 --- a/debian/docker-compose.yml +++ b/debian/docker-compose.yml @@ -34,7 +34,7 @@ services: image: nginx:alpine restart: unless-stopped ports: - - "8012:80" + - "80:80" volumes: - ./nginx:/etc/nginx/conf.d:ro - app_storage:/var/www/html/storage:ro