Skip to content

evenchange4/nextjs-pkg-docker-alpine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published