Member-only story
Deploy a NextJS application using GitLab CI/CD & Docker on DigitalOcean Droplet Ubuntu 18.04
1 — Create NextJS application on your local machine
To create a Next.js app, open your terminal, cd
into the directory you’d like to create the app in, and run the following command:
npx create-next-app nextjs-blog
You now have a new directory called nextjs-blog
. Let’s cd
into it:
cd nextjs-blog
Then, run the following command:
npm run dev
This starts your Next.js app’s “development server” (more on this later) on port 3000.
Let’s check to see if it’s working. Open http://localhost:3000 from your browser.
2 — Set up GitLab
Now, you will be pushing your NextJS application to a GitLab repository. Head over to GitLab’s Website and log into your account or create an account if you do not have one already.