Skip to content

Workshop Orange Template Repository for NextJS projects connected to Sanity.io

License

Notifications You must be signed in to change notification settings

Workshop-Orange/wo-template-nextjs-for-sanity

Repository files navigation

Workshop Orange Template NextJS for Sanity

This project is the NextJS Template for the Sanity project at https://github.com/Workshop-Orange/wo-template-sanity-for-nextjs.

This is a Next.js project bootstrapped with create-next-app and configured to run in amazee.io / Lagoon.

Getting Started Without amazee.io Pygmy

First, create the .env.local from the example, and run the development server:

copy .env.example .env.local
npm run dev

Open http://localhost:3000 with your browser to see the result.

Getting Started With amazee.io Pygmy (Development Mode)

Prerequiste: Make sure Pygmy is installed.

If Pygmy is installed, create the .env.local from the example, and build the container. By default this will be in development mode, so no npm build will be run.

copy .env.example .env.local
docker-compose build --force-rm --no-cache

Next, install node dependencies for local development. Even though npm install is run as part of the container build, this needs to be run by docker-compose run because docker-compose up will mount you local directory OVER the container's /app directory.

docker-compose run node npm install

Finally, run the container

docker-compose up

Open http://wo-template-nextjs-for-sanity.docker.amazee.io with your browser to see the result. You can alter the URL to match your project by editing LAGOON_ROUTE in docker-compose.yml

Getting Started With amazee.io Pygmy (Simulate Production)

Prerequiste: Make sure Pygmy is installed.

If Pygmy is installed, create the .env.local from the example, and build the container. By adding a build argument we will simulate production mode, so npm build will be run.

cp .env.example .env.local
docker-compose build --no-cache --force-rm --build-arg LAGOON_ENVIRONMENT_TYPE=production

Next, edit the .env.local and change LAGOON_ENVIRONMENT_TYPE from development to production.

Once you have change LAGOON_ENVIRONMENT_TYPE to production, install node dependencies for local development, and build the production build. Even though npm install and npm run build are run as part of the container build, they need to be run by again because docker-compose up will mount your local directory OVER the container's /app directory.

docker-compose run node npm install
docker-compose run node npm run build

Finally, run the container

docker-compose up

Open http://wo-template-nextjs-for-sanity.docker.amazee.io with your browser to see the result. You can alter the URL to match your project by editing LAGOON_ROUTE in docker-compose.yml

About

Workshop Orange Template Repository for NextJS projects connected to Sanity.io

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published