Skip to content

Update generated Dockerfile and entrypoint.sh to decrease deploy time#50

Merged
KTanAug21 merged 6 commits into
mainfrom
upgrade_laravel_zero_move_chown_to_build_time
Jul 25, 2025
Merged

Update generated Dockerfile and entrypoint.sh to decrease deploy time#50
KTanAug21 merged 6 commits into
mainfrom
upgrade_laravel_zero_move_chown_to_build_time

Conversation

@KTanAug21

@KTanAug21 KTanAug21 commented Jul 18, 2025

Copy link
Copy Markdown
Contributor

So! Due to rootfs throttling, will need to move the chown command in entrypoint.sh away from runtime and into build time. Otherwise! the deploy time's really slow:

Main Changes related to title:

  1. Update Dockerfile and entrypoint.sh generated to move last chown into build time and not run time, this significantly slows down deploys
    • throttling is happening before supervisor even starts, due to chowning 6500+ files after running scripts in the entrypoint
  2. Update Dockerfile to use build script if vite.config.ts is detected
    • A project can come with vite.config.ts

Other changes made:

  1. Upgrade to Laravel Zero 11, for PHP8.4.1
    • had to upgrade LZ to be able to build the changes
  2. Update Readme to mention upgrading the framework as a solution to failing builds
    • for future reference, this can be looked into to solve failing builds

To make this change available:

  1. Pass the testcases - this is possibly a quick yes to generating new test file templates based on the new finalized Dockerfile and entrypoint files
  2. Publish this change by creating a release for it

1. Upgrade to Laravel Zero 11, for PHP8.4.1
2. Update Readme to mention upgrading the framework as a solution to failing builds
3. Update Dockerfile and entrypoint.sh generated to move last chown into build time and not run time, this significantly slows down deploys
4. Update Dockerfile to use build script if vite.config.ts is detected

@Roadmaster Roadmaster left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM a couple of minor suggestions.

Comment thread resources/views/dockerfile.blade.php Outdated
RUN rsync -ar /var/www/html/public-npm/ /var/www/html/public/ \
&& rm -rf /var/www/html/public-npm \
&& chown -R www-data:www-data /var/www/html/public
&& chown -R www-data:www-data /var/www/html/public \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/var/www/html contains /var/www/html/public; so you can remove line 131 altogether, line 132 takes care of everything.

Comment thread README.md
php dockerfile-laravel app:build
```

### Getting Pass Hurdles

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Getting Past"

@KTanAug21 KTanAug21 merged commit ac2cfbf into main Jul 25, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants