I’m trying to deploy Angular app with Scully on AWS but have just 502 error.
When I run just
npm run start
app is loading and content is, but there is no scully static seo content – I just got this
I tried to install
https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
but failed
this command sudo amazon-linux-extras install epel -y just not working
I tried this https://github.com/alixaxel/chrome-aws-lambda
but it’s not working too
also I did
apt install zip and .zip file then created
As I understand AWS has limitations for the dist folder just 50mb so we have to compress it but there is no ready solution how to deploy it.
I stuck with this for 3 day already.
If someone can help, I will very highly appreciate your help.
My nginx file in /etc/nginx/sites-available/defaults is this:
Github code for my scully project is here:
https://github.com/TatyanaMolchanova/Angular-Blog-SEO-Friendly-With-Scully
I run it on AWS with pm2 package for continious work
I run
- pm2 start "npm run scully"
- pm2 start "npm run scully:scan"
- pm2 start "npm run scully:serve"
It all (withou pm2 start) works like a magic on localhost
But I can’t it deploy first on VPS with Ubuntu now on AWS with Ubuntu 20
And my package is not the smallest one – it 2GB and 2 something else.
Thank you in advance.
2
Answers
https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
Running Puppeteer on AWS Lambda AWS Lambda limits deployment package sizes to ~50MB. This presents challenges for running headless Chrome (and therefore Puppeteer) on Lambda. The community has put together a few resources that work around the issues:
https://github.com/alixaxel/chrome-aws-lambda (kept updated with the latest stable release of puppeteer) https://github.com/adieuadieu/serverless-chrome/blob/HEAD/docs/chrome.md (serverless plugin - outdated)
But I run my Scully not on AWS Lambda I run it on EC2 And it's not working
Running Puppeteer on AWS EC2 instance running Amazon-Linux
If you are using an EC2 instance running amazon-linux in your CI/CD pipeline, and if you want to run Puppeteer tests in amazon-linux, follow these steps.
To install Chromium, you have to first enable amazon-linux-extras which comes as part of EPEL (Extra Packages for Enterprise Linux):
sudo amazon-linux-extras install epel -y
Next, install Chromium:
sudo yum install -y chromium
Now Puppeteer can launch Chromium to run your tests. If you do not enable EPEL and if you continue installing chromium as part of npm install, Puppeteer cannot launch Chromium due to unavailablity of libatk-1.0.so.0 and many more packages.