Follow NVM to use appropriate node version https://itnext.io/nvm-the-easiest-way-to-switch-node-js-environments-on-your-machine-in-a-flash-17babb7d5f1b
Contains typescript, prettier, eslint, nextjs, tailwindcss
https://github.com/vercel/next.js/tree/canary/examples/with-docker-multi-env
This examples shows how to use Docker with Next.js and deploy to multiple environment with different env values. Based on the deployment documentation.
Execute create-next-app
with npm, Yarn, or pnpm to bootstrap the example:
npx create-next-app --example with-docker-multi-env nextjs-docker-multi-env
# or
yarn create next-app --example with-docker-multi-env nextjs-docker-multi-env
# or
pnpm create next-app --example with-docker-multi-env nextjs-docker-multi-env
Enter the values in the .env.development.sample
, .env.staging.sample
, .env.production.sample
files to be used for each environments.
make build-development
make start-development
make build-staging
make start-staging
make build-production
make start-production
First, run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying pages/index.js
. The page auto-updates as you edit the file.
API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.js
.
The pages/api
directory is mapped to /api/*
. Files in this directory are treated as API routes instead of React pages.