diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2cec03c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,47 @@ +# Use the official PHP image based on Alpine Linux +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 \ + libzip-dev \ + zip \ + unzip \ + libmcrypt-dev \ + && 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 + +# 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 + +# Install Composer +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer + +# Install Laravel dependencies +RUN composer install --no-plugins --no-scripts + +# 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 + +# Expose port 9000 and start php-fpm server +EXPOSE 9000 +CMD ["php-fpm"] \ No newline at end of file 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( 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/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/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 --}}