Home > OS >  Can't deploy Scully (Angular) app on AWS: 502 Bad Gateway
Can't deploy Scully (Angular) app on AWS: 502 Bad Gateway

Time:09-02

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 Sorry, could not load static page content

I tried to install nginx scully angular

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

  1. pm2 start "npm run scully"
  2. pm2 start "npm run scully:scan"
  3. 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.

CodePudding user response:

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

CodePudding user response:

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.

  • Related