This is a codebase for blog application that I build using NextJS with Contentful API
Live Demo: https://nextjs-contentful-app.martindavid.now.sh
$ git clone git@github.com:martindavid/nextjs-contentful-app.git nextjs-app
$ yarn install
Run it locally from http://localhost:3000:
$ CONTENTFUL_SPACE_ID=<space_id> CONTENTFUL_ACCESS_TOKEN=<access_token> yarn run dev
Deploy it to the cloud with now (download)
$ now -e CONTENTFUL_SPACE_ID=<space_id> -e CONTENTFUL_ACCESS_TOKEN=<access_token>
Build it with docker:
# build
$ docker build -t nextjs-app .
# or, use multi-stage builds to build a smaller docker image (for deployment to production)
$ docker build -t nextjs-app -f ./Dockerfile.multistage .
Run it locally from http://localhost:3000:
$ docker run --rm -it \
-p 3000:3000 \
-e "CONTENTFUL_SPACE_ID=<contentful_space_id>" \
-e "CONTENTFUL_ACCESS_TOKEN=<contentful_access_token>" \
next-app
Deploy it to the cloud with now (download)
# Deploy with docker image
$ now --docker -e CONTENTFUL_SPACE_ID=<contentful_space_id> -e CONTENTFUL_ACCESS_TOKEN=<contentful_access_token>