Zerops
Nodejs Preset: SERVER_PRESET: zerops
Static Preset: SERVER_PRESET: zerops-static
Want to test running Nuxt on Zerops without installing or setting up anything? Using repositories Zerops x Nuxt - Static or Zerops x Nuxt - SSR on Node.js you can deploy example Nuxt app with a single click.
Zerops supports deploying both static and server-side rendered apps with a simple configuration file in your project root.
Static
Projects and services can be added either through a Project add wizard or imported using a YAML structure:
Creating a Project
project:
name: recipe-nuxt
services:
- hostname: app
type: static
This will create a project called recipe-nuxt
with a Zerops Static service called app
.
Setting up Zerops YAML
To tell Zerops how to build and run your app, add a zerops.yml
to your root:
zerops:
- setup: app
build:
base: nodejs@20
buildCommands:
- yarn
- yarn nuxi generate
deployFiles:
- .output/public/~
run:
base: static
Now you can trigger the build & deploy pipeline using the Zerops CLI or by connecting the app service with your GitHub / GitLab repository from inside the service detail.
SSR Node.js
Projects and services can be added either through a Project add wizard or imported using a YAML structure:
project:
name: recipe-nuxt
services:
- hostname: app
type: nodejs@20
This will create a project called recipe-nuxt
with a Zerops Static service called app
.
Setting up Zerops YAML
To tell Zerops how to build and run your app, add a zerops.yml
to your root:
zerops:
- setup: nuxt
build:
base: nodejs@18
prepareCommands:
- node -v
buildCommands:
- yarn
- yarn build
deployFiles:
- .output/~
run:
base: nodejs@18
ports:
- port: 3000
httpSupport: true
start: node server/index.mjs
Now you can trigger the build & deploy pipeline using the Zerops CLI or by connecting the app service with your GitHub / GitLab repository from inside the service detail.
Building & Deploying your App
- Install the Zerops CLI.
npm i -g @zerops/zcli
- Open Settings > Access Token Management in the Zerops app and generate a new access token.
- Log in using your access token with the following command:
zcli login <token>
- Navigate to the root of your app (where
zerops.yml
is located) and run the following command to trigger the deploy:
zcli push
Your code can be deployed automatically on each commit or a new tag by connecting the service with your GitHub / GitLab repository. This connection can be set up in the service detail.