diff --git a/.docker/roadrunner/Dockerfile b/.docker/roadrunner/Dockerfile index 373c1ea..3d9610c 100644 --- a/.docker/roadrunner/Dockerfile +++ b/.docker/roadrunner/Dockerfile @@ -263,23 +263,24 @@ COPY ./.docker/roadrunner/config/rr.yaml /etc/.rr.yaml WORKDIR /app -#COPY composer.* ./ +COPY .docker/roadrunner/docker-healthcheck.sh /usr/local/bin/docker-healthcheck -#RUN composer install \ -# --no-dev \ -# --no-interaction \ -# --prefer-dist \ -# --no-scripts \ -# --ignore-platform-reqs \ -# --optimize-autoloader \ -# --apcu-autoloader \ -# --ansi +COPY ./ /app +RUN composer install \ + --no-dev \ + --no-interaction \ + --prefer-dist \ + --no-scripts \ + --ignore-platform-reqs \ + --optimize-autoloader \ + --apcu-autoloader \ + --ansi -COPY .docker/roadrunner/docker-healthcheck.sh /usr/local/bin/docker-healthcheck +RUN composer dumpautoload RUN chmod +x /usr/local/bin/docker-healthcheck HEALTHCHECK --interval=1s --timeout=10s --retries=30 CMD ["docker-healthcheck"] -COPY ./ /app + CMD ["/usr/bin/rr", "serve", "-d", "-c", "/etc/.rr.yaml"] diff --git a/.env.example b/.env.example index 211d0bf..eabff28 100644 --- a/.env.example +++ b/.env.example @@ -57,5 +57,5 @@ SENTRY_TRACES_SAMPLE_RATE=0.25 PAYPAL_CLIENT_ID=see_developer_paypal_com PAYPAL_CLIENT_SECRET= -RR_VERSION=2.9.4 -PHP_IMAGE_VERSION=8.0.14-cli-alpine3.15 +RR_VERSION=2.11.0 +PHP_IMAGE_VERSION=8.1-alpine \ No newline at end of file diff --git a/Readme.md b/Readme.md index 25861f7..5534586 100644 --- a/Readme.md +++ b/Readme.md @@ -9,31 +9,15 @@ There is the [DEMO](http://uls.northeurope.cloudapp.azure.com/) ULE-shop.
-1. Setup (install/create) Database and PHP server. -2. Install [Composer](https://getcomposer.org/doc/00-intro.md) -3. Install [npm](https://docs.npmjs.com/getting-started/installing-node). -4. Install git. Get this project from Github (git clone). +4. Setup docker and docker-compose on your local machine. +5. Create the .local_data folder in the root directory of the project +6. Install git. Fetch this project from Github (git clone). 5. Copy ".env.example" file and rename to ".env". Edit the .env file (connect to DB). -6. Run "composer update". -7. Run "npm install", then "npm run dev". -8. Run "php artisan key:generate". It will add application key to the .env file. -9. Run "php artisan migrate" [Laravel Migrations](https://laravel.com/docs/9.x/migrations). -10. Important! It's the correct way to seeding: "php artisan db:seed --class=DatabaseSeeder" [Laravel Seeding](https://laravel.com/docs/5.5/seeding). -11. Setup "Document root" for your project on server like ".../my_example_shop/public". -12. For testing back-end: copy and rename .env.testing.example to .env.testing, then add your app_key from .env file and run the command "php artisan test" -13. For testing Vue.js run the command "npm run test" -14. To check code quality run: ./vendor/bin/phpstan analyse --memory-limit=2G. Setup code quality Level 0-8 in the file phpstan.neon. - -### Docker-compose for local development: -- setup docker and docker-compose on your local machine. -- create the .local_data folder in the folder with your project -- install mkcert and generate ssl certificates: -``` -brew install mkcert nss -mkcert -cert-file .docker/nginx/dev/site.crt -key-file .docker/nginx/dev/site.key localhost 127.0.0.1 -``` -- run docker-compose up -d - -localhost:8088 -- [Temporal](https://temporal.io) UI +6. Run "docker-compose up" (you may need to restart docker-compose up 3-4 times). + + +### Local endpoints: +- localhost -- Main App +- localhost:8088 -- [Temporal](https://temporal.io) UI _Uladzimir Sadkou_: hofirma@gmail.com diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 2f2c3c4..0f0bc73 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -23,15 +23,15 @@ class AppServiceProvider extends ServiceProvider */ public function boot () { - if (!$this->app->runningInConsole()) { - $catalog = new Catalog; - View::share('catalogs', $catalog->parentsNode()); - } - - //Delete records from "product_property" table - Product::deleting(function ($product) { - $product->properties()->detach(); - }); +// if (!$this->app->runningInConsole()) { +// $catalog = new Catalog; +// View::share('catalogs', $catalog->parentsNode()); +// } +// +// //Delete records from "product_property" table +// Product::deleting(function ($product) { +// $product->properties()->detach(); +// }); } /** diff --git a/composer.json b/composer.json index e0c4957..119c14d 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,8 @@ "autoload": { "psr-4": { "App\\": "app/", - "Database\\Factories\\": "database/factories/" + "Database\\Factories\\": "database/factories/", + "Database\\Seeders\\": "database/seeders/" } }, "autoload-dev": { diff --git a/database/migrations/2022_05_15_100734_add_payment_methods.php b/database/migrations/2022_05_15_100734_add_payment_methods.php index f1be5c5..422dcec 100644 --- a/database/migrations/2022_05_15_100734_add_payment_methods.php +++ b/database/migrations/2022_05_15_100734_add_payment_methods.php @@ -28,7 +28,7 @@ public function up(): void $paymentMethod->label = 'Fondy'; $paymentMethod->config_key = 'fondy'; $paymentMethod->priority = 2; - $paymentMethod->enabled = false; + $paymentMethod->enabled = true; $paymentMethod->save(); } diff --git a/database/seeds/AdminsTableSeeder.php b/database/seeders/AdminsTableSeeder.php similarity index 86% rename from database/seeds/AdminsTableSeeder.php rename to database/seeders/AdminsTableSeeder.php index b1f825b..d204d88 100644 --- a/database/seeds/AdminsTableSeeder.php +++ b/database/seeders/AdminsTableSeeder.php @@ -1,13 +1,16 @@