Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zeropsio/recipe-nextjs-static
Next.js Static on Zerops
https://github.com/zeropsio/recipe-nextjs-static
nextjs nextjs-ssg nextjs-static nextjs14 zerops zerops-deployment zerops-recipe
Last synced: 25 days ago
JSON representation
Next.js Static on Zerops
- Host: GitHub
- URL: https://github.com/zeropsio/recipe-nextjs-static
- Owner: zeropsio
- Created: 2024-07-21T12:21:33.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-01T14:17:14.000Z (5 months ago)
- Last Synced: 2024-08-01T18:27:56.307Z (5 months ago)
- Topics: nextjs, nextjs-ssg, nextjs-static, nextjs14, zerops, zerops-deployment, zerops-recipe
- Language: TypeScript
- Homepage:
- Size: 60.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Zerops x Next.js - Static
Next.js is a React framework for fast, dynamic full-stack web apps with both server-side rendering and static site generation. Zerops makes deploying and running Next.js apps, both server side rendered and static, a breeze.
This recipe showcases the SSG Static version, see [zeropsio/recipe-nextjs-nodejs](https://github.com/zeropsio/recipe-nextjs-nodejs) for the Node.js version.
![nextjs](https://github.com/zeropsio/recipe-shared-assets/blob/main/covers/svg/cover-nextjs.svg)
## Deploy to Zerops
You can either click the deploy button to deploy directly on Zerops, or manually copy the [import yaml](https://github.com/zeropsio/recipe-nextjs-static/blob/main/zerops-project-import.yml) to the import dialog in the Zerops app.
[![Deploy on Zerops](https://github.com/zeropsio/recipe-shared-assets/blob/main/deploy-button/green/deploy-button.svg)](https://app.zerops.io/recipe/nextjs-static)
## Recipe features
- Latest version of **Next.js 14+** with SSG running on a load balanced **Zerops Static** service.
## Production vs. development
This recipe is ready for production as is, and will scale horizontally by adding more containers in case of high traffic surges. If you want to achieve the highest baseline reliability and resiliace, start with at least two containers (add `minContainers: 2` in recipe YAML in the `app` service section, or change the minimum containers in "Automatic Scaling configuration" section of service detail).
## Changes made over the default installation
If you want to modify your existing Next.js app to efficiently run on Zerops, Follow this step:1. Go to [`next.config.mjs`](https://github.com/zeropsio/recipe-nextjs-static/blob/main/next.config.mjs) and add `output: 'export'` to nextConfig.
```javascript
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
};export default nextConfig;
```Now, there are no changes needed in the codebase on top of the standard installation, just add [zerops.yml](https://github.com/zeropsio/recipe-nextjs-static/blob/main/zerops.yml) to your repository.
Need help setting your project up? Join [Zerops Discord community](https://discord.com/invite/WDvCZ54).