/nextjs-docker

Next.js boilerplate for macOS/Linux/Windows development and Alpine Linux Container deployments to production with security in mind!

Primary LanguageJavaScriptMIT LicenseMIT

NextJS and Docker

  • Node stable: v14.0.0
  • npm version: v6.14.4
  • Docker version: 19.03.8, build afacb8b

A note about alpine and node which explains:

RUN apk add --no-cache libc6-compat

Enjoy!

Local

Dev

npm i && npm run dev

Docker Compose

docker-compose up --build

This will build and run your container locally 🚀

Traditional Docker Route

Build your containers for deploys:

MacOS/Linux

./scripts/prod.sh

Windows

./scripts/prod.bat

Now that your container is built, you can test it locally:

docker run -p 3000:3000 nextjs-docker

Now deploy 🚀