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.