Giter Club home page Giter Club logo

nextjs-docker's Introduction

NextJS and Docker

  • node: v16.17.0
  • npm: 8.19.2
  • rootfs: alpine 3.15
  • docker: 20.10.12, build e91ed57

A note about alpine and node which explains:

RUN apk add --no-cache libc6-compat

Enjoy!

Local

Dev

npm i && npm run dev

Docker Compose

docker-compose up --build

This will build and run your container locally ๐Ÿš€

Traditional Docker Route

Build your containers for deploys:

MacOS/Linux

./scripts/prod.sh

Windows

./scripts/prod.bat

Now that your container is built, you can test it locally:

docker run -p 3000:3000 nextjs-docker

Now deploy ๐Ÿš€

nextjs-docker's People

Contributors

dependabot[bot] avatar selfup avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nextjs-docker's Issues

Is this production ready?

I don't see any process manager here like PM2, so what if Next crashes?

I don't the --production flag on npm install

Also, no nginx proxy

Also for hot-reloading to work with Next and Docker you'll need to add this to the config

webpackDevMiddleware: config => {
  config.watchOptions = {
    poll: 1000,
    aggregateTimeout: 300,
  }
  return config
}

And add volumes to the docker-compose.

Permision denied

I got Permission denied error.

#17 1.813 > Build error occurred
#17 1.816 Error: EACCES: permission denied, open '/app/.next/cache/config.json.3288435009'
#17 1.816 at Object.openSync (node:fs:585:3)
#17 1.816 at Function.writeFileSync [as sync] (/app/node_modules/next/dist/compiled/conf/index.js:15:23035)
#17 1.816 at Conf.set store [as store] (/app/node_modules/next/dist/compiled/conf/index.js:1:109636)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.