Nextjs Pkg Docker Alpine Save

📥Deploy a commercial Next.js application with pkg and docker.

Project README

Nextjs-pkg-docker-alpine

Deploy a commercial Next.js application with pkg and docker.
Medium article: Deploy a commercial Next.js application with pkg and docker

Demo

https://nextjs-pkg-docker-alpine.now.sh/

Deploy to now

Install and Build

$ yarn install
$ yarn run dev

# Build pkg
$ yarn run build
$ yarn run pkg

# Execute the binary
NODE_ENV=production ./pkg/nextjs-pkg-docker-alpine

Docker Alpine

$ docker build -t nextjs-pkg-docker-alpine .
$ docker run --rm -it \
  -p 3003:3003 \
  -e "PORT=3003" \
  -e "API_URL=https://API_URL.com" \
  nextjs-pkg-docker-alpine

Note: It might take some time to fetch base Node.js binaries to PKG_CACHE_PATH during the pkg process.

Deploy to Now

$ now --docker

License

MIT © Michael Hsu

Open Source Agenda is not affiliated with "Nextjs Pkg Docker Alpine" Project. README Source: evenchange4/nextjs-pkg-docker-alpine
Stars
74
Open Issues
12
Last Commit
3 weeks ago

Open Source Agenda Badge

Open Source Agenda Rating