hello-world example project for next.js with Docker workflow, CI/CD system
Ruby Shell Smarty JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dev-setup
dist
helm-charts/nextjs-hello-world
node_modules
pages
scripts
.dockerignore
.env-common
.env-dev
.env-prod
.env-review
.gitignore
.gitlab-ci.yml
.travis.yml
Dockerfile
LICENSE
README.md
docker-compose.prod.yml
docker-compose.review.yml
docker-compose.yml
key.json
next.config.js
package.json
run-dev.sh
run-prod.sh
yarn.lock

README.md

nextjs-hello-world

This is the simplest seed code for next.js applications with Docker workflow, CI/CD system.

Getting started

Dev Mode

To run dev mode on the current source code.

$ vagrant ssh
$ ws
$ cd nextjs-hello-world
$ docker-compose up -d dev && docker-compose logs -f dev

Open dev.nextjs.acme.dev (http + https modes) to check it out.

Prod Mode

To run prod mode on the current source code.

$ docker-compose run --rm dev yarn run build && \
  docker-compose -f docker-compose.yml -f docker-compose.prod.yml build prod && \
  docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d prod

We usually scale at least 2 or more containers, so please scale it on local dev too to make sure scaling should work:

$ docker-compose -f docker-compose.yml -f docker-compose.prod.yml scale prod=2

Open nextjs.acme.dev (http + https modes) to check it out.

Don't forget to remove the container after checking out for cleaning up:

$ docker-compose -f docker-compose.yml -f docker-compose.prod.yml stop prod && \
  docker-compose -f docker-compose.yml -f docker-compose.prod.yml rm -f prod

Prod Review Mode

To review prod mode from different built Docker image.

For example, I need to review the registry.gitlab.com/hoatle/nextjs-hello-world:features-1-something Docker image from @hoatle.

$ export DOCKER_IMAGE_REVIEW=registry.gitlab.com/hoatle/nextjs-hello-world:features-1-something && \
docker-compose -f docker-compose.yml -f docker-compose.review.yml pull review && \
docker-compose -f docker-compose.yml -f docker-compose.review.yml up -d review

We usually scale at least 2 or more containers, so please scale it on local dev too to make sure scaling should work:

$ docker-compose -f docker-compose.yml -f docker-compose.review.yml scale review=2

Open review.nextjs.acme.dev (http + https modes) to check it out.

Don't forget to remove the containers after checking out for cleaning up:

$ docker-compose -f docker-compose.yml -f docker-compose.review.yml stop review && \
  docker-compose -f docker-compose.yml -f docker-compose.review.yml rm -f review

Learn more