### Install Dependencies and Start Development Server Source: https://github.com/zeropsio/docs/blob/main/README.md Use these commands to install project dependencies and start the local development server for contributing to the documentation. ```bash # Installs dependencies yarn # Starts the development server at localhost:3001 yarn dev ``` -------------------------------- ### Example zerops.yaml Install Configuration Source: https://github.com/zeropsio/docs/blob/main/apps/docs/content/references/zsc.mdx Demonstrates how to use the 'zsc install' command within the 'zerops.yaml' configuration to prepare build and run environments. ```yaml zerops: - setup: nodejsapp build: os: ubuntu base: - nodejs@22 - python@3.11 run: os: ubuntu base: nodejs@22 prepareCommands: - zsc install python@3.11 ``` -------------------------------- ### Bun Build Commands Example Source: https://github.com/zeropsio/docs/blob/main/apps/docs/content/bun/how-to/build-process.mdx Example build commands for a Bun application. Includes installing dependencies and building the application for a specific target. ```yaml buildCommands: - bun install --verbose - bun build --target=bun ``` -------------------------------- ### Install Dependencies and Generate Key Source: https://github.com/zeropsio/docs/blob/main/apps/docs/src/components/backup/frameworks/laravel/recipes/filament-local.mdx Install project dependencies using Composer, generate the application key, install npm packages, and start the development server. ```bash composer install php artisan key:generate npm install npm run dev ``` ```bash php artisan serve ``` -------------------------------- ### Example zerops.yaml Noop Start Command Source: https://github.com/zeropsio/docs/blob/main/apps/docs/content/references/zsc.mdx Shows how to use 'zsc noop' as the start command in 'zerops.yaml' for services that require a persistent running state. ```yaml zerops: - setup: myapp run: start: zsc noop ports: - port: 8080 http: true ``` -------------------------------- ### Install Additional Technologies in Runtime Source: https://github.com/zeropsio/docs/blob/main/apps/docs/static/llms-small.txt Configure the runtime environment to use a specific .NET base and install additional technologies like Go using prepareCommands. This example uses a YAML array for the base and adds Go. ```yaml zerops: # hostname of your service - setup: app # ==== how to build your application ==== build: # REQUIRED. Sets the base technology for the build environment: base: dotnet@6 ... # ==== how to run your application ==== run: # OPTIONAL. Sets the base technology for the runtime environment: base: - dotnet@6 prepareCommands: - zsc add go@latest ... ``` -------------------------------- ### Configure Local Environment Source: https://github.com/zeropsio/docs/blob/main/apps/docs/src/components/backup/frameworks/laravel/recipes/twill-local.mdx Copy the example environment file and install project dependencies. Ensure you fill in the database access details from the Zerops GUI. ```bash cp .env.example .env ``` ```bash composer install ``` ```bash php artisan key:generate ``` ```bash npm install ``` ```bash npm run dev ``` -------------------------------- ### Basic Ubuntu Setup for Custom Runtime Source: https://github.com/zeropsio/docs/blob/main/apps/docs/content/ubuntu/how-to/customize-runtime.mdx Configure the base runtime and add commands to update package lists and install essential tools like ImageMagick and FFmpeg. ```yaml ... run: base: {{serviceVersion}} prepareCommands: - sudo apt-get update - sudo apt-get install -y imagemagick ffmpeg ``` -------------------------------- ### Install Additional Technologies in Runtime Source: https://github.com/zeropsio/docs/blob/main/apps/docs/static/llms-small.txt Customize the runtime environment by installing multiple technologies, such as PHP with Apache and Go, using a YAML array. This example shows how to specify multiple base environments and prepare commands. ```yaml zerops: # hostname of your service - setup: app # ==== how to build your application ==== build: # REQUIRED. Sets the base technology for the build environment: base: php-apache@latest ... # ==== how to run your application ==== run: # OPTIONAL. Sets the base technology for the runtime environment: base: - php-apache@latest prepareCommands: - zsc add go@latest ... ``` -------------------------------- ### Add Technologies and Prepare Commands Source: https://github.com/zeropsio/docs/blob/main/apps/docs/content/dotnet/how-to/build-pipeline.mdx Configure the runtime environment to include multiple base technologies and define commands to run before the application starts. This example adds Go and specifies .NET 6 as the base. ```yaml zerops: - setup: app build: base: dotnet@6 ... run: base: - dotnet@6 prepareCommands: - zsc add go@latest ... ``` -------------------------------- ### Example Zerops YAML with Deploy Files Source: https://github.com/zeropsio/docs/blob/main/apps/docs/content/zerops-yaml/specification.mdx A basic Zerops YAML configuration specifying the application setup and deploying all files from the current directory. ```yaml zerops: - setup: app build: deployFiles: ./ ``` -------------------------------- ### Install Multiple Technologies in Runtime Source: https://github.com/zeropsio/docs/blob/main/apps/docs/static/llms-small.txt Install multiple technologies to the runtime environment by setting them as a YAML array. This example adds 'go@latest' using 'zsc add'. ```yaml zerops: # hostname of your service - setup: app # ==== how to build your application ==== build: # REQUIRED (if using build). Sets the base technology for the build environment: base: nodejs@latest ... # ==== how to run your application ==== run: # OPTIONAL. Sets the base technology for the runtime environment: base: - nginx@latest prepareCommands: - zsc add go@latest ... ``` -------------------------------- ### Install Multiple Technologies in Build Environment Source: https://github.com/zeropsio/docs/blob/main/apps/docs/content/gleam/how-to/build-pipeline.mdx Configures the build environment to use Gleam as the base and install additional technologies like Go using prepareCommands. This allows for a customized build setup. ```yaml zerops: # hostname of your service - setup: app # ==== how to build your application ==== build: # REQUIRED. Sets the base technology for the build environment: base: - gleam@latest prepareCommands: - zsc add go@latest ... ``` -------------------------------- ### Include Project Files and Restore Dependencies Source: https://github.com/zeropsio/docs/blob/main/apps/docs/content/dotnet/how-to/customize-runtime.mdx Use `build.addToRunPrepare` to include project files and `run.prepareCommands` to restore .NET dependencies. This example also shows installing a system package. ```yaml build: addToRunPrepare: - *.csproj - nuget.config run: prepareCommands: - sudo apk add imagemagick - dotnet restore ``` -------------------------------- ### Install Older zCLI Version via Install Script Source: https://github.com/zeropsio/docs/blob/main/apps/docs/static/llms-full.txt For releases before v1.1.0, which lack checksums, use the install script to install specific versions. This example shows installing v1.0.67. ```sh curl -fsSL https://raw.githubusercontent.com/zerops/zcli/main/install.sh | sh -s -- v1.0.67 ``` -------------------------------- ### Example: Create a Database Backup Source: https://github.com/zeropsio/docs/blob/main/apps/docs/static/llms-full.txt Demonstrates how to create a backup for a stack named 'db'. ```sh zsc backup-create db ``` -------------------------------- ### Example zerops.yaml Service Configuration Source: https://github.com/zeropsio/docs/blob/main/apps/docs/content/references/import.mdx This snippet demonstrates how to configure a Node.js service using both zeropsSetup and zeropsYaml parameters within a zerops.yaml file. It specifies the build source, setup name, build commands, deployment files, cache, migration commands, and the start command. ```yaml services: - hostname: app type: nodejs@22 buildFromGit: https://github.com/myorg/myapp # Specify which setup to use from zerops.yaml zeropsSetup: backendapi # Full zerops.yaml configuration zeropsYaml: zerops: - setup: backendapi build: base: nodejs@18 buildCommands: - npm ci - npm run build deployFiles: ./dist cache: node_modules run: initCommands: - npm run db:migrate start: npm start ``` -------------------------------- ### Package Command Example Source: https://github.com/zeropsio/docs/blob/main/apps/docs/content/zcp/workflows/package-running-service.mdx Use this command to initiate the packaging process for a specific application stage. ```text Package appstage as a buildFromGit import bundle. Commit it and push it to git. ``` -------------------------------- ### Install Base Environment Source: https://github.com/zeropsio/docs/blob/main/apps/docs/content/references/zsc.mdx Installs a specified base technology and version into the runtime container. Use this to add necessary runtimes or tools before your application starts. ```sh zsc install [flags] ``` ```sh zsc install rust@1.78 ``` ```sh zsc install dotnet@8 ``` ```sh zsc install nginx@1.22 ``` -------------------------------- ### Install System Packages and Global Tools Source: https://github.com/zeropsio/docs/blob/main/apps/docs/content/dotnet/how-to/customize-runtime.mdx Use `run.os` to specify the operating system and `run.prepareCommands` to install system packages like `imagemagick` and global .NET tools. ```yaml run: os: ubuntu base: {{serviceVersion}} prepareCommands: - sudo apt-get update - sudo apt-get install -y imagemagick - dotnet tool install -g some-global-tool ``` -------------------------------- ### Install Multiple Technologies to Runtime Source: https://github.com/zeropsio/docs/blob/main/apps/docs/static/llms-full.txt Install additional technologies to the runtime environment by specifying them as a YAML array. This example adds Go alongside Python. ```yaml zerops: - setup: app build: base: python@latest ... run: base: - python@latest prepareCommands: - zsc add go@latest ... ``` -------------------------------- ### Install Additional Technologies in Runtime Source: https://github.com/zeropsio/docs/blob/main/apps/docs/static/llms-small.txt Install multiple technologies to the runtime environment by specifying them as a YAML array. This example adds Go alongside Gleam. ```yaml zerops: # hostname of your service - setup: app # ==== how to build your application ==== build: # REQUIRED. Sets the base technology for the build environment: base: gleam@latest ... # ==== how to run your application ==== run: # OPTIONAL. Sets the base technology for the runtime environment: base: - gleam@latest prepareCommands: - zsc add go@latest ... ``` -------------------------------- ### Set Up Laravel Environment Variables Source: https://github.com/zeropsio/docs/blob/main/apps/docs/src/components/backup/frameworks/laravel/recipes/minimal-local.mdx Copy the example environment file and fill in your database access details obtained from the Zerops GUI. ```bash # Create and configure environment file cp .env.example .env ``` -------------------------------- ### Alpine Runtime Setup with Build Files Source: https://github.com/zeropsio/docs/blob/main/apps/docs/content/alpine/how-to/customize-runtime.mdx Customize the Alpine runtime by installing specific development libraries and Python packages from a requirements file. This involves updating package lists, installing build dependencies, and then installing Python packages. ```yaml ... build: ... addToRunPrepare: - requirements.txt run: ... prepareCommands: - sudo apk update - sudo apk add --no-cache libpq-dev py3-pip - pip install -r requirements.txt ``` -------------------------------- ### Deploy Specific Files and Folders Source: https://github.com/zeropsio/docs/blob/main/apps/docs/content/dotnet/how-to/build-pipeline.mdx Example of deploying a folder and a file from the project root directory. ```yaml deployFiles: - app - file.txt ``` -------------------------------- ### Install Additional Technologies in Runtime Source: https://github.com/zeropsio/docs/blob/main/apps/docs/content/nginx/how-to/build-pipeline.mdx Install multiple technologies to the runtime environment by defining them as a YAML array under the 'base' attribute. This example adds Go to the Nginx runtime. ```yaml zerops: - setup: app build: base: nodejs@latest ... run: base: - nginx@latest prepareCommands: - zsc add go@latest ... ``` -------------------------------- ### Start Zerops VPN Connection Source: https://github.com/zeropsio/docs/blob/main/apps/docs/content/references/networking/vpn.mdx Connects to the Zerops VPN for a specific project. First-time usage requires installing the Zerops VPN daemon. Administrator privileges may be required for installation. ```bash zcli vpn up [project-id] [flags] ``` ```bash zcli vpn up Evs8Je4NTvKeIkUqoUXp2w ``` -------------------------------- ### Set Multiple Base Technologies and Prepare Commands Source: https://github.com/zeropsio/docs/blob/main/apps/docs/static/llms-full.txt Configure the runtime environment with multiple base technologies and specify commands to prepare the environment. This example uses 'go@latest' as the base and adds 'nodejs@latest' via prepareCommands. ```yaml zerops: # hostname of your service - setup: app # ==== how to build your application ==== build: # REQUIRED. Sets the base technology for the build environment: base: go@latest ... # ==== how to run your application ==== run: # OPTIONAL. Sets the base technology for the runtime environment: base: - go@latest prepareCommands: - zsc add nodejs@latest ... ``` -------------------------------- ### Define Multiple Start Commands Source: https://github.com/zeropsio/docs/blob/main/apps/docs/content/zerops-yaml/specification.mdx Configure multiple commands to start different processes, such as the main application server and a replication service. Each command can have an optional name and initCommands for specific setup. ```yaml run: startCommands: # start the application - command: npm run start:prod name: server # start the replication - command: litestream replicate -config=litestream.yaml name: replication # restore the database on container init initCommands: - litestream restore -if-replica-exists -if-db-not-exists -config=litestream.yaml $DB_NAME ``` -------------------------------- ### Configure Local Environment File Source: https://github.com/zeropsio/docs/blob/main/apps/docs/src/components/backup/frameworks/laravel/recipes/filament-local.mdx Copy the example environment file and fill in your database access details obtained from the Zerops GUI. ```bash cp .env.example .env ``` -------------------------------- ### Deploy Specific Files and Folders Source: https://github.com/zeropsio/docs/blob/main/apps/docs/static/llms-small.txt Examples of deploying a folder and a file from the project root, or a file and folder from a defined path. ```yaml deployFiles: - public - file.txt ``` ```yaml deployFiles: - ./path/to/file.txt - ./path/to/dir/ ``` -------------------------------- ### Customize Build Environment with Prepare Commands Source: https://github.com/zeropsio/docs/blob/main/apps/docs/content/deno/how-to/build-pipeline.mdx Use 'prepareCommands' to install additional packages or tools into the build environment before the main build process. This allows for custom setups like installing specific system packages. ```yaml zerops: # hostname of your service - setup: app # ==== how to build your application ==== build: # REQUIRED. Set the base technology for the build environment: base: deno@latest # OPTIONAL. Customise the build environment by installing additional packages # or tools to the base build environment. prepareCommands: - sudo apt-get something - curl something else ... ``` -------------------------------- ### Install Dependencies with prepareCommands Source: https://github.com/zeropsio/docs/blob/main/apps/docs/static/llms-full.txt Use `prepareCommands` to install additional packages or tools in the runtime environment. Commands are executed sequentially in the `/home/zerops` directory. A non-zero exit code cancels the deploy. ```yaml zerops: - setup: app # ==== how to build your application ==== build: ... # ==== how to run your application ==== run: # OPTIONAL. Customise the runtime environment by installing additional packages # or tools to the base Ubuntu runtime environment. prepareCommands: - sudo apt-get something - curl something else ... ``` -------------------------------- ### Install Dependencies with prepareCommands Source: https://github.com/zeropsio/docs/blob/main/apps/docs/static/llms-small.txt Use `run.prepareCommands` to install additional packages or tools to the base Alpine runtime environment. Commands are executed in the `/home/zerops` directory. Failure of any command will cancel the deploy. ```yaml zerops: # hostname of your service - setup: app # ==== how to build your application ==== build: ... # ==== how to run your application ==== run: # OPTIONAL. Customise the runtime environment by installing additional packages # or tools to the base Alpine runtime environment. prepareCommands: - sudo apk add --no-cache something - curl something else ... ``` -------------------------------- ### Install Dependencies with prepareCommands Source: https://github.com/zeropsio/docs/blob/main/apps/docs/static/llms-small.txt Use `prepareCommands` to install additional packages or tools in the runtime environment. Commands are executed in the `/home/zerops` directory. A non-zero exit code cancels the deploy. ```yaml zerops: # hostname of your service - setup: app # ==== how to build your application ==== build: ... # ==== how to run your application ==== run: # OPTIONAL. Customise the runtime environment by installing additional packages # or tools to the base Ubuntu runtime environment. prepareCommands: - sudo apt-get something - curl something else ... ``` -------------------------------- ### Use Wildcard for Any Folder Source: https://github.com/zeropsio/docs/blob/main/apps/docs/content/nodejs/how-to/build-pipeline.mdx Supports the '~' character as a wildcard for one or more folders in the path. This example deploys all folders located in any path starting with '/path/to/'. ```yaml deployFiles: ./path/to/~/ ```