- Install LEMP stack
- Overwrite
/etc/nginx/nginx.conf
# /etc/nginx/nginx.conf
user www-data;
| "use client" | |
| import * as React from "react" | |
| import { buttonVariants } from "@/components/ui/button" | |
| import { ScrollArea } from "@/components/ui/scroll-area" | |
| import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" | |
| import { cn } from "@/lib/utils" | |
| import { ChevronLeft, ChevronRight } from "lucide-react" | |
| import { DayPicker, DropdownProps } from "react-day-picker" |
| # | |
| # Github Actions for Serverless Framework | |
| # | |
| # Create AWS_KEY and AWS_SECRET secrets in Github repository settings | |
| # If you're using env.yml file, store its content as ENV Github secret | |
| # | |
| # Master branch will be deployed as DEV and every new tag starting with "v**" (e.g. v1.0, v1.2, v2.0, etc) will be deployed as PROD | |
| # | |
| # Learn more: https://maxkostinevich.com/blog/how-to-deploy-serverless-applications-using-github-actions/ | |
| # |
| // Require or import the dependencies | |
| const fs = require("fs"); | |
| const sqlite3 = require("sqlite3").verbose(); | |
| // Read the SQL file | |
| const dataSql = fs.readFileSync("./data.sql").toString(); | |
| // Setup the database connection | |
| let db = new sqlite3.Database("mydatabase", err => { | |
| if (err) { |
This step by step tutorial will show you how to set up a Node.js server with MongoDB to DigitalOcean using PM2, NGINX as reverse proxy and a SSL from LetsEncrypt. We will also add a custom domain name.
| #nginx config file for Nextjs App | |
| #place in /etc/nginx/sites-available/name_of_config_file | |
| server { | |
| listen 80; | |
| server_name domainname.com; | |
| gzip on; | |
| gzip_proxied any; | |
| gzip_types application/javascript application/x-javascript text/css text/javascript; | |
| gzip_comp_level 5; |
This is a summary of how to start your own NextJS app, create the repo on Github, upload later in an AWS EC2 Instance and automate the process with AWS Codebuild, CodeDeploy, & CodePipeline.
After following these instructions you should be able to: