You need Offers API endpoint deployed separately. There is no documentation on how to deploy it yet.
User data for EC2:
#!/bin/bash
sudo yum update -y
sudo yum install -y git nodejs
git -v
node -v # Check node version
npm -v # Check npm version
git clone https://github.com/piotrekwitkowski/nextjs-octank-demo.git app
cd app
npm i
NEXT_TELEMETRY_DISABLED=1 npm run build
PORT=80 npm start
Useful for cloud init monitoring:
tail -f /var/log/cloud-init-output.log
Based on https://github.com/sladg/nextjs-lambda
-
Adjust
next.config.js
like described here: https://github.com/sladg/nextjs-lambda#:~:text=next.config.js -
Install dependencies locally:
npm install
-
Make sure
node prebuild.js
is included in package.json's prebuild script to fix this Next bug when app is running in standalone mode -
Run
next build
(will generate standalone next folder). -
Run
npx --package @sladg/nextjs-lambda cli pack
(will create ZIPs). -
Run
npx --package @sladg/nextjs-lambda cli deploy
(will deploy to AWS).