Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/evenchange4/nextjs-pkg-docker-alpine
📥Deploy a commercial Next.js application with pkg and docker.
https://github.com/evenchange4/nextjs-pkg-docker-alpine
alpine docker multistage nextjs pkg reactjs
Last synced: 12 days ago
JSON representation
📥Deploy a commercial Next.js application with pkg and docker.
- Host: GitHub
- URL: https://github.com/evenchange4/nextjs-pkg-docker-alpine
- Owner: evenchange4
- Created: 2018-05-11T06:08:43.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-05-22T18:42:23.000Z (6 months ago)
- Last Synced: 2024-10-10T21:19:06.460Z (28 days ago)
- Topics: alpine, docker, multistage, nextjs, pkg, reactjs
- Language: JavaScript
- Homepage: https://nextjs-pkg-docker-alpine.now.sh/
- Size: 197 KB
- Stars: 74
- Watchers: 3
- Forks: 19
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Nextjs-pkg-docker-alpine
> Deploy a commercial Next.js application with [pkg](https://github.com/zeit/next.js/blob/canary/examples/with-pkg/README.md) and [docker](https://github.com/zeit/next.js/blob/canary/examples/with-docker/README.md).
> Medium article: [Deploy a commercial Next.js application with pkg and docker](https://medium.com/@evenchange4/deploy-a-commercial-next-js-application-with-pkg-and-docker-5c73d4af2ee)## Demo
https://nextjs-pkg-docker-alpine.now.sh/
[![Deploy to now](https://deploy.now.sh/static/button.svg)](https://deploy.now.sh/?repo=https://github.com/evenchange4/nextjs-pkg-docker-alpine&docker=true&env=API_URL)
## Install and Build
```bash
$ 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
```bash
$ 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
```bash
$ now --docker
```# License
MIT © [Michael Hsu](https://michaelhsu.tw)