Next.js in a VS Code development container
Next.js in a VS Code development container

Next.js in a VS Code development container

Tags
Next.js
Docker
VS Code
Published
Published June 11, 2021
Author

Next.js in a VS Code development container

A simple and minimalistic template to develop your Next.js application in a VS Code development container. Use Next.js with the portability of docker and the comfort of VS Code in just a few steps.

Features

  • Node + Typescript
  • Docker
  • Git
  • Fast Refresh

Pre-requisites

  1. Set up git in your host machine with the credentials manager core. The credentials manager will let you use the git credentials from your host machine inside the container without any extra step.

Steps

  1. Build and Activate the Development Container.
    1. Follow the VS Code containers Getting Started Guide.
    2. Open the repository folder in a container by following these steps.
  1. Setup your Next.js application by using one of these two options
      • Option 1: Follow the tutorial to Create a Next.js App bash npx create-next-app nextjs-blog --use-npm --example "https://github.com/vercel/next-learn/tree/master/basics/learn-starter"
      • Option 2: Add your Next.js project as a Git Submodule git submodule add https://github.com/cassidoo/next-netlify-starter.git
  1. Go to the newly created directory to run npm commands. Just replace your_project_folder with the name folder name of the project you just added.
    1. cd `your_project_folder`
  1. Run the development server
    1. npm run dev

Usage example

Usage Example
Usage Example

Code