Laravel Vapor - Your application exceeds the maximum size allowed by AWS Lambda
This article will give you example of laravel vapor your application exceeds the maximum size allowed by aws lambda. this example will help you your application exceeds the maximum size allowed by aws lambda laravel vapor project. We will use laravel vapor exceeds the maximum size allowed by AWS Lambda. I’m going to show you about laravel vapor your application exceeds the maximum size allowed by aws lambda.
Yesterday i was working on my laravel app and i installed 3 new composer packages, then i just deploy it i got error "Your application exceeds the maximum size allowed by AWS Lambda" as bellow screenshot. i used runtime php8, but now i need to change that. so i used docker base deployment. just follow bellow step to make it done.
i found solution to use docker based deployment. aws server provide 50MB storage so you can not do it more then that. so you can do it using docker based deployment.
Do it as like bellow:
Install Docker
first you need to install docker in your system. you can follow bellow link to install docker in your OS.
https://docs.docker.com/engine/install/
If you are using ubuntu then follow bellow step here:
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
apt-cache madison docker-ce
Configure vapor.yml File
after installed docker successfully. you need to configure your docker file and vapor.yml file as bellow:
There will be two files for docker configuration, one for staging and another for production as bellow:
production.Dockerfile
FROM laravelphp/vapor:php80
COPY . /var/task
staging.Dockerfile
FROM laravelphp/vapor:php80
COPY . /var/task
Set runtime option "docker" as bellow file.
vapor.yml
id: 22442
name: itsolutionstuff-vapor
environments:
production:
memory: 1024
cli-memory: 512
runtime: docker
build:
- 'COMPOSER_MIRROR_PATH_REPOS=1 composer install --no-dev'
staging:
memory: 1024
cli-memory: 512
runtime: docker
database: itsolutionstuff-vapor-staging
storage: itsolutionstuff-s3-files
build:
- 'COMPOSER_MIRROR_PATH_REPOS=1 composer install'
now just deploy it.
php vendor/bin/vapor deploy
i will works. i hope it can help you...
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- How to Image Upload in Laravel Vapor?
- Laravel Vapor cli installation error for require league/flysystem-aws-s3-v3
- How to Setup Database in Laravel Vapor?
- How to Deploy Project with Laravel Vapor?
- Laravel 8 User Roles and Permissions Tutorial
- Laravel 8 Highcharts Tutorial for Beginner
- Laravel 8 Stripe Payment Gateway Integration Example
- Laravel 8 Install React Example Tutorial
- Laravel 8 REST API with Passport Authentication Tutorial
- Laravel 8 Autocomplete Search from Database Example
- Laravel 8 Resource Route and Controller Tutorial Example
- Laravel 8 Livewire CRUD with Jetstream & Tailwind CSS