From 7d1000318f61bfe77c1cedae6dd09767bf1dd31e Mon Sep 17 00:00:00 2001 From: franknstayn Date: Sat, 26 Aug 2023 22:47:51 +0800 Subject: [PATCH 01/42] updated --- resources/views/user-layouts/user_template.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/user-layouts/user_template.blade.php b/resources/views/user-layouts/user_template.blade.php index fd6d38f..c5a103b 100755 --- a/resources/views/user-layouts/user_template.blade.php +++ b/resources/views/user-layouts/user_template.blade.php @@ -669,7 +669,7 @@ - {{-- Chartjs --}} From 980d5e158eb8120acbb626b494b4b048e2aaeb93 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Sun, 27 Aug 2023 18:27:45 +0800 Subject: [PATCH 02/42] added docker file --- Dockerfile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fbaf9bc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM alpine + +ENV \ + APP_DIR="/app" \ + APP_PORT="80" + +# the "app" directory (relative to Dockerfile) containers your Laravel app... +COPY app/ $APP_DIR + +RUN apk add --update \ + curl \ + php \ + php-opcache \ + php-openssl \ + php-pdo \ + php-json \ + php-phar \ + php-dom \ + && rm -rf /var/cache/apk/* + +RUN curl -sS https://getcomposer.org/installer | php -- \ + --install-dir=/usr/bin --filename=composer + +RUN cd $APP_DIR && composer install + +WORKDIR $APP_DIR +CMD php artisan serve --host=0.0.0.0 --port=$APP_PORT \ No newline at end of file From d289c06fc87566c8bb0ab238ebadf9adb4a16fc3 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Sun, 27 Aug 2023 18:40:02 +0800 Subject: [PATCH 03/42] updated --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index fbaf9bc..e974294 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ ENV \ APP_DIR="/app" \ APP_PORT="80" -# the "app" directory (relative to Dockerfile) containers your Laravel app... +# the "app" directory (relative to Dockerfile) contains your Laravel app... COPY app/ $APP_DIR RUN apk add --update \ @@ -18,10 +18,10 @@ RUN apk add --update \ php-dom \ && rm -rf /var/cache/apk/* -RUN curl -sS https://getcomposer.org/installer | php -- \ - --install-dir=/usr/bin --filename=composer +# Download and make Composer executable +RUN curl -sS https://getcomposer.org/composer-stable.phar -o /usr/bin/composer && chmod +x /usr/bin/composer RUN cd $APP_DIR && composer install WORKDIR $APP_DIR -CMD php artisan serve --host=0.0.0.0 --port=$APP_PORT \ No newline at end of file +CMD php artisan serve --host=0.0.0.0 --port=$APP_PORT From d30f41f8732eeba2f7858638750979da60609fca Mon Sep 17 00:00:00 2001 From: franknstayn Date: Sun, 27 Aug 2023 18:45:56 +0800 Subject: [PATCH 04/42] updated --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e974294..b2e8e2d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,8 +4,8 @@ ENV \ APP_DIR="/app" \ APP_PORT="80" -# the "app" directory (relative to Dockerfile) contains your Laravel app... -COPY app/ $APP_DIR +# Copy the contents of the "merchbay_laravel5" directory into the container's app directory +COPY merchbay_laravel5/ $APP_DIR RUN apk add --update \ curl \ @@ -21,7 +21,8 @@ RUN apk add --update \ # Download and make Composer executable RUN curl -sS https://getcomposer.org/composer-stable.phar -o /usr/bin/composer && chmod +x /usr/bin/composer -RUN cd $APP_DIR && composer install +# Using the ENV variable within the RUN command +RUN cd "$APP_DIR" && composer install WORKDIR $APP_DIR CMD php artisan serve --host=0.0.0.0 --port=$APP_PORT From 5e60178635e70d7c011b45414ea544296bb6fda1 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Sun, 27 Aug 2023 18:49:01 +0800 Subject: [PATCH 05/42] updated --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b2e8e2d..ef6fc12 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ ENV \ APP_PORT="80" # Copy the contents of the "merchbay_laravel5" directory into the container's app directory -COPY merchbay_laravel5/ $APP_DIR +COPY ./ $APP_DIR RUN apk add --update \ curl \ From 48d41a563c39ef1b18e49a4c18b513cda5167d97 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Sun, 27 Aug 2023 18:56:14 +0800 Subject: [PATCH 06/42] updated --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ef6fc12..6a97441 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ RUN apk add --update \ RUN curl -sS https://getcomposer.org/composer-stable.phar -o /usr/bin/composer && chmod +x /usr/bin/composer # Using the ENV variable within the RUN command -RUN cd "$APP_DIR" && composer install +RUN cd "$APP_DIR" && composer install -v --ignore-platform-reqs WORKDIR $APP_DIR CMD php artisan serve --host=0.0.0.0 --port=$APP_PORT From 8f2afd8008f128ca2f28deade0ba5e8526a78d0d Mon Sep 17 00:00:00 2001 From: franknstayn Date: Sun, 27 Aug 2023 18:57:43 +0800 Subject: [PATCH 07/42] updated --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 6a97441..0143724 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,7 @@ RUN apk add --update \ php-json \ php-phar \ php-dom \ + mbstring \ && rm -rf /var/cache/apk/* # Download and make Composer executable From 2e12a7d60caffffe7057d6e177eb87a2c296b6f5 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Sun, 27 Aug 2023 19:06:42 +0800 Subject: [PATCH 08/42] updated --- Dockerfile | 51 ++++++++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0143724..a2f668a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,29 +1,34 @@ -FROM alpine +# Use the official PHP image based on Alpine Linux +FROM php:7.4-fpm-alpine -ENV \ - APP_DIR="/app" \ - APP_PORT="80" +# Install system dependencies and PHP extensions +RUN apk --update --no-cache add \ + libpng-dev \ + libjpeg-turbo-dev \ + freetype-dev \ + libzip-dev \ + zip \ + unzip \ + && docker-php-ext-configure gd --with-freetype --with-jpeg \ + && docker-php-ext-install gd pdo pdo_mysql zip -# Copy the contents of the "merchbay_laravel5" directory into the container's app directory -COPY ./ $APP_DIR +# Set the working directory in the container +WORKDIR /var/www/html -RUN apk add --update \ - curl \ - php \ - php-opcache \ - php-openssl \ - php-pdo \ - php-json \ - php-phar \ - php-dom \ - mbstring \ - && rm -rf /var/cache/apk/* +# Copy the Laravel application files to the container +COPY . . -# Download and make Composer executable -RUN curl -sS https://getcomposer.org/composer-stable.phar -o /usr/bin/composer && chmod +x /usr/bin/composer +# Set appropriate permissions for Laravel storage and bootstrap cache +RUN chown -R www-data:www-data storage bootstrap/cache -# Using the ENV variable within the RUN command -RUN cd "$APP_DIR" && composer install -v --ignore-platform-reqs +# Install Composer +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer -WORKDIR $APP_DIR -CMD php artisan serve --host=0.0.0.0 --port=$APP_PORT +# Install Laravel dependencies +RUN composer install + +# Expose port 9000 for PHP-FPM +EXPOSE 9000 + +# Start PHP-FPM +CMD ["php-fpm"] From 6632baac92728a10b9c4fdc5c301ff9e619888e0 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Sun, 27 Aug 2023 19:12:17 +0800 Subject: [PATCH 09/42] updated --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a2f668a..a682325 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ WORKDIR /var/www/html COPY . . # Set appropriate permissions for Laravel storage and bootstrap cache -RUN chown -R www-data:www-data storage bootstrap/cache +RUN chown -R www-data:www-data storage bootstrap # Install Composer RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer From 10bcec7e1a303c4c8d4fbbe6b85a84a2a2455f44 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Sun, 27 Aug 2023 19:15:04 +0800 Subject: [PATCH 10/42] updated --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a682325..b0cfa7e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,8 +9,9 @@ RUN apk --update --no-cache add \ libzip-dev \ zip \ unzip \ + libmcrypt-dev \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && docker-php-ext-install gd pdo pdo_mysql zip + && docker-php-ext-install gd pdo pdo_mysql zip mcrypt # Set the working directory in the container WORKDIR /var/www/html From 46d26e204bc5548ac27e06f155d7c03331cc08ce Mon Sep 17 00:00:00 2001 From: franknstayn Date: Sun, 27 Aug 2023 19:37:42 +0800 Subject: [PATCH 11/42] updated --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b0cfa7e..4582ea3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Use the official PHP image based on Alpine Linux -FROM php:7.4-fpm-alpine +FROM php:5.6-fpm-alpine # Install system dependencies and PHP extensions RUN apk --update --no-cache add \ From 0dd7ac0a42f4b29c8e4b2cda5e26c95dc32f3048 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Sun, 27 Aug 2023 19:55:37 +0800 Subject: [PATCH 12/42] update port --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4582ea3..eefcfd9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,7 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local RUN composer install # Expose port 9000 for PHP-FPM -EXPOSE 9000 +EXPOSE 80 # Start PHP-FPM CMD ["php-fpm"] From fa930dbc21922c6f696a426ce65718873ced843f Mon Sep 17 00:00:00 2001 From: franknstayn Date: Mon, 28 Aug 2023 03:01:05 +0800 Subject: [PATCH 13/42] update --- Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Dockerfile b/Dockerfile index eefcfd9..7421751 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ FROM php:5.6-fpm-alpine # Install system dependencies and PHP extensions RUN apk --update --no-cache add \ + nginx \ libpng-dev \ libjpeg-turbo-dev \ freetype-dev \ @@ -13,9 +14,14 @@ RUN apk --update --no-cache add \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ && docker-php-ext-install gd pdo pdo_mysql zip mcrypt + + # Set the working directory in the container WORKDIR /var/www/html +# Copy Nginx config +COPY nginx/default.conf /etc/nginx/conf.d/default.conf + # Copy the Laravel application files to the container COPY . . @@ -28,6 +34,9 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local # Install Laravel dependencies RUN composer install +# Generate Laravel application key +RUN php artisan key:generate + # Expose port 9000 for PHP-FPM EXPOSE 80 From 53a39500b9fc5c9f7ba27083ec3bdf35a9b6a667 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Mon, 28 Aug 2023 03:03:48 +0800 Subject: [PATCH 14/42] update --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7421751..75cb86b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ RUN apk --update --no-cache add \ WORKDIR /var/www/html # Copy Nginx config -COPY nginx/default.conf /etc/nginx/conf.d/default.conf +COPY default.conf /etc/nginx/conf.d/default.conf # Copy the Laravel application files to the container COPY . . From 9fe4ec5e5da9be2c8aa7663221a4720024274c56 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Mon, 28 Aug 2023 03:06:59 +0800 Subject: [PATCH 15/42] updated --- default.conf | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 default.conf diff --git a/default.conf b/default.conf new file mode 100644 index 0000000..cb7d259 --- /dev/null +++ b/default.conf @@ -0,0 +1,19 @@ +server { + listen 80; + server_name localhost; + + root /var/www/html/public; + + index index.php; + + location / { + try_files $uri $uri/ /index.php?$query_string; + } + + location ~ \.php$ { + fastcgi_pass php-fpm:9000; # Use the service name + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } +} \ No newline at end of file From 45c8c949348d34471e19817e618a8372ea6440ce Mon Sep 17 00:00:00 2001 From: franknstayn Date: Mon, 28 Aug 2023 03:09:58 +0800 Subject: [PATCH 16/42] updated --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 75cb86b..c7891b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,7 +38,7 @@ RUN composer install RUN php artisan key:generate # Expose port 9000 for PHP-FPM -EXPOSE 80 +EXPOSE 9000 # Start PHP-FPM CMD ["php-fpm"] From 1c9ddf5cb57b36139a5cfffdb8e98c3b43adedfa Mon Sep 17 00:00:00 2001 From: franknstayn Date: Mon, 28 Aug 2023 03:11:28 +0800 Subject: [PATCH 17/42] updated --- Dockerfile | 2 +- default.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c7891b7..da10640 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,7 +38,7 @@ RUN composer install RUN php artisan key:generate # Expose port 9000 for PHP-FPM -EXPOSE 9000 +EXPOSE 9001 # Start PHP-FPM CMD ["php-fpm"] diff --git a/default.conf b/default.conf index cb7d259..ac2f2ec 100644 --- a/default.conf +++ b/default.conf @@ -11,7 +11,7 @@ server { } location ~ \.php$ { - fastcgi_pass php-fpm:9000; # Use the service name + fastcgi_pass php-fpm:9001; # Use the service name fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; From 3a20d34db5a292c257ab1290f71551af814170dd Mon Sep 17 00:00:00 2001 From: franknstayn Date: Mon, 28 Aug 2023 03:16:36 +0800 Subject: [PATCH 18/42] updated --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index da10640..9c50e80 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Use the official PHP image based on Alpine Linux -FROM php:5.6-fpm-alpine +FROM php:5.6-fpm # Install system dependencies and PHP extensions RUN apk --update --no-cache add \ From f98ed60226c4042db3566f38c868b396595b3414 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Mon, 28 Aug 2023 03:18:13 +0800 Subject: [PATCH 19/42] updated --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9c50e80..da10640 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Use the official PHP image based on Alpine Linux -FROM php:5.6-fpm +FROM php:5.6-fpm-alpine # Install system dependencies and PHP extensions RUN apk --update --no-cache add \ From 75cb6fba5276e9f5ae521d0321557b45174dc0dd Mon Sep 17 00:00:00 2001 From: franknstayn Date: Mon, 28 Aug 2023 03:21:34 +0800 Subject: [PATCH 20/42] updated --- default.conf | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/default.conf b/default.conf index ac2f2ec..9c02997 100644 --- a/default.conf +++ b/default.conf @@ -2,7 +2,9 @@ server { listen 80; server_name localhost; - root /var/www/html/public; + root /var/www/html; + index index.php index.html; + index index.php; @@ -10,10 +12,20 @@ server { try_files $uri $uri/ /index.php?$query_string; } - location ~ \.php$ { - fastcgi_pass php-fpm:9001; # Use the service name - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - include fastcgi_params; + location ~ \.php { + fastcgi_index index.php; + fastcgi_pass unix:/var/run/php/php5.6-fpm.sock; + + include fastcgi_params; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + } + + location ~* \.(css|less|js|jpg|png|gif)$ { + add_header Cache-Control "no-cache, no-store, must-revalidate"; + add_header Pragma "no-cache"; + expires 0; } } \ No newline at end of file From 1fb6862c798b952ee825b93860db7fd443de61c6 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Mon, 28 Aug 2023 03:44:00 +0800 Subject: [PATCH 21/42] updated --- Dockerfile | 3 ++- default.conf | 28 ++++++++++++---------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index da10640..18e0966 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,7 +38,8 @@ RUN composer install RUN php artisan key:generate # Expose port 9000 for PHP-FPM +EXPOSE 80 EXPOSE 9001 # Start PHP-FPM -CMD ["php-fpm"] +CMD ["nginx", "-g", "daemon off;", "&", "php-fpm"] diff --git a/default.conf b/default.conf index 9c02997..cb2f91c 100644 --- a/default.conf +++ b/default.conf @@ -5,27 +5,23 @@ server { root /var/www/html; index index.php index.html; - - index index.php; - location / { try_files $uri $uri/ /index.php?$query_string; } - location ~ \.php { - fastcgi_index index.php; - fastcgi_pass unix:/var/run/php/php5.6-fpm.sock; - - include fastcgi_params; - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + location ~ \.php { + fastcgi_index index.php; + fastcgi_pass php-fpm:9001; # Use the service name and exposed port + include fastcgi_params; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location ~* \.(css|less|js|jpg|png|gif)$ { - add_header Cache-Control "no-cache, no-store, must-revalidate"; - add_header Pragma "no-cache"; - expires 0; + add_header Cache-Control "no-cache, no-store, must-revalidate"; + add_header Pragma "no-cache"; + expires 0; } -} \ No newline at end of file +} From dab7dc1536359b067df96eccce458981ab198170 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Mon, 28 Aug 2023 03:47:21 +0800 Subject: [PATCH 22/42] updated --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 18e0966..f9aec68 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,4 +42,4 @@ EXPOSE 80 EXPOSE 9001 # Start PHP-FPM -CMD ["nginx", "-g", "daemon off;", "&", "php-fpm"] +CMD service php5.6-fpm start && nginx -g "daemon off;" From eb1547626f0b550e688117d2520bdc9fe8b4d7db Mon Sep 17 00:00:00 2001 From: franknstayn Date: Mon, 28 Aug 2023 03:49:43 +0800 Subject: [PATCH 23/42] updated --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index f9aec68..c07ee9e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ FROM php:5.6-fpm-alpine # Install system dependencies and PHP extensions RUN apk --update --no-cache add \ + php5.6-fpm \ nginx \ libpng-dev \ libjpeg-turbo-dev \ From e6e781d24be0ba657d6374fbd14973da307cecae Mon Sep 17 00:00:00 2001 From: franknstayn Date: Mon, 28 Aug 2023 03:52:05 +0800 Subject: [PATCH 24/42] updated --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c07ee9e..c558e46 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,6 @@ FROM php:5.6-fpm-alpine # Install system dependencies and PHP extensions RUN apk --update --no-cache add \ - php5.6-fpm \ nginx \ libpng-dev \ libjpeg-turbo-dev \ @@ -43,4 +42,4 @@ EXPOSE 80 EXPOSE 9001 # Start PHP-FPM -CMD service php5.6-fpm start && nginx -g "daemon off;" +CMD php-fpm start && nginx -g "daemon off;" From 673c179212d2fb0b55ace2982ecd83908c4503f6 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Mon, 28 Aug 2023 03:58:24 +0800 Subject: [PATCH 25/42] updated --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c558e46..e036936 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,4 +42,5 @@ EXPOSE 80 EXPOSE 9001 # Start PHP-FPM -CMD php-fpm start && nginx -g "daemon off;" +CMD ["php-fpm"] + From 8baa6b0d13f9bc55ff4c95180cd73a84d80139be Mon Sep 17 00:00:00 2001 From: franknstayn Date: Mon, 28 Aug 2023 04:03:49 +0800 Subject: [PATCH 26/42] updated --- default.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/default.conf b/default.conf index cb2f91c..1af1113 100644 --- a/default.conf +++ b/default.conf @@ -11,7 +11,7 @@ server { location ~ \.php { fastcgi_index index.php; - fastcgi_pass php-fpm:9001; # Use the service name and exposed port + fastcgi_pass unix:/var/run/php/php5.6-fpm.sock; include fastcgi_params; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; From 69c83ba408c45c15a676f4b68836a9134c6171b8 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Mon, 28 Aug 2023 04:08:34 +0800 Subject: [PATCH 27/42] updated --- default.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/default.conf b/default.conf index 1af1113..86e9646 100644 --- a/default.conf +++ b/default.conf @@ -11,7 +11,7 @@ server { location ~ \.php { fastcgi_index index.php; - fastcgi_pass unix:/var/run/php/php5.6-fpm.sock; + fastcgi_pass merchbay:9001; # Use the service name and exposed port include fastcgi_params; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; From 11c056776636533abfdc321f3f360903353d35cb Mon Sep 17 00:00:00 2001 From: franknstayn Date: Mon, 28 Aug 2023 04:20:39 +0800 Subject: [PATCH 28/42] uppdated --- Dockerfile | 3 ++- default.conf | 2 +- entrypoint.sh | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index e036936..c8d1dc5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,7 @@ WORKDIR /var/www/html # Copy Nginx config COPY default.conf /etc/nginx/conf.d/default.conf +COPY entrypoint.sh /etc/entrypoint.sh # Copy the Laravel application files to the container COPY . . @@ -42,5 +43,5 @@ EXPOSE 80 EXPOSE 9001 # Start PHP-FPM -CMD ["php-fpm"] +ENTRYPOINT ["/etc/entrypoint.sh"] diff --git a/default.conf b/default.conf index 86e9646..13894c1 100644 --- a/default.conf +++ b/default.conf @@ -11,7 +11,7 @@ server { location ~ \.php { fastcgi_index index.php; - fastcgi_pass merchbay:9001; # Use the service name and exposed port + fastcgi_pass 127.0.0.1:9001; # Use the service name and exposed port include fastcgi_params; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..7636288 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +set -e + +php-fpm -D +nginx -g 'daemon off;' \ No newline at end of file From 8719532704e31521c9a19b45ba59b45376657273 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Mon, 28 Aug 2023 04:22:27 +0800 Subject: [PATCH 29/42] uppdated --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index c8d1dc5..16bc28a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,6 +22,7 @@ WORKDIR /var/www/html # Copy Nginx config COPY default.conf /etc/nginx/conf.d/default.conf COPY entrypoint.sh /etc/entrypoint.sh +RUN chmod +x /etc/entrypoint.sh # Copy the Laravel application files to the container COPY . . From 19ccbb0fb088e2ea1c822808b4a13c5e20f126d6 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Mon, 28 Aug 2023 04:26:03 +0800 Subject: [PATCH 30/42] uppdated --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 16bc28a..283b212 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,7 @@ WORKDIR /var/www/html COPY default.conf /etc/nginx/conf.d/default.conf COPY entrypoint.sh /etc/entrypoint.sh RUN chmod +x /etc/entrypoint.sh +RUN mkdir -p /run/nginx # Copy the Laravel application files to the container COPY . . From 45f6a01d89340a1dd01a3a38d84b4ebae9953a20 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Mon, 28 Aug 2023 04:28:21 +0800 Subject: [PATCH 31/42] uppdated --- default.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/default.conf b/default.conf index 13894c1..3115758 100644 --- a/default.conf +++ b/default.conf @@ -11,7 +11,7 @@ server { location ~ \.php { fastcgi_index index.php; - fastcgi_pass 127.0.0.1:9001; # Use the service name and exposed port + fastcgi_pass 192.168.111.129:9001; # Use the service name and exposed port include fastcgi_params; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; From 1e6ceed833b09e875106231aa410326f23df5807 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Mon, 28 Aug 2023 04:32:28 +0800 Subject: [PATCH 32/42] uppdated --- default.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/default.conf b/default.conf index 3115758..aa01f47 100644 --- a/default.conf +++ b/default.conf @@ -11,7 +11,7 @@ server { location ~ \.php { fastcgi_index index.php; - fastcgi_pass 192.168.111.129:9001; # Use the service name and exposed port + fastcgi_pass unix:/var/run/php/php5.6-fpm.sock; # Use the service name and exposed port include fastcgi_params; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; From 16960e2e5d70089bd72998282e41194cd6250d45 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Wed, 30 Aug 2023 00:13:36 +0800 Subject: [PATCH 33/42] updated --- Dockerfile | 2 +- default.conf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 283b212..a9c5853 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,7 +41,7 @@ RUN composer install RUN php artisan key:generate # Expose port 9000 for PHP-FPM -EXPOSE 80 +EXPOSE 82 EXPOSE 9001 # Start PHP-FPM diff --git a/default.conf b/default.conf index aa01f47..ba7bd0d 100644 --- a/default.conf +++ b/default.conf @@ -1,5 +1,5 @@ server { - listen 80; + listen 82; server_name localhost; root /var/www/html; @@ -11,7 +11,7 @@ server { location ~ \.php { fastcgi_index index.php; - fastcgi_pass unix:/var/run/php/php5.6-fpm.sock; # Use the service name and exposed port + fastcgi_pass 127.0.0.1:9001; # Use the service name and exposed port include fastcgi_params; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; From d6a1123bfc8354410df3c089990b266dae8d57c3 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Wed, 30 Aug 2023 00:21:53 +0800 Subject: [PATCH 34/42] updated --- Dockerfile | 2 +- default.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a9c5853..283b212 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,7 +41,7 @@ RUN composer install RUN php artisan key:generate # Expose port 9000 for PHP-FPM -EXPOSE 82 +EXPOSE 80 EXPOSE 9001 # Start PHP-FPM diff --git a/default.conf b/default.conf index ba7bd0d..c587223 100644 --- a/default.conf +++ b/default.conf @@ -1,5 +1,5 @@ server { - listen 82; + listen 127.0.0.1:80; server_name localhost; root /var/www/html; From 6bc9fd4979717327df4907310941e0b056494976 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Wed, 30 Aug 2023 00:25:44 +0800 Subject: [PATCH 35/42] upadted --- default.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/default.conf b/default.conf index c587223..13894c1 100644 --- a/default.conf +++ b/default.conf @@ -1,5 +1,5 @@ server { - listen 127.0.0.1:80; + listen 80; server_name localhost; root /var/www/html; From 0d93411576a507ca1a857ca14b9e5182b80ef6b5 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Wed, 30 Aug 2023 00:47:48 +0800 Subject: [PATCH 36/42] upadted --- default.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/default.conf b/default.conf index 13894c1..86e9646 100644 --- a/default.conf +++ b/default.conf @@ -11,7 +11,7 @@ server { location ~ \.php { fastcgi_index index.php; - fastcgi_pass 127.0.0.1:9001; # Use the service name and exposed port + fastcgi_pass merchbay:9001; # Use the service name and exposed port include fastcgi_params; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; From b9d395f7b46e387e1d34bc0b1e5142ff4bd063a3 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Wed, 30 Aug 2023 00:50:49 +0800 Subject: [PATCH 37/42] upadted --- default.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/default.conf b/default.conf index 86e9646..3115758 100644 --- a/default.conf +++ b/default.conf @@ -11,7 +11,7 @@ server { location ~ \.php { fastcgi_index index.php; - fastcgi_pass merchbay:9001; # Use the service name and exposed port + fastcgi_pass 192.168.111.129:9001; # Use the service name and exposed port include fastcgi_params; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; From af1e3e065191607d325848fbf9ba650e993aa0e9 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Wed, 30 Aug 2023 01:03:25 +0800 Subject: [PATCH 38/42] upadted --- Dockerfile | 6 +++--- default.conf | 2 +- www.conf | 9 +++++++++ 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 www.conf diff --git a/Dockerfile b/Dockerfile index 283b212..534235f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,6 @@ RUN apk --update --no-cache add \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ && docker-php-ext-install gd pdo pdo_mysql zip mcrypt - - # Set the working directory in the container WORKDIR /var/www/html @@ -40,10 +38,12 @@ RUN composer install # Generate Laravel application key RUN php artisan key:generate +# Copy the www.conf file to PHP-FPM pool.d directory +COPY www.conf /usr/local/etc/php-fpm.d/www.conf + # Expose port 9000 for PHP-FPM EXPOSE 80 EXPOSE 9001 # Start PHP-FPM ENTRYPOINT ["/etc/entrypoint.sh"] - diff --git a/default.conf b/default.conf index 3115758..781a6f4 100644 --- a/default.conf +++ b/default.conf @@ -11,7 +11,7 @@ server { location ~ \.php { fastcgi_index index.php; - fastcgi_pass 192.168.111.129:9001; # Use the service name and exposed port + fastcgi_pass unix:/run/php-fpm.sock; include fastcgi_params; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; diff --git a/www.conf b/www.conf new file mode 100644 index 0000000..46885d7 --- /dev/null +++ b/www.conf @@ -0,0 +1,9 @@ +; www.conf +[www] +listen = /run/php-fpm.sock +listen.owner = www-data +listen.group = www-data +listen.mode = 0660 + +user = www-data +group = www-data From e767d3f0e943a84ec1577c62a6b7319d24d751fd Mon Sep 17 00:00:00 2001 From: franknstayn Date: Wed, 30 Aug 2023 01:06:22 +0800 Subject: [PATCH 39/42] updated --- www.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/www.conf b/www.conf index 46885d7..be77822 100644 --- a/www.conf +++ b/www.conf @@ -7,3 +7,9 @@ listen.mode = 0660 user = www-data group = www-data + +pm = dynamic ; You can choose 'static', 'dynamic', or 'ondemand' +pm.max_children = 5 ; Adjust as needed +pm.start_servers = 2 ; Adjust as needed +pm.min_spare_servers = 1 ; Adjust as needed +pm.max_spare_servers = 3 ; Adjust as needed From 006169a8b7016b5de2d271ad6d5623753fa5c94e Mon Sep 17 00:00:00 2001 From: franknstayn Date: Wed, 30 Aug 2023 01:10:32 +0800 Subject: [PATCH 40/42] updated --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 534235f..232b2bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,6 +38,9 @@ RUN composer install # Generate Laravel application key RUN php artisan key:generate +# Create directory for the socket and set permissions +RUN mkdir -p /run/php && chown www-data:www-data /run/php + # Copy the www.conf file to PHP-FPM pool.d directory COPY www.conf /usr/local/etc/php-fpm.d/www.conf From adf50d9d690a3af19579fb09a1bf913893efbf03 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Mon, 4 Sep 2023 23:22:33 +0800 Subject: [PATCH 41/42] added docker files and update roster form --- Dockerfile | 21 ++++----- default.conf | 27 ----------- docker-compose.yml | 45 +++++++++++++++++++ entrypoint.sh | 5 --- nginx/conf.d/app.conf | 39 ++++++++++++++++ php/local.ini | 2 + .../roster-name-number-size-form.blade.php | 2 + www.conf | 15 ------- 8 files changed, 96 insertions(+), 60 deletions(-) delete mode 100644 default.conf create mode 100644 docker-compose.yml delete mode 100644 entrypoint.sh create mode 100644 nginx/conf.d/app.conf create mode 100644 php/local.ini delete mode 100644 www.conf diff --git a/Dockerfile b/Dockerfile index 232b2bc..2cec03c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,17 +15,15 @@ RUN apk --update --no-cache add \ && docker-php-ext-install gd pdo pdo_mysql zip mcrypt # Set the working directory in the container -WORKDIR /var/www/html +WORKDIR /var/www -# Copy Nginx config -COPY default.conf /etc/nginx/conf.d/default.conf -COPY entrypoint.sh /etc/entrypoint.sh -RUN chmod +x /etc/entrypoint.sh -RUN mkdir -p /run/nginx +# Clear cache +# RUN apt-get clean && rm -rf /var/lib/apt/lists/* # Copy the Laravel application files to the container COPY . . + # Set appropriate permissions for Laravel storage and bootstrap cache RUN chown -R www-data:www-data storage bootstrap @@ -33,7 +31,7 @@ RUN chown -R www-data:www-data storage bootstrap RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer # Install Laravel dependencies -RUN composer install +RUN composer install --no-plugins --no-scripts # Generate Laravel application key RUN php artisan key:generate @@ -44,9 +42,6 @@ RUN mkdir -p /run/php && chown www-data:www-data /run/php # Copy the www.conf file to PHP-FPM pool.d directory COPY www.conf /usr/local/etc/php-fpm.d/www.conf -# Expose port 9000 for PHP-FPM -EXPOSE 80 -EXPOSE 9001 - -# Start PHP-FPM -ENTRYPOINT ["/etc/entrypoint.sh"] +# Expose port 9000 and start php-fpm server +EXPOSE 9000 +CMD ["php-fpm"] \ No newline at end of file diff --git a/default.conf b/default.conf deleted file mode 100644 index 781a6f4..0000000 --- a/default.conf +++ /dev/null @@ -1,27 +0,0 @@ -server { - listen 80; - server_name localhost; - - root /var/www/html; - index index.php index.html; - - location / { - try_files $uri $uri/ /index.php?$query_string; - } - - location ~ \.php { - fastcgi_index index.php; - fastcgi_pass unix:/run/php-fpm.sock; - include fastcgi_params; - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - } - - location ~* \.(css|less|js|jpg|png|gif)$ { - add_header Cache-Control "no-cache, no-store, must-revalidate"; - add_header Pragma "no-cache"; - expires 0; - } -} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9ce204e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,45 @@ +version: '3' +services: + + #PHP Service + app: + build: + context: . + dockerfile: Dockerfile + image: digitalocean.com/php + container_name: app + restart: unless-stopped + tty: true + environment: + SERVICE_NAME: app + SERVICE_TAGS: dev + working_dir: /var/www + volumes: + - ./:/var/www + - ./php/local.ini:/usr/local/etc/php/conf.d/local.ini + networks: + - app-network + + #Nginx Service + webserver: + image: nginx:alpine + container_name: webserver + restart: unless-stopped + tty: true + ports: + - "9091:80" + - "443:443" + volumes: + - ./:/var/www + - ./nginx/conf.d/:/etc/nginx/conf.d/ + networks: + - app-network + +#Docker Networks +networks: + app-network: + driver: bridge +#Volumes +volumes: + dbdata: + driver: local \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100644 index 7636288..0000000 --- a/entrypoint.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env sh -set -e - -php-fpm -D -nginx -g 'daemon off;' \ No newline at end of file diff --git a/nginx/conf.d/app.conf b/nginx/conf.d/app.conf new file mode 100644 index 0000000..501fb8a --- /dev/null +++ b/nginx/conf.d/app.conf @@ -0,0 +1,39 @@ +server { + listen 80; + index index.php index.html; + error_log /var/log/nginx/error.log; + access_log /var/log/nginx/access.log; + root /var/www; + index index.php index.html; + + location / { + if ($request_method = 'OPTIONS') { + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE, HEAD'; + add_header 'Access-Control-Max-Age' '1728000'; + add_header 'Access-Control-Allow-Headers' '*'; + #add_header 'Content-Type: text/plain; charset=UTF-8'; + #add_header 'Content-Length: 0'; + return 204; + } + try_files $uri $uri/ /index.php?$query_string; + + } + location ~ \.php$ { + fastcgi_index index.php; + fastcgi_pass app:9000; + + include fastcgi_params; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + + } + location ~* \.(css|less|js|jpg|png|gif)$ { + add_header Cache-Control "no-cache, no-store, must-revalidate"; + add_header Pragma "no-cache"; + expires 0; + } + +} \ No newline at end of file diff --git a/php/local.ini b/php/local.ini new file mode 100644 index 0000000..2f65e19 --- /dev/null +++ b/php/local.ini @@ -0,0 +1,2 @@ +upload_max_filesize=40M +post_max_size=40M \ No newline at end of file diff --git a/resources/views/teamstore-sublayouts/forms/roster-name-number-size-form.blade.php b/resources/views/teamstore-sublayouts/forms/roster-name-number-size-form.blade.php index 8d1f50e..66359ed 100644 --- a/resources/views/teamstore-sublayouts/forms/roster-name-number-size-form.blade.php +++ b/resources/views/teamstore-sublayouts/forms/roster-name-number-size-form.blade.php @@ -15,6 +15,7 @@ + @foreach($sizes_array as $size) @endforeach diff --git a/www.conf b/www.conf deleted file mode 100644 index be77822..0000000 --- a/www.conf +++ /dev/null @@ -1,15 +0,0 @@ -; www.conf -[www] -listen = /run/php-fpm.sock -listen.owner = www-data -listen.group = www-data -listen.mode = 0660 - -user = www-data -group = www-data - -pm = dynamic ; You can choose 'static', 'dynamic', or 'ondemand' -pm.max_children = 5 ; Adjust as needed -pm.start_servers = 2 ; Adjust as needed -pm.min_spare_servers = 1 ; Adjust as needed -pm.max_spare_servers = 3 ; Adjust as needed From e1cf0dc676c06cd7b0dc4b138614d1766f5f1e26 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Wed, 6 Sep 2023 20:43:41 +0800 Subject: [PATCH 42/42] updated shipping for global --- app/Http/Controllers/teamstore/TeamStoreController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/teamstore/TeamStoreController.php b/app/Http/Controllers/teamstore/TeamStoreController.php index 8e68ab0..6b7408a 100755 --- a/app/Http/Controllers/teamstore/TeamStoreController.php +++ b/app/Http/Controllers/teamstore/TeamStoreController.php @@ -840,7 +840,7 @@ class TeamStoreController extends Controller } } - if ($getVoucher[0]->VoucherType === "Shipping") { + if ($getVoucher[0]->VoucherType === "Shipping" && $getVoucher[0]->UserId != null) { if (Auth::guest()) { return response()->json(array(