Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

alecdavis47's avatar

How do you speed up Envoyer deployments?

Hello! Heavy and happy user of Forge here. As our app is becoming too large, some side effects have come with deployment downtime.

I love everything I see about Envoyer (or similar solutions, sometimes custom built on Envoy) except one thing: the need for a complete rebuild of dependencies eg composer install + npm install.

This means our deployments would now be way longer, and even if there is no downtime anymore, deployment speed is really important for us and actually a core principle of how we manage software.

Do you have big apps with lots of dependencies running on Laravel Envoyer? If yes, how did you tackle the slower deployment time? How come we should reinstall composer dependencies when a lot of times, nothing has changed? https://100001.onl/ https://1921681254.mx/

Or did you simply accept it as a trade off considering all the other benefits?

0 likes
1 reply
rodrigo.pedra's avatar

composer install should not be a problem, even when using composer version 1, as it reads from the composer.lock file (which I assume you commit it as it is the default)

For frontend dependencies, I moved on compiling my assets locally and pushing them already processed so I don't even need to have node/npm/yarn installed on the server (unless I am using some integration which needs it).

I keep public/js, public/css, and public/mix-manifest.json (and any other generated frontend file/folder) on my .gitignore file, so they don't mess up every commit if I am using yarn watch (or npm run watch).

But then I have a "build-push.sh" script which runs yarn prod and force add the generated files to a separated commit when I am building to production.

Here is a simplified version of this script:

#!/usr/bin/env bash
# Ensure script is running on the project's folder
cd /home/rodrigo/code/project || exit

# Ensure no changes in generated assets are commited by mistake
git reset HEAD public
git checkout -- public

# Commit changes with message from command line or a default one  
git add .
git commit -m "${1:-savepoint}"

# Ensure all generated assets are removed, recompiled and force added to a separated commit 
rm -r public/css public/js public/fonts public/images public/favicon public/favicon.ico public/mix-manifest.json
yarn run prod
git add --force public/css public/js public/fonts public/images public/favicon public/favicon.ico public/mix-manifest.json
git commit -m 'frontend compilation'

# Push commits to git
git push origin master

# Trigger Forge Deploy
curl  https://forge.laravel.com/servers/...

notify-send 'deployed'

Hope this helps.

Please or to participate in this conversation.