From 5ecad634e2e6efb7731c1c7d389e88f13f33a7e9 Mon Sep 17 00:00:00 2001 From: Konstantinos Arvanitakis Date: Fri, 10 Jul 2026 12:54:48 +0300 Subject: [PATCH] Hotfix: Updatin build, fixing vite error, creating separate entrypoints --- .gitignore | 1 + Dockerfile | 3 +- composer.lock | 68 ++++++++++++++++++------------------- docker-compose.dev.yml | 3 ++ docker/entrypoint-worker.sh | 21 ++++++++++++ docker/entrypoint.sh | 54 ++++++++++++++++------------- vite.config.js | 1 + 7 files changed, 93 insertions(+), 58 deletions(-) create mode 100644 docker/entrypoint-worker.sh diff --git a/.gitignore b/.gitignore index 455c4e3..aacff36 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ /public/logos/core /public/storage /storage/*.key +/storage/framework/migrated /storage/pail /vendor _ide_helper.php diff --git a/Dockerfile b/Dockerfile index 94ca29f..341cf29 100644 --- a/Dockerfile +++ b/Dockerfile @@ -127,7 +127,8 @@ RUN composer install \ --ignore-platform-reqs COPY docker/entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh +COPY docker/entrypoint-worker.sh /entrypoint-worker.sh +RUN chmod +x /entrypoint.sh /entrypoint-worker.sh EXPOSE 9000 ENTRYPOINT ["/entrypoint.sh"] diff --git a/composer.lock b/composer.lock index 71919bb..dec6718 100644 --- a/composer.lock +++ b/composer.lock @@ -565,11 +565,11 @@ }, { "name": "boboko/core", - "version": "0.1.0", + "version": "0.1.1", "source": { "type": "git", "url": "https://code.radical-elements.com/boboko/core.git", - "reference": "1d2a90059daea13614fe8842d15fb0ea58cabda8" + "reference": "96ad89b6b8a99e628e438b6c724c2a0e4dde8c61" }, "require": { "laravel/framework": "^12.0", @@ -605,7 +605,7 @@ } }, "description": "Core module — authentication and shared panel behaviour", - "time": "2026-07-08T21:56:04+00:00" + "time": "2026-07-10T09:51:29+00:00" }, { "name": "brick/math", @@ -2473,16 +2473,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.13.3", + "version": "7.14.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "caa5491e1030fd120247f42fb3331ecf38da3b26" + "reference": "aef242412e13128b5049864867bb49fc37dd39de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/caa5491e1030fd120247f42fb3331ecf38da3b26", - "reference": "caa5491e1030fd120247f42fb3331ecf38da3b26", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/aef242412e13128b5049864867bb49fc37dd39de", + "reference": "aef242412e13128b5049864867bb49fc37dd39de", "shasum": "" }, "require": { @@ -2581,7 +2581,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.13.3" + "source": "https://github.com/guzzle/guzzle/tree/7.14.0" }, "funding": [ { @@ -2597,7 +2597,7 @@ "type": "tidelift" } ], - "time": "2026-07-08T16:10:19+00:00" + "time": "2026-07-08T22:54:09+00:00" }, { "name": "guzzlehttp/promises", @@ -3919,16 +3919,16 @@ }, { "name": "league/mime-type-detection", - "version": "1.16.0", + "version": "1.17.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "2d6702ff215bf922936ccc1ad31007edc76451b9" + "reference": "f5f47eff7c48ed1003069a2ca67f316fb4021c76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/2d6702ff215bf922936ccc1ad31007edc76451b9", - "reference": "2d6702ff215bf922936ccc1ad31007edc76451b9", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/f5f47eff7c48ed1003069a2ca67f316fb4021c76", + "reference": "f5f47eff7c48ed1003069a2ca67f316fb4021c76", "shasum": "" }, "require": { @@ -3938,7 +3938,7 @@ "require-dev": { "friendsofphp/php-cs-fixer": "^3.2", "phpstan/phpstan": "^0.12.68", - "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0" + "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0 || ^11.0 || ^12.0" }, "type": "library", "autoload": { @@ -3959,7 +3959,7 @@ "description": "Mime-type detection for Flysystem", "support": { "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.16.0" + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.17.0" }, "funding": [ { @@ -3971,7 +3971,7 @@ "type": "tidelift" } ], - "time": "2024-09-21T08:32:55+00:00" + "time": "2026-07-09T11:49:27+00:00" }, { "name": "league/uri", @@ -4894,16 +4894,16 @@ }, { "name": "nesbot/carbon", - "version": "3.13.0", + "version": "3.13.1", "source": { "type": "git", "url": "https://github.com/CarbonPHP/carbon.git", - "reference": "40f6618f052df16b545f626fbf9a878e6497d16a" + "reference": "2937ad3d1d2c506fd2bc97d571438a95641f44e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/40f6618f052df16b545f626fbf9a878e6497d16a", - "reference": "40f6618f052df16b545f626fbf9a878e6497d16a", + "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/2937ad3d1d2c506fd2bc97d571438a95641f44e2", + "reference": "2937ad3d1d2c506fd2bc97d571438a95641f44e2", "shasum": "" }, "require": { @@ -4995,7 +4995,7 @@ "type": "tidelift" } ], - "time": "2026-06-18T13:49:15+00:00" + "time": "2026-07-09T18:23:49+00:00" }, { "name": "nette/schema", @@ -8057,16 +8057,16 @@ }, { "name": "spatie/laravel-medialibrary", - "version": "11.23.1", + "version": "11.23.2", "source": { "type": "git", "url": "https://github.com/spatie/laravel-medialibrary.git", - "reference": "143106b61b945f1ca815e6a71598c03881469228" + "reference": "cc1fdc4a9a9007101df610cd4a6733be71db4828" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-medialibrary/zipball/143106b61b945f1ca815e6a71598c03881469228", - "reference": "143106b61b945f1ca815e6a71598c03881469228", + "url": "https://api.github.com/repos/spatie/laravel-medialibrary/zipball/cc1fdc4a9a9007101df610cd4a6733be71db4828", + "reference": "cc1fdc4a9a9007101df610cd4a6733be71db4828", "shasum": "" }, "require": { @@ -8151,7 +8151,7 @@ ], "support": { "issues": "https://github.com/spatie/laravel-medialibrary/issues", - "source": "https://github.com/spatie/laravel-medialibrary/tree/11.23.1" + "source": "https://github.com/spatie/laravel-medialibrary/tree/11.23.2" }, "funding": [ { @@ -8163,7 +8163,7 @@ "type": "github" } ], - "time": "2026-06-24T08:31:39+00:00" + "time": "2026-07-09T13:26:15+00:00" }, { "name": "spatie/laravel-package-tools", @@ -12120,16 +12120,16 @@ }, { "name": "technikermathe/blade-lucide-icons", - "version": "v3.158.0", + "version": "v3.159.0", "source": { "type": "git", "url": "https://github.com/PascaleBeier/blade-lucide-icons.git", - "reference": "5748736d9c24b152da69779a1ca21bc33620dc6a" + "reference": "b8dec6812bc09ebad05464cc176df4f949e146c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PascaleBeier/blade-lucide-icons/zipball/5748736d9c24b152da69779a1ca21bc33620dc6a", - "reference": "5748736d9c24b152da69779a1ca21bc33620dc6a", + "url": "https://api.github.com/repos/PascaleBeier/blade-lucide-icons/zipball/b8dec6812bc09ebad05464cc176df4f949e146c5", + "reference": "b8dec6812bc09ebad05464cc176df4f949e146c5", "shasum": "" }, "require": { @@ -12179,9 +12179,9 @@ ], "support": { "issues": "https://github.com/PascaleBeier/blade-lucide-icons/issues", - "source": "https://github.com/PascaleBeier/blade-lucide-icons/tree/v3.158.0" + "source": "https://github.com/PascaleBeier/blade-lucide-icons/tree/v3.159.0" }, - "time": "2026-07-02T00:30:05+00:00" + "time": "2026-07-10T01:55:13+00:00" }, { "name": "thecodingmachine/safe", @@ -12771,5 +12771,5 @@ "prefer-lowest": false, "platform": {}, "platform-dev": {}, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.9.0" } diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 7ff5c1f..21146a2 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -46,6 +46,7 @@ services: queue: image: boboko-app restart: unless-stopped + entrypoint: ["/entrypoint-worker.sh"] command: php artisan queue:work --tries=3 --max-jobs=500 --memory=256 env_file: .env environment: @@ -67,6 +68,7 @@ services: scheduler: profiles: [full] image: boboko-app + entrypoint: ["/entrypoint-worker.sh"] command: php artisan schedule:work restart: unless-stopped env_file: .env @@ -138,6 +140,7 @@ services: - "${VITE_PORT:-5173}:5173" environment: - NODE_ENV=development + - VITE_PORT=${VITE_PORT:-5173} volumes: - .:/app - /app/node_modules diff --git a/docker/entrypoint-worker.sh b/docker/entrypoint-worker.sh new file mode 100644 index 0000000..017c2e6 --- /dev/null +++ b/docker/entrypoint-worker.sh @@ -0,0 +1,21 @@ +#!/bin/sh +set -e + +# queue/scheduler: no composer/migrate/asset-publish here (that's entrypoint.sh, run +# by app only) — just wait for app's migration to finish, then start the process. +mkdir -p storage/app/public storage/framework/cache storage/framework/sessions storage/framework/views storage/logs storage/framework bootstrap/cache + +if [ "$APP_ENV" != "production" ]; then + echo "[entrypoint] Waiting for migrations to complete..." + timeout=60 + while [ ! -f storage/framework/migrated ] && [ "$timeout" -gt 0 ]; do + sleep 1 + timeout=$((timeout - 1)) + done + if [ ! -f storage/framework/migrated ]; then + echo "[entrypoint] Timed out waiting for migrations" >&2 + exit 1 + fi +fi + +exec "$@" diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 7e144ea..086c335 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,39 +1,47 @@ #!/bin/sh set -e -# In development, install Composer deps if vendor is not present -if [ "$APP_ENV" != "production" ] && [ ! -f vendor/autoload.php ]; then +# Only the app container runs setup; queue/scheduler use entrypoint-worker.sh instead +# and just wait on the migrated marker this script writes below. +if [ "$APP_ENV" != "production" ]; then echo "[entrypoint] Installing Composer dependencies..." git config --global --add safe.directory /var/www/html 2>/dev/null || true composer install --no-interaction --prefer-dist -fi -# In development, re-resolve all boboko/* packages against their local path-repo -# checkouts on every boot, so editing boboko-core and running `./bin/dc-core.sh up` -# is enough. No-op unless the path repo in `_repositories` has been enabled. -if [ "$APP_ENV" != "production" ] && [ -d /var/www/boboko-core ]; then - echo "[entrypoint] Re-resolving boboko/* packages from local path repos..." + # Re-resolve boboko/* on every boot, whether it's a local path-repo checkout + # (../boboko-core mounted via docker-compose.core-dev.yml) or a VCS tag. Rewrites + # composer.lock, which is committed so prod picks up the resolved version via + # `composer install` alone. + echo "[entrypoint] Re-resolving boboko/* packages..." composer update "boboko/*" --no-interaction --with-all-dependencies fi -# In development, the app dir is bind-mounted from a fresh checkout, so package -# assets (which the Dockerfile publishes at build time in production) need to be -# generated here instead. Cheap and idempotent, safe to repeat on every boot. -if [ "$APP_ENV" != "production" ]; then - php artisan vendor:publish --tag=core-assets --force --ansi --quiet - php artisan vendor:publish --tag=public --force --ansi --quiet - php artisan filament:assets --ansi --quiet -fi - -# Everything below runs on every boot of app/queue/scheduler, possibly concurrently, -# so it must be idempotent and safe to run from multiple containers at once. -# Migrations, package publishing, and config/route/view caching are deploy-time -# concerns handled once via Envoy, not here. - -mkdir -p storage/app/public storage/framework/cache storage/framework/sessions storage/framework/views storage/logs bootstrap/cache +mkdir -p storage/app/public storage/framework/cache storage/framework/sessions storage/framework/views storage/logs storage/framework bootstrap/cache chown -R www-data:www-data storage bootstrap/cache chmod -R 775 storage bootstrap/cache php artisan storage:link --quiet 2>/dev/null || true +if [ "$APP_ENV" != "production" ]; then + # The app dir is bind-mounted from a fresh checkout, so package assets (which the + # Dockerfile publishes at build time in production) need to be generated here + # instead. Cheap and idempotent, safe to repeat on every boot. + php artisan vendor:publish --tag=core-assets --force --ansi --quiet + php artisan vendor:publish --tag=public --force --ansi --quiet + php artisan filament:assets --ansi --quiet + + echo "[entrypoint] Running migrations..." + rm -f storage/framework/migrated + php artisan migrate --force + touch storage/framework/migrated + + # boboko/core overrides lunar:install to skip the interactive prompts (migrate + # confirm, admin creation, GitHub star) and just seed the idempotent store + # defaults: countries, channel, language, currency, tax zone, attributes, + # product type. queue/scheduler wait on the marker above rather than running + # this themselves, since the country import's check-then-insert isn't safe to + # run concurrently. + php artisan lunar:install --quiet || true +fi + exec "$@" diff --git a/vite.config.js b/vite.config.js index 98e081a..eb80d8e 100644 --- a/vite.config.js +++ b/vite.config.js @@ -22,6 +22,7 @@ export default defineConfig({ cors: true, hmr: { host: 'localhost', + clientPort: process.env.VITE_PORT || 5173, }, watch: { ignored: ['**/storage/framework/views/**'],