From af616320d03825858cf56a0a96b6d4a964d02115 Mon Sep 17 00:00:00 2001 From: Bruno Bernardino Date: Sat, 13 Feb 2021 11:52:40 +0000 Subject: [PATCH] Migrate from Vercel to Serverless --- .env.sample | 2 ++ .gitignore | 4 +++- .prettierignore | 3 ++- .vercelignore | 11 ----------- Makefile | 2 +- README.md | 4 ++-- serverless.yml | 10 ++++++++++ vercel.json | 24 ------------------------ 8 files changed, 20 insertions(+), 40 deletions(-) delete mode 100644 .vercelignore create mode 100644 serverless.yml delete mode 100644 vercel.json diff --git a/.env.sample b/.env.sample index b4181c1..c25efa0 100644 --- a/.env.sample +++ b/.env.sample @@ -1 +1,3 @@ NODE_PATH=/ +AWS_ACCESS_KEY_ID=accesskey +AWS_SECRET_ACCESS_KEY=sshhh diff --git a/.gitignore b/.gitignore index 68c9380..b20106d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ .DS_Store node_modules *.log +*.zip .env .next .env.build -.vercel +.serverless +.serverless_nextjs diff --git a/.prettierignore b/.prettierignore index cce831b..8bb93fb 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,5 @@ node_modules .next package-lock.json -.vercel +.serverless +.serverless_nextjs diff --git a/.vercelignore b/.vercelignore deleted file mode 100644 index 9542ad2..0000000 --- a/.vercelignore +++ /dev/null @@ -1,11 +0,0 @@ -.git -.github -.next -node_modules -*.log -README.md -Makefile -*.test.js -*.test.jsx -*.test.ts -*.test.tsx diff --git a/Makefile b/Makefile index 7b8dcae..d24f7f4 100644 --- a/Makefile +++ b/Makefile @@ -36,4 +36,4 @@ pretty: .PHONY: deploy deploy: - vercel --prod + serverless diff --git a/README.md b/README.md index a1c2029..f7dd2eb 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![](https://github.com/BrunoBernardino/budgetzen-web/workflows/Run%20Tests/badge.svg)](https://github.com/BrunoBernardino/budgetzen-web/actions?workflow=Run+Tests) -This is the web app for the [Budget Zen app](https://budgetzen.net), built with Next.js and deployed with Vercel. +This is the web app for the [Budget Zen app](https://budgetzen.net), built with Next.js and deployed to AWS with Vercel. It runs completely in the browser, using `localStorage` and `IndexedDB`. @@ -15,7 +15,7 @@ make install # installs dependencies make start # starts the app make pretty # prettifies the code make test # runs linting and tests -make deploy # deploys to app.budgetzen.net (requires `vercel` to be installed globally) +make deploy # deploys to app.budgetzen.net (requires `serverless` to be installed globally) ``` ## TODOs diff --git a/serverless.yml b/serverless.yml new file mode 100644 index 0000000..04d646c --- /dev/null +++ b/serverless.yml @@ -0,0 +1,10 @@ +service: + name: budgetzen-web + +myNextAppplication: + component: "@sls-next/serverless-component@1.18.0" + inputs: + domain: ["app", "budgetzen.net"] + build: + env: + NODE_PATH: "/" diff --git a/vercel.json b/vercel.json deleted file mode 100644 index 0965c8b..0000000 --- a/vercel.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "version": 2, - "scope": "brn", - "alias": ["app.budgetzen.net"], - "github": { - "enabled": false - }, - "env": { - "NODE_ENV": "production", - "NODE_PATH": "/" - }, - "build": { - "env": { - "NODE_ENV": "production", - "NODE_PATH": "/" - } - }, - "builds": [ - { - "src": "next.config.js", - "use": "@vercel/next" - } - ] -}