- 3. In the left menu, click on Import services , copy & paste the contents of the `import-services.yml` config file from the recipe repository of your choice. Then click on Import service .
+ 3. In the left menu, click on Import services , copy & paste the contents of the `import-services.yaml` config file from the recipe repository of your choice. Then click on Import service .
Learn more about services in Zerops and how to import a service to an existing project.
diff --git a/apps/docs/content/go/tutorial/step-by-step.mdx b/apps/docs/content/go/tutorial/step-by-step.mdx
index 08c9499d3..aea2b3fd1 100644
--- a/apps/docs/content/go/tutorial/step-by-step.mdx
+++ b/apps/docs/content/go/tutorial/step-by-step.mdx
@@ -23,7 +23,7 @@ In the detail of each step, you can find a link with more information about the
2. Create a project.
- Learn more about projects in
+ Learn more about projects in
Zerops. See how to import a whole project into Zerops.
@@ -31,7 +31,7 @@ In the detail of each step, you can find a link with more information about the
3. In the left menu, click on Import services , copy & paste the
- contents of this yaml file and click on Import service .
+ contents of this yaml file and click on Import service .
Learn more about services in Zerops and how to import a service to an existing project.
diff --git a/apps/docs/content/help/faq.mdx b/apps/docs/content/help/faq.mdx
index 0d859da8f..0d55f65b9 100644
--- a/apps/docs/content/help/faq.mdx
+++ b/apps/docs/content/help/faq.mdx
@@ -5,6 +5,7 @@ description: Get quick answers to your related questions about Zerops from frequ
import Accordion from '/src/components/Accordion';
import { FAQ, FAQItem } from '/src/components/Faq';
+import Image from '/src/components/Image';
Get quick answers to your related questions about Zerops from frequently asked questions we get asked.
@@ -16,7 +17,34 @@ Get quick answers to your related questions about Zerops from frequently asked q
It's free to get started, and no credit card is required! However, we
- recommend visiting our pricing page to explore the options that best suit your needs.
+ recommend visiting our pricing page to explore the options that best suit your needs.
+
+ We also have a calculator on our pricing page that can help you estimate the cost of your project.
+
+
+ Our infrastructure is hosted in our own high-tier data center in Prague,
+ Czech Republic, running on bare metal servers managed by vshosting's senior
+ admin team. The project was originally started in vshosting.eu , one of the largest providers of managed hosting
+ in Europe.
+
+ We are actively working on expanding to multiple regions to provide better
+ global coverage - stay tuned for updates on our Discord server and checkout our roadmap !
+
+
+ We have a detailed article discussing whether you should go for a Self-hosted PaaS → [The rise of self-hosted PaaS — is $5 VPS all you need?](https://zerops.io/article/the-rise-of-self-hosted-paa-s-is-5-vps-all-you-need).
+
+
+ Navigate to the main menu in the Zerop GUI (with your icon) and add a new user with the selected email to your team.
+
+
+
You can reach us on our Discord server for support. For additional contact options, please visit our contacts page .
diff --git a/apps/docs/content/homepage.mdx b/apps/docs/content/homepage.mdx
index fa26996a7..f2bccbef6 100644
--- a/apps/docs/content/homepage.mdx
+++ b/apps/docs/content/homepage.mdx
@@ -44,14 +44,14 @@ export const containers = [
export const databases = [
{ name: "PostgreSQL", link: "/postgresql/overview", icon: },
{ name: "MariaDB", link: "/mariadb/overview", icon: },
- { name: "KeyDB", link: "/keydb/overview", icon: },
+ { name: "Valkey", link: "/valkey/overview", icon: },
{ name: "Elasticsearch", link: "/elasticsearch/overview", icon: },
{ name: "Typesense", link: "/typesense/overview", icon: },
{ name: "Meilisearch", link: "/meilisearch/overview", icon: },
- { name: "Qdrant", icon: },
- { name: "Valkey", icon: },
+ { name: "Qdrant", link: "/qdrant/overview", icon: },
+ { name: "NATS", link: "/nats/overview", icon: },
+ { name: "KeyDB", link: "/keydb/overview", icon: },
{ name: "Kafka", icon: },
- { name: "NATS", icon: },
]
export const storages = [
@@ -60,11 +60,8 @@ export const storages = [
]
-# Zerops Documentation
-Zerops is a **developer-first Platform-as-a-Service**, running on **bare metal** from a top-tier datacenter, with every part built from scratch. Zerops aims to be the **perfect mix** of **developer experience**, **flexibility**, **scalability** and **affordability**, making it a **great fit** for applications of **any size**, **complexity** and **traffic**.
-
-
+Zerops is a **developer-first Platform-as-a-Service**, running on bare metal, with every part built from scratch. Zerops aims to be the perfect mix of **developer experience**, **flexibility**, **scalability** and **affordability**, making it a great fit for applications of any size, complexity and traffic.
## Natively supported services
@@ -115,8 +112,8 @@ items={storages} />
},
{
type: 'link',
- href: '/zerops-yml/specification',
- label: 'zerops.yml',
+ href: '/zerops-yaml/specification',
+ label: 'zerops.yaml',
customProps: {
icon: Icons['document-text'],
html: 'Configuration file placed to your repository, telling Zerops how to build and start your app.',
@@ -164,7 +161,7 @@ You get a fully managed, professional infrastructure setup that will scale no ma
### ➡️ Granular resource configuration, autoscaling and high availability of services
-Zerops has fully automatic horizontal and vertical scaling with configuration steps as small as 0.25 MB RAM and 1 CPU core. Your runtime services can go from a single container with 0.25 RAM and 1 CPU core to 10 containers each with 32 GB RAM and 10 CPU cores and then back in a matter of minutes. At the same time, all database and storage services are offered in well-crafted setups that go through performance optimizations while scaling and are available in both non-HA (single container) and high availability (multiple containers and balancers) modes.
+Zerops has fully automatic horizontal and vertical scaling with configuration steps as small as 0.125 GB RAM and 1 CPU core. Your runtime services can go from a single container with 0.25 RAM and 1 CPU core to 10 containers each with 32 GB RAM and 10 CPU cores and then back in a matter of minutes. At the same time, all database and storage services are offered in well-crafted setups that go through performance optimizations while scaling and are available in both non-HA (single container) and high availability (multiple containers and balancers) modes.
:::tip[**What does this mean for you?**]
diff --git a/apps/docs/content/java/faq.mdx b/apps/docs/content/java/faq.mdx
deleted file mode 100644
index 16d656d1c..000000000
--- a/apps/docs/content/java/faq.mdx
+++ /dev/null
@@ -1,10 +0,0 @@
----
-title: Frequently Asked Questions
-description: Get quick answers to your related questions about Java from frequently asked questions by people at Zerops.
----
-
-import { FAQ, FAQItem } from '/src/components/Faq';
-
-
- sample answer
-
diff --git a/apps/docs/content/java/how-to/access.mdx b/apps/docs/content/java/how-to/access.mdx
index 09e5ea13a..170d21017 100644
--- a/apps/docs/content/java/how-to/access.mdx
+++ b/apps/docs/content/java/how-to/access.mdx
@@ -55,7 +55,7 @@ Use the
`ssh` command to connect to your service v
## Public access through zerops.io subdomain
-By default, your Java service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zeropsapp-subdomain).
+By default, your Java service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
## Public access through your domain
@@ -63,4 +63,4 @@ By default, your Java service is not publicly accessible. When your application
## Public access from another Zerops project
-All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/java/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zeropsapp-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/java/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
diff --git a/apps/docs/content/java/how-to/build-pipeline.mdx b/apps/docs/content/java/how-to/build-pipeline.mdx
index 8c39654df..07f79c3f4 100644
--- a/apps/docs/content/java/how-to/build-pipeline.mdx
+++ b/apps/docs/content/java/how-to/build-pipeline.mdx
@@ -8,11 +8,11 @@ import UnorderedList from '@site/src/components/UnorderedList';
Zerops provides a customizable build and runtime environment for your Java application.
-## Add zerops.yml to your repository
+## Add zerops.yaml to your repository
-Start by adding `zerops.yml` file to the **root of your repository** and modify it to fit your application:
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
@@ -72,9 +72,9 @@ The top-level element is always `zerops`.
### Setup
The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
-Zerops supports the definition of multiple runtime services in a single `zerops.yml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yml`:
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
-```yml
+```yaml
zerops:
# definition for app service
- setup: app
@@ -99,7 +99,7 @@ Following options are available for Java builds:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -117,12 +117,12 @@ zerops:
:::info
-You can change the base environment when you need to. Just simply modify the `zerops.yml` in your repository.
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
:::
If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -136,7 +136,7 @@ zerops:
...
```
-See the full list of supported [build base environments](/zerops-yml/base-list#runtime-services).
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
To customize your build environment use the [prepareCommands](/java/how-to/build-pipeline#preparecommands) attribute.
@@ -181,7 +181,7 @@ The base build environment contains:
To install additional packages or tools add one or more prepare commands:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -222,7 +222,7 @@ You can configure your prepare commands to be run in a single shell instance or
_REQUIRED._ Defines build commands.
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -249,7 +249,7 @@ Before the build commands are triggered the build container contains:
Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it. Suppose your `mvnw` executable file is in a `cmd` directory.
-```yml
+```yaml
buildCommands:
- |
cd cmd
@@ -260,7 +260,7 @@ buildCommands:
When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command. Suppose your `mvnw` executable file is in a `cmd` directory.
-```yml
+```yaml
buildCommands:
- cd cmd
- ./cmd/mvnw clean install
@@ -270,7 +270,7 @@ buildCommands:
If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/java/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `-X` debug option.
-```yml
+```yaml
buildCommands:
- ./mvnw -X clean install
```
@@ -281,7 +281,7 @@ If the command ends successfully, it returns the exit code 0 and Zerops triggers
_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use
`.deployignore` file.
-```yml
+```yaml
# REQUIRED. Select which files / folders to deploy after
# the build has successfully finished
deployFiles:
@@ -290,7 +290,7 @@ deployFiles:
Determines files or folders produced by your build, which should be deployed to your runtime service containers.
-The path starts from the **root directory** of your project (the location of `zerops.yml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
@@ -298,7 +298,7 @@ The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/
Deploys a folder, and a file from the project root directory:
-```yml
+```yaml
deployFiles:
- api
- app.jar
@@ -306,13 +306,13 @@ deployFiles:
Deploys the whole content of the build container:
-```yml
+```yaml
deployFiles: .
```
Deploys a folder, and a file in a defined path:
-```yml
+```yaml
deployFiles:
- ./path/to/file.txt
- ./path/to/dir/
@@ -324,19 +324,19 @@ Zerops supports the `~` character as a wildcard for one or more folders in the p
Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
-```yml
+```yaml
deployFiles: ./path/~/to/file.txt
```
Deploys all folders that are located in any path that begins with `/path/to/`
-```yml
+```yaml
deployFiles: ./path/to/~/
```
Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
-```yml
+```yaml
deployFiles: ./path/~/to/
```
@@ -355,7 +355,7 @@ For consistency, it's recommended to configure both your `.gitignore` and `.depl
Examples:
-```yml title="zerops.yml"
+```yaml title="zerops.yaml"
zerops:
- setup: app
build:
@@ -382,7 +382,7 @@ This example above ignores `file.txt` in ANY directory named `src`, such as:
_OPTIONAL._ Defines which files or folders will be cached for the next build.
-```yml
+```yaml
# OPTIONAL. Which files / folders you want to cache for the next build.
# Next builds will be faster when the cache is used.
cache: file.txt
@@ -400,7 +400,7 @@ _OPTIONAL._ Defines the environment variables for the build environment.
Enter one or more env variables in following format:
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
@@ -430,7 +430,7 @@ Following options are available for Java builds:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -453,12 +453,12 @@ zerops:
:::info
-You can change the base environment when you need to. Just simply modify the `zerops.yml` in your repository.
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
:::
If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -478,7 +478,7 @@ zerops:
...
```
-See the full list of supported [run base environments](/zerops-yml/base-list).
+See the full list of supported [run base environments](/zerops-yaml/base-list).
To customize your build environment use the `prepareCommands` attribute.
@@ -548,7 +548,7 @@ _OPTIONAL._ Customizes the Java runtime environment by installing additional dep
prepare commands:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -602,14 +602,14 @@ You can configure your prepare commands to be run in a single shell instance or
The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
# ==== how to build your application ====
build:
...
- addToRunPrepare: ./runtime-config.yml
+ addToRunPrepare: ./runtime-config.yaml
# ==== how to run your application ====
run:
@@ -621,13 +621,13 @@ zerops:
...
```
-In the example above Zerops will copy the `runtime-config.yml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
### initCommands
_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -667,7 +667,7 @@ _OPTIONAL._ Defines the environment variables for the runtime environment.
Enter one or more env variables in following format:
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
@@ -687,7 +687,7 @@ Read more about [environment variables](/java/how-to/env-variables) in Zerops.
_REQUIRED._ Defines the start command for your Java application.
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -723,7 +723,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -771,7 +771,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -800,7 +800,7 @@ _OPTIONAL._ Defines cron jobs.
Setup cron jobs in the following format:
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
@@ -839,7 +839,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -887,7 +887,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
diff --git a/apps/docs/content/java/how-to/build-process.mdx b/apps/docs/content/java/how-to/build-process.mdx
index f15046252..de164223c 100644
--- a/apps/docs/content/java/how-to/build-process.mdx
+++ b/apps/docs/content/java/how-to/build-process.mdx
@@ -24,9 +24,9 @@ The default Java build environment contains:
- Git
:::note
-To use Ubuntu instead of the default Alpine, set the [build.os](/zerops-yml/specification#os-) attribute.
+To use Ubuntu instead of the default Alpine, set the [build.os](/zerops-yaml/specification#os-) attribute.
-Additional packages and tools can be installed using [build.prepareCommands](/zerops-yml/specification#preparecommands-).
+Additional packages and tools can be installed using [build.prepareCommands](/zerops-yaml/specification#preparecommands-).
:::
## Description of the build process
@@ -60,11 +60,11 @@ The build cancellation is available before the build pipeline is finished. When
The default Java build environment contains:
-
{data.alpine.default}
-- selected version of Java defined in `zerops.yml` [build.base](/java/how-to/build-pipeline#base) parameter
+- selected version of Java defined in `zerops.yaml` [build.base](/java/how-to/build-pipeline#base) parameter
- [zCLI](/references/cli), Zerops command line tool
- `git` and `wget`
-If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/java/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](/java/how-to/build-pipeline#preparecommands) commands to your `zerops.yml`.
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/java/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](/java/how-to/build-pipeline#preparecommands) commands to your `zerops.yaml`.
:::info
The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
@@ -110,7 +110,7 @@ This will force Zerops to run the next build clean, including all prepare comman
If any [build command](/java/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/java/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the verbose `-X` debug option.
-```yml
+```yaml
build:
- ./mvnw -X clean install
```
diff --git a/apps/docs/content/java/how-to/create.mdx b/apps/docs/content/java/how-to/create.mdx
index c31928ad7..6e55a0790 100644
--- a/apps/docs/content/java/how-to/create.mdx
+++ b/apps/docs/content/java/how-to/create.mdx
@@ -7,6 +7,7 @@ import Image from '/src/components/Image';
import data from '@site/static/data.json';
import UnorderedList from '@site/src/components/UnorderedList';
import Video from '@site/src/components/Video';
+import ResourceTable from '/src/components/ResourceTable';
Zerops provides a Java runtime service with extensive build support. Java runtime is highly scalable and customisable to suit both development and production.
@@ -81,33 +82,7 @@ Choose the CPU mode when starting a new service or change it later. The CPU mode
Vertical auto scaling has following default configuration:
-
-
-
- Resources Type
- Minimum resource
- Maximum resource
-
-
-
-
- CPU cores
- 1
- 5
-
-
- RAM
- 0.25 GB
- 32 GB
-
-
- Disk
- 1 GB
- 100 GB
-
-
-
-
+
Java service always starts with the minimal resources.
@@ -182,7 +157,7 @@ Zerops uses a yaml format to describe the project infrastructure.
#### Basic example:
-Create a directory `my-project`. Create an `description.yml` file inside the `my-project` directory with following content:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
```yaml
# basic project data
@@ -205,7 +180,7 @@ services:
S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
```
-The yaml file describes your future project infrastructure. The project will contain one Java version 1 service with default [auto scaling](/java/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yml](/java/how-to/build-pipeline#ports). Following secret env variables will be configured:
+The yaml file describes your future project infrastructure. The project will contain one Java version 1 service with default [auto scaling](/java/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/java/how-to/build-pipeline#ports). Following secret env variables will be configured:
```env
S3_ACCESS_KEY_ID="P8cX1vVVb"
@@ -214,7 +189,7 @@ S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
#### Full example:
-Create a directory my-project. Create an description.yml file inside the my-project directory with following content:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
```yaml
# basic project data
@@ -263,7 +238,7 @@ services:
The yaml file describes your future project infrastructure. The project will contain a Java service and a [PostgreSQL](/postgresql/overview) service.
-Java service with "app" hostname, the internal port(s) the service listens on will be defined later in the zerops.yml. Java service will run on version 1 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+Java service with "app" hostname, the internal port(s) the service listens on will be defined later in the zerops.yaml. Java service will run on version 1 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
```env
S3_ACCESS_KEY_ID="P8cX1vVVb"
@@ -272,7 +247,7 @@ S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
-#### Description of description.yml parameters
+#### Description of description.yaml parameters
The `project:` section is required. Only one project can be defined.
@@ -304,7 +279,7 @@ The `project:` section is required. Only one project can be defined.
Specifies the service type and version.
- See what [Java service types](/references/importyml/type-list#runtime-services) are currently supported.
+ See what [Java service types](/references/import-yaml/type-list#runtime-services) are currently supported.
@@ -368,9 +343,9 @@ The `project:` section is required. Only one project can be defined.
-### Create a project based on the description.yml
+### Create a project based on the description.yaml
-When you have your `description.yml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
```sh
Usage:
@@ -383,11 +358,11 @@ Flags:
--workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
```
-Zerops will create a project and one or more services based on the `description.yml` content.
+Zerops will create a project and one or more services based on the `description.yaml` content.
-Maximum size of the `description.yml` file is 100 kB.
+Maximum size of the `description.yaml` file is 100 kB.
-You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yml`.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
@@ -403,7 +378,7 @@ If you have access to more than one client, you must specify the client ID for w
#### Example:
-Create a directory `my-project` if it doesn't exist. Create an `import.yml` file inside the `my-project` directory with following content:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
```yaml
# basic project data
@@ -433,9 +408,9 @@ S3_ACCESS_KEY_ID="P8cX1vVVb"
S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
```
-The content of the `services:` section of `import.yml` is identical to the project description file. The `import.yml` never contains the `project:` section because the project already exists.
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
-When you have your `import.yml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
```sh
Usage:
@@ -449,4 +424,4 @@ Flags:
zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
-Maximum size of the import.yml file is 100 kB.
+Maximum size of the import.yaml file is 100 kB.
diff --git a/apps/docs/content/java/how-to/customize-runtime.mdx b/apps/docs/content/java/how-to/customize-runtime.mdx
index ce1dff958..9401803b4 100644
--- a/apps/docs/content/java/how-to/customize-runtime.mdx
+++ b/apps/docs/content/java/how-to/customize-runtime.mdx
@@ -22,9 +22,9 @@ The default Java runtime environment contains:
- Git
:::note
-To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yml/specification#os--1) attribute.
+To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yaml/specification#os--1) attribute.
-Additional packages and tools can be installed using [run.prepareCommands](/zerops-yml/specification#preparecommands--1).
+Additional packages and tools can be installed using [run.prepareCommands](/zerops-yaml/specification#preparecommands--1).
:::
## Runtime Flow
diff --git a/apps/docs/content/java/how-to/deploy-process.mdx b/apps/docs/content/java/how-to/deploy-process.mdx
index b83f40e44..0d46b90f6 100644
--- a/apps/docs/content/java/how-to/deploy-process.mdx
+++ b/apps/docs/content/java/how-to/deploy-process.mdx
@@ -40,7 +40,7 @@ Zerops performs following actions for each new container:
Services with multiple containers are deployed in parallel.
:::info
-If your application needs to be initialized in each runtime container, add [init commands](/java/how-to/build-pipeline#initcommands) to `zerops.yml`.
+If your application needs to be initialized in each runtime container, add [init commands](/java/how-to/build-pipeline#initcommands) to `zerops.yaml`.
:::
:::caution
@@ -58,7 +58,7 @@ The old containers are then removed from the project balancer so they don't rece
## Readiness checks
-If your application isn't ready to handle requests right after it is started via the [start command](/java/how-to/build-pipeline#start), configure a [readiness check](/java/how-to/build-pipeline#readiness-check) in your `zerops.yml`.
+If your application isn't ready to handle requests right after it is started via the [start command](/java/how-to/build-pipeline#start), configure a [readiness check](/java/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
If the readiness check is defined, Zerops will:
@@ -94,7 +94,7 @@ The list of application versions is available in Zerops GUI. Go to the service d
The pipeline detail is accessible from the additional menu. The pipeline detail contains
-- The pipeline config (`zerops.yml`) that was used for the selected version
+- The pipeline config (`zerops.yaml`) that was used for the selected version
- The build log (if available)
- The prepare runtime log (if available)
diff --git a/apps/docs/content/java/how-to/env-variables.mdx b/apps/docs/content/java/how-to/env-variables.mdx
index 21856739b..988d77126 100644
--- a/apps/docs/content/java/how-to/env-variables.mdx
+++ b/apps/docs/content/java/how-to/env-variables.mdx
@@ -23,12 +23,12 @@ There are 3 different sets of env variables in Zerops:
basic
build
- zerops.yml
+ zerops.yaml
basic
runtime
- zerops.yml
+ zerops.yaml
secret
@@ -41,13 +41,13 @@ There are 3 different sets of env variables in Zerops:
Use the [secret env variables](/java/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
-The basic build and runtime env variables are listed in your [zerops.yml](/zerops-yml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yml and redeploy your application to Zerops.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
You can [reference](/java/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/java/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
## Set secret env variables in Zerops GUI
-Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yml.
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
-
-
- Resources Type
- Minimum resource
- Maximum resource
-
-
-
-
- CPU cores
- 1
- 5
-
-
- RAM
- 0.25 GB
- 32 GB
-
-
- Disk
- 1 GB
- 100 GB
-
-
-
-
+
Java service always starts with the minimal resources.
@@ -207,7 +182,7 @@ The scale up of RAM or disk is immediate. The scale up of CPU is configured to b
The **minimum step** for the vertical scaling is
- 1 CPU core
-- 0.25 GB RAM
+- 0.125 GB RAM
- 0.5 GB disk
When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
diff --git a/apps/docs/content/java/how-to/shared-storage.mdx b/apps/docs/content/java/how-to/shared-storage.mdx
index d206c54f0..b0749def2 100644
--- a/apps/docs/content/java/how-to/shared-storage.mdx
+++ b/apps/docs/content/java/how-to/shared-storage.mdx
@@ -37,15 +37,15 @@ zCLI is the Zerops command-line tool. To create a new Java service via the comma
Zerops uses a yaml format to describe the project infrastructure.
-#### description.yml format
+#### description.yaml format
-[Read the basics](/java/how-to/create#create-a-project-description-file) how to define the Java service using the description.yml.
+[Read the basics](/java/how-to/create#create-a-project-description-file) how to define the Java service using the description.yaml.
#### Example with a shared storage
-Create a directory `my-project`. Create an `description.yml` file inside the `my-project` directory with following content:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
-```yml
+```yaml
# basic project data
project:
# project name
@@ -91,4 +91,4 @@ The mount attribute accepts an array of shared storage names you want to mount t
### Create a project with a Java service and a shared storage
-Follow the article [How to create a project based on the description.yml](/java/how-to/create#create-a-project-based-on-the-descriptionyml).
+Follow the article [How to create a project based on the description.yaml](/java/how-to/create#create-a-project-based-on-the-descriptionyaml).
diff --git a/apps/docs/content/java/how-to/trigger-pipeline.mdx b/apps/docs/content/java/how-to/trigger-pipeline.mdx
index 33741c78d..bfbd69aa0 100644
--- a/apps/docs/content/java/how-to/trigger-pipeline.mdx
+++ b/apps/docs/content/java/how-to/trigger-pipeline.mdx
@@ -20,7 +20,7 @@ Integrate Zerops to your GitHub or GitLab repository and configure the automatic
Follow these steps:
-1. Add [zerops.yml](/java/how-to/build-pipeline#add-zeropsyml-to-your-repository) to your repository.
+1. Add [zerops.yaml](/java/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
2. Connect your GitHub repository or connect your GitLab repository
Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
@@ -35,7 +35,7 @@ Then each time you create a new tag or push to a specific branch, depending on t
:::info
-You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yml` in your repository.
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
:::
### Skip the automatic pipeline once
@@ -61,13 +61,13 @@ To start a new build & deploy pipeline manually, use the Zerops CLI.
Follow these steps:
-1. Add
`zerops.yml` to your repository.
+1. Add
`zerops.yaml` to your repository.
2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
3. Run `zcli push` command.
The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
-The command triggers the [build pipeline](/java/how-to/trigger-pipeline) defined in `zerops.yml`. `zerops.yml` must be in the working directory. The working directory is by default the current directory and can be changed using the
`--workingDir` flag.
+The command triggers the [build pipeline](/java/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
`--workingDir` flag.
zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
@@ -90,14 +90,14 @@ Flags:
command is to be executed.
--versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
--workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
- --zeropsYamlPath string Sets a custom path to the zerops.yml file relative to the working directory. By default zCLI
- looks for zerops.yml in the working directory.
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
```
zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
:::info
-You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yml` in your repository.
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
:::
## Manual deploy using Zerops CLI
@@ -106,7 +106,7 @@ To start only a deploy pipeline, use the Zerops CLI.
Follow these steps:
-1. Add [zerops.yml](/java/how-to/build-pipeline#add-zeropsyml-to-your-repository) to your repository. Omit the build section.
+1. Add [zerops.yaml](/java/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
3. Run `zcli service deploy` command.
@@ -121,8 +121,8 @@ Usage:
Flags:
--archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
to the working directory. By default, no archive is created.
- --deployGitFolder Sets a custom path to the zerops.yml file relative to the working directory. By default zCLI
- looks for zerops.yml in the working directory.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
-h, --help the service deploy command.
--projectId string If you have access to more than one project, you must specify the project ID for which the
command is to be executed.
@@ -130,14 +130,14 @@ Flags:
command is to be executed.
--versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
--workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
- --zeropsYamlPath string Sets a custom path to the zerops.yml file relative to the working directory. By default zCLI
- looks for zerops.yml in the working directory.
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
```
`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
`--workingDir` flag.
-`zerops.yml` must be placed in the working directory.
+`zerops.yaml` must be placed in the working directory.
:::info
-You can change the deploy pipeline when you need to. Just simply modify the `zerops.yml` in your working directory.
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
:::
diff --git a/apps/docs/content/java/how-to/upgrade.mdx b/apps/docs/content/java/how-to/upgrade.mdx
index fc1407182..d5bbe5cd0 100644
--- a/apps/docs/content/java/how-to/upgrade.mdx
+++ b/apps/docs/content/java/how-to/upgrade.mdx
@@ -3,6 +3,6 @@ title: How to upgrade the Java version
description: Learn how to upgrade your java service's version
---
-You can upgrade or downgrade your Java service to a different major Java version by setting the
`run.base` parameter in your `zerops.yml`. When you [trigger a new pipeline](/java/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Java version. If you don't specify the `run.base` attribute in your `zerops.yml`, Zerops keeps the current Java version for your runtime.
+You can upgrade or downgrade your Java service to a different major Java version by setting the
`run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/java/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Java version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Java version for your runtime.
-If you want to build your application with a different major Java version, change the
`build.base` parameter in your `zerops.yml`. The `build.base` is the required attribute.
+If you want to build your application with a different major Java version, change the
`build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
diff --git a/apps/docs/content/java/overview.mdx b/apps/docs/content/java/overview.mdx
index 59c3805fc..26dfe86bd 100644
--- a/apps/docs/content/java/overview.mdx
+++ b/apps/docs/content/java/overview.mdx
@@ -25,9 +25,9 @@ As said, there is no need for coding yet, we have created a [Github repository
1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
-2. In the **Projects** box click on **Import a project** and paste in the following yml config ([source ↗](https://github.com/zeropsio/recipe-java-hello-world/blob/main/import-project/description.yml)):
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-java-hello-world/blob/main/import-project/description.yaml)):
-```yml
+```yaml
project:
name: my-first-project
services:
@@ -98,12 +98,12 @@ Do you have any questions? Check the step-by-step tutorial, browse the documenta
},
{
type: 'link',
- href: '/java/how-to/build-pipeline#add-zeropsyml-to-your-repository',
- label: 'zerops.yml',
+ href: '/java/how-to/build-pipeline#add-zeropsyaml-to-your-repository',
+ label: 'zerops.yaml',
customProps: {
icon: Icons['puzzle'],
description:
- 'See a full example of zerops.yml file to create your own app.',
+ 'See a full example of zerops.yaml file to create your own app.',
},
},
{
@@ -154,7 +154,7 @@ Have you build something that others might find useful? Don't hesitate to share
- sample answer
-
diff --git a/apps/docs/content/keydb/how-to/create.mdx b/apps/docs/content/keydb/how-to/create.mdx
index 3450046cc..2ceeb3f8b 100644
--- a/apps/docs/content/keydb/how-to/create.mdx
+++ b/apps/docs/content/keydb/how-to/create.mdx
@@ -5,6 +5,7 @@ description: Learn how you can create a keydb service in Zerops.
import data from '@site/static/data.json';
import UnorderedList from '@site/src/components/UnorderedList';
+import ResourceTable from '/src/components/ResourceTable';
[KeyDB ↗](https://docs.keydb.dev/) is a fully open source database, backed by Snap, and a faster drop in alternative to Redis.
@@ -101,33 +102,7 @@ Choose the CPU mode when starting a new service or change it later. The CPU mode
Vertical auto scaling has following default configuration:
-
-
-
- Resources Type
- Minimum resource
- Maximum resource
-
-
-
-
- CPU cores
- 1
- 5
-
-
- RAM
- 0.25 GB
- 32 GB
-
-
- Disk
- 1 GB
- 100 GB
-
-
-
-
+
For most cases, the default parameters will work without issues. If you need to limit the cost of the KeyDB service, lower the maximal resources. Zerops will never scale above the selected maximums.
@@ -159,9 +134,9 @@ Zerops uses a yaml format file to describe the project infrastructure.
#### Basic example
-Create a directory `my-project`. Create a `description.yml` file inside the directory with the following content:
+Create a directory `my-project`. Create a `description.yaml` file inside the directory with the following content:
-```yml
+```yaml
# basic project data
project:
# project name
@@ -180,9 +155,9 @@ The yaml file describes your future project infrastructure. The project will con
#### Full example
-Create a directory `my-project`. Create a `description.yml` file inside the directory with the following content:
+Create a directory `my-project`. Create a `description.yaml` file inside the directory with the following content:
-```yml
+```yaml
# basic project data
project:
# project name
@@ -227,7 +202,7 @@ The hostname of the first service will be set to `keydb1`. The [high availabilit
The hostname of the second service will be set to `keydb2`. The [single container](#single-container) mode will be chosen and the default [auto scaling configuration](/keydb/how-to/scale) will be set.
-#### Description of description.yml parameters
+#### Description of description.yaml parameters
The `project:` section is required. Only one project can be defined.
@@ -259,7 +234,7 @@ The `project:` section is required. Only one project can be defined.
-At least one service in `services:` section is required. You can create a project with multiple services. The example above contains only KeyDB services but you can create a `description.yml` with [different types] of services.
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains only KeyDB services but you can create a `description.yaml` with [different types] of services.
@@ -289,7 +264,7 @@ At least one service in `services:` section is required. You can create a projec
Specifies the service type and version.
- See what [KeyDB service types](/references/importyml/type-list#database-services) are currently supported.
+ See what [KeyDB service types](/references/import-yaml/type-list#database-services) are currently supported.
@@ -349,9 +324,9 @@ At least one service in `services:` section is required. You can create a projec
The KeyDB service **hostname** and **mode** are fixed after the service is created. They can't be changed later.
:::
-### Create a project based on the description.yml
+### Create a project based on the description.yaml
-When you have your `description.yml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
```sh
Usage:
@@ -364,11 +339,11 @@ Flags:
--workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
```
-Zerops will create a project and one or more services based on the `description.yml` content.
+Zerops will create a project and one or more services based on the `description.yaml` content.
-Maximum size of the `description.yml` file is 100 kB.
+Maximum size of the `description.yaml` file is 100 kB.
-You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yml`.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
@@ -384,7 +359,7 @@ If you have access to more than one client, you must specify the client ID for w
#### Example
-Create a directory `my-project` if it doesn't exist. Create an `import.yml` file inside the `my-project` directory with following content:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
```bash
# array of project services
@@ -400,9 +375,9 @@ services:
The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one KeyDB service in the [single container mode](#single-container) with default [auto scaling](/keydb/how-to/scale) configuration will be added to your project. Hostname of the new service will be set to `keydb1`.
-The content of the `services:` section of `import.yml` is identical to the [project description file](#create-a-project-description-file). The `import.yml` never contains the `project:` section because the project already exists.
+The content of the `services:` section of `import.yaml` is identical to the [project description file](#create-a-project-description-file). The `import.yaml` never contains the `project:` section because the project already exists.
-When you have your `import.yml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
```sh
Usage:
@@ -416,4 +391,4 @@ Flags:
zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
-Maximum size of the `import.yml` file is 100 kB.
+Maximum size of the `import.yaml` file is 100 kB.
diff --git a/apps/docs/content/keydb/how-to/export-import-data.mdx b/apps/docs/content/keydb/how-to/export-import-data.mdx
deleted file mode 100644
index e69de29bb..000000000
diff --git a/apps/docs/content/keydb/how-to/scale.mdx b/apps/docs/content/keydb/how-to/scale.mdx
index db07359b0..843e15ab6 100644
--- a/apps/docs/content/keydb/how-to/scale.mdx
+++ b/apps/docs/content/keydb/how-to/scale.mdx
@@ -4,6 +4,7 @@ description: Get to know how Zerops scales your keydb service.
---
import Image from '/src/components/Image';
+import ResourceTable from '/src/components/ResourceTable';
Zerops performs an automated scaling of hardware resources required to run your database based on its usage. If the current use of your database does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your database is under heavy load or needs to store more data, then auto scaling increases the resources for the database to make sure it runs smoothly.
@@ -38,33 +39,7 @@ Choose the CPU mode when starting a new service or change it later. The CPU mode
Vertical auto scaling has following default configuration:
-
-
-
- Resources Type
- Minimum resource
- Maximum resource
-
-
-
-
- CPU cores
- 1
- 5
-
-
- RAM
- 0.25 GB
- 32 GB
-
-
- Disk
- 1 GB
- 100 GB
-
-
-
-
+
For most cases, the default parameters will work without issues. If you need to limit the cost of the KeyDB service, lower the maximal resources. Zerops will never scale above the selected maximums.
@@ -128,7 +103,7 @@ Zerops monitors CPU, RAM and Disk usage in all running containers each 10 second
The **scale up threshold** is derived from following **minimum free resources**:
- 0.1 CPU core
-- 0.25 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 62.5 MB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
- 0.5 GB disk
If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
@@ -138,7 +113,7 @@ The scale up of RAM or disk is immediate. The scale up of CPU is configured to b
The **minimum step** for the vertical scaling is
- 1 CPU core
-- 0.25 GB RAM
+- 0.125 GB RAM
- 0.5 GB disk
When the database is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
diff --git a/apps/docs/content/keydb/overview.mdx b/apps/docs/content/keydb/overview.mdx
index d641c2567..6256cc69e 100644
--- a/apps/docs/content/keydb/overview.mdx
+++ b/apps/docs/content/keydb/overview.mdx
@@ -1,4 +1,112 @@
---
title: KeyDB overview
-description: Learn about working with KeyDB with ease on Zerops.
----
\ No newline at end of file
+description: Learn about working with KeyDB on Zerops.
+---
+
+import DocCardList from '@theme/DocCardList';
+import Icons from '@theme/Icon';
+import LargeCardList from '@site/src/components/LargeCardList';
+import LargeCard from '@site/src/components/LargeCard';
+
+[KeyDB ↗](https://docs.keydb.dev/) is a fully open source database, a faster drop-in alternative to Redis. It offers enhanced performance, multithreading capabilities, and maintains full compatibility with Redis clients and APIs.
+
+:::important
+While KeyDB is available on Zerops, please note that KeyDB development has not been very active recently. For new Redis-compatible deployments, we recommend considering [Valkey](/valkey/overview) as the preferred alternative due to its active development and ongoing support.
+:::
+
+## Feature Highlights
+
+
+
+### Connect to KeyDB service
+
+
+
+## Popular Guides
+
+
+
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
\ No newline at end of file
diff --git a/apps/docs/content/keydb/reference/cli.mdx b/apps/docs/content/keydb/reference/cli.mdx
deleted file mode 100644
index e69de29bb..000000000
diff --git a/apps/docs/content/keydb/reference/import.mdx b/apps/docs/content/keydb/reference/import.mdx
deleted file mode 100644
index e69de29bb..000000000
diff --git a/apps/docs/content/mariadb/faq.mdx b/apps/docs/content/mariadb/faq.mdx
deleted file mode 100644
index 23f235534..000000000
--- a/apps/docs/content/mariadb/faq.mdx
+++ /dev/null
@@ -1,10 +0,0 @@
----
-title: Frequently Asked Questions
-description: Get quick answers to your related questions about MariaDb from frequently asked questions by people at Zerops.
----
-
-import { FAQ, FAQItem } from '/src/components/Faq';
-
-
- sample answer
-
diff --git a/apps/docs/content/mariadb/how-to/create.mdx b/apps/docs/content/mariadb/how-to/create.mdx
index 5f1bdd97c..db60287db 100644
--- a/apps/docs/content/mariadb/how-to/create.mdx
+++ b/apps/docs/content/mariadb/how-to/create.mdx
@@ -7,6 +7,7 @@ import Image from '/src/components/Image';
import Video from '@site/src/components/Video';
import data from '@site/static/data.json';
import UnorderedList from '@site/src/components/UnorderedList';
+import ResourceTable from '/src/components/ResourceTable';
MariaDB is the open source relational database loved by developers all over the world. Created by MySQL’s original developers, MariaDB is compatible with MySQL and guaranteed to stay open source forever.
@@ -109,6 +110,12 @@ Choose the CPU mode when starting a new service or change it later. The CPU mode
Vertical auto scaling has following default configuration:
+
+
@@ -166,9 +173,9 @@ Zerops uses a yaml format file to describe the project infrastructure.
#### Basic example
-Create a directory `my-project`. Create a `description.yml` file inside the directory with the following content:
+Create a directory `my-project`. Create a `description.yaml` file inside the directory with the following content:
-```yml
+```yaml
# basic project data
project:
# project name
@@ -187,9 +194,9 @@ The yaml file describes your future project infrastructure. The project will con
#### Full example
-Create a directory `my-project`. Create a `description.yml` file inside the directory with the following content:
+Create a directory `my-project`. Create a `description.yaml` file inside the directory with the following content:
-```yml
+```yaml
# basic project data
project:
# project name
@@ -234,7 +241,7 @@ The hostname of the first service will be set to `mariadb1`. The [high availabil
The hostname of the second service will be set to `mariadb2`. The [single container](#single-container) mode will be chosen and the default [auto scaling configuration](/mariadb/how-to/scale) will be set.
-#### Description of description.yml parameters
+#### Description of description.yaml parameters
The `project:` section is required. Only one project can be defined.
@@ -266,7 +273,7 @@ The `project:` section is required. Only one project can be defined.
-At least one service in `services:` section is required. You can create a project with multiple services. The example above contains only MariaDB services but you can create a `description.yml` with [different types] of services.
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains only MariaDB services but you can create a `description.yaml` with [different types] of services.
@@ -292,7 +299,7 @@ At least one service in `services:` section is required. You can create a projec
type
Specifies the service type and version.
- See what [MariaDB service types](/references/importyml/type-list#database-services) are currently supported.
+ See what [MariaDB service types](/references/import-yaml/type-list#database-services) are currently supported.
@@ -360,9 +367,9 @@ At least one service in `services:` section is required. You can create a projec
The MariaDB service **hostname** and **mode** are fixed after the service is created. They can't be changed later.
:::
-### Create a project based on the description.yml
+### Create a project based on the description.yaml
-When you have your `description.yml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
```sh
Usage:
@@ -375,11 +382,11 @@ Flags:
--workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
```
-Zerops will create a project and one or more services based on the `description.yml` content.
+Zerops will create a project and one or more services based on the `description.yaml` content.
-Maximum size of the `description.yml` file is 100 kB.
+Maximum size of the `description.yaml` file is 100 kB.
-You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yml`.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
@@ -396,7 +403,7 @@ If you have access to more than one client, you must specify the client ID for w
#### Example
-Create a directory `my-project` if it doesn't exist. Create an `import.yml` file inside the `my-project` directory with following content:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
```bash
# array of project services
@@ -412,9 +419,9 @@ services:
The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one MariaDB 10.4 service in the [single container mode](#single-container) with default [auto scaling](/mariadb/how-to/scale) configuration will be added to your project. Hostname of the new service will be set to `mariadb1`.
-The content of the `services:` section of `import.yml` is identical to the [project description file](#create-a-project-description-file). The `import.yml` never contains the `project:` section because the project already exists.
+The content of the `services:` section of `import.yaml` is identical to the [project description file](#create-a-project-description-file). The `import.yaml` never contains the `project:` section because the project already exists.
-When you have your `import.yml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
```sh
Usage:
@@ -428,4 +435,4 @@ Flags:
zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
-Maximum size of the `import.yml` file is 100 kB.
+Maximum size of the `import.yaml` file is 100 kB.
diff --git a/apps/docs/content/mariadb/how-to/manage.mdx b/apps/docs/content/mariadb/how-to/manage.mdx
index 02e1c8428..d56604f78 100644
--- a/apps/docs/content/mariadb/how-to/manage.mdx
+++ b/apps/docs/content/mariadb/how-to/manage.mdx
@@ -29,7 +29,7 @@ To install Adminer into your project, open your project in Zerops GUI and select
Copy the following yaml file into the text area and start the import:
-```yml
+```yaml
services:
- # Service will be accessible through zCLI VPN under: http://adminer
hostname: adminer
@@ -79,7 +79,7 @@ To install phpMyAdmin into your project, open your project in Zerops GUI and sel
Copy the following yaml file into the text area and start the import:
-```yml
+```yaml
services:
- # Service will be accessible through zCLI VPN under: http://phpmyadmin
hostname: phpmyadmin
diff --git a/apps/docs/content/mariadb/how-to/scale.mdx b/apps/docs/content/mariadb/how-to/scale.mdx
index aa3054039..6ba09e5da 100644
--- a/apps/docs/content/mariadb/how-to/scale.mdx
+++ b/apps/docs/content/mariadb/how-to/scale.mdx
@@ -4,6 +4,7 @@ description: Get to know how Zerops scales your mariadb service.
---
import Image from '/src/components/Image';
+import ResourceTable from '/src/components/ResourceTable';
Zerops performs an automated scaling of hardware resources required to run your database based on its usage. If the current use of your database does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your database is under heavy load or needs to store more data, then auto scaling increases the resources for the database to make sure it runs smoothly.
@@ -38,11 +39,11 @@ Choose the CPU mode when starting a new service or change it later. The CPU mode
Vertical auto scaling has following default configuration:
-| | Minimum resource | Maximum resource |
-| ------------- | ---------------- | ---------------- |
-| **CPU cores** | 1 | 5 |
-| **RAM** | 0.5 GB | 32 GB |
-| **Disk** | 1 GB | 100 GB |
+
For most cases, the default parameters will work without issues. If you need to limit the cost of the MariaDB service, lower the maximal resources. Zerops will never scale above the selected maximums.
@@ -106,7 +107,7 @@ Zerops monitors CPU, RAM and Disk usage in all running containers each 10 second
The **scale up threshold** is derived from following **minimum free resources**:
- 0.1 CPU core
-- 0.25 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
- 0.5 GB disk
If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
@@ -116,7 +117,7 @@ The scale up of RAM or disk is immediate. The scale up of CPU is configured to b
The **minimum step** for the vertical scaling is
- 1 CPU core
-- 0.25 GB RAM
+- 0.125 GB RAM
- 0.5 GB disk
When the database is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
diff --git a/apps/docs/content/mariadb/overview.mdx b/apps/docs/content/mariadb/overview.mdx
index 9597755ba..0c5a9ea3a 100644
--- a/apps/docs/content/mariadb/overview.mdx
+++ b/apps/docs/content/mariadb/overview.mdx
@@ -112,7 +112,7 @@ Have you build something that others might find useful? Don't hesitate to share
+
+Import configuration version:
+
+
+## Service Configuration
+
+Our NATS implementation features optimized default settings designed for common use cases.
+
+**Key configuration aspects** include:
+- Standard protocol port `4222` for client connections
+- HTTP monitoring interface `8222` for management
+- Secure authentication with automatically generated credentials
+- Optimized settings for performance and reliability
+
+You can fine-tune your NATS service by adjusting **environment variables**:
+
+### Available Configuration Options
+
+:::note
+If certain variables are not visible in your configuration, they may have been introduced after your service was created. Simply add them as [secret variables](/features/env-variables#2-secret-variables) to access the functionality.
+:::
+
+
+
+
+ Variable
+ Description
+
+
+
+
+ MAX_PAYLOAD
+ Defines the maximum allowed message size for all NATS traffic. Default: 8MB
, Maximum: 64MB
. See NATS limits documentation for details.
+
+
+ JET_STREAM_ENABLED
+ Controls whether JetStream functionality is enabled. Default: 1
(enabled), Set to 0
to disable. See JetStream Configuration section below for more details.
+
+
+
+
+:::important
+Configuration changes require a service **restart** to take effect. While NATS itself supports configuration hot-reload, this feature will be implemented in a future Zerops update.
+:::
+
+After restarting, check your service logs to confirm the changes were applied successfully.
+
+### JetStream Configuration
+
+The service includes [JetStream](https://docs.nats.io/nats-concepts/jetstream) functionality **enabled by default**, providing persistent storage capabilities for your messaging workloads:
+- **Memory store**: Up to 40GB for high-performance message caching
+- **File store**: Up to 250GB for persistent storage
+- **Regular sync intervals**: Ensures data durability and consistency
+
+:::note
+In HA deployments, data persistence is further enhanced with 1-minute sync intervals across all nodes, ensuring robust data durability and high availability.
+:::
+
+This configuration provides a robust foundation for message persistence while balancing performance and reliability.
+
+:::tip
+Disabling JetStream can reduce resource utilization for applications that don't require message persistence.
+:::
+
+### Deployment Modes
+
+:::warning
+Deployment mode is selected during service creation and cannot be changed later.
+:::
+
+#### Non-HA Mode
+- Suitable for development and testing
+- Data persistence not guaranteed during node failures
+- Lower resource requirements
+
+#### HA Mode
+- Creates a multi-node NATS cluster
+- Configures routes between cluster nodes automatically
+- Implements [NATS clustering](https://docs.nats.io/running-a-nats-service/configuration/clustering) for high availability
+- Provides improved reliability compared to non-HA deployments
+
+### Authentication Management
+
+Authentication credentials are automatically generated and managed by the platform. The system creates a default user (`zerops`) with a secure 16-character password. You can access these credentials through:
+- The service access details in the Zerops GUI
+- Environment variables in your service configuration:
+ - `user` - Username for authentication (default: "zerops")
+ - `password` - Generated secure password
+ - `connectionString` - Complete connection string in the format `nats://${dbUser}:${dbPassword}@${hostname}:${port}`
+
+## Health Monitoring
+
+Zerops continuously monitors your NATS service health using built-in health checks:
+
+- **HTTP Health Check**: The system checks the `/healthz` endpoint at port 8222
+- **Self-Healing**: The platform automatically recovers unhealthy nodes when issues are detected
+
+### Health Status
+
+You can check the health status of your NATS service:
+
+1. Through the Zerops GUI dashboard
+2. By accessing the management interface at port `8222`
+
+## Backup and Recovery
+
+Zerops provides built-in backup functionality for your NATS JetStream data, ensuring your message streams and configurations can be safely preserved and restored when needed.
+
+### Backup Process
+
+Backups are created in `.tar.gz` format using the `nats` backup command. They are saved to local disk, compressed, streamed to backup storage, and then deleted locally.
+
+For general information about backup frequency and storage limits, see our [Backup documentation](/features/backup).
+
+## Support
+
+For advanced configurations or custom requirements:
+- Join our [Discord community](https://discord.gg/zerops)
+- Contact support via [email](mailto:support@zerops.io)
\ No newline at end of file
diff --git a/apps/docs/content/nginx/how-to/access.mdx b/apps/docs/content/nginx/how-to/access.mdx
index f8a1c0a58..fe84265b9 100644
--- a/apps/docs/content/nginx/how-to/access.mdx
+++ b/apps/docs/content/nginx/how-to/access.mdx
@@ -55,7 +55,7 @@ Use the `ssh` command to connect to your service v
## Public access through zerops.io subdomain
-By default, your Nginx static service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zeropsapp-subdomain).
+By default, your Nginx static service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
## Public access through your domain
@@ -63,4 +63,4 @@ By default, your Nginx static service is not publicly accessible. When your appl
## Public access from another Zerops project
-All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/nginx/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zeropsapp-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/nginx/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
diff --git a/apps/docs/content/nginx/how-to/build-pipeline.mdx b/apps/docs/content/nginx/how-to/build-pipeline.mdx
index 5cfce5caa..105a3c29d 100644
--- a/apps/docs/content/nginx/how-to/build-pipeline.mdx
+++ b/apps/docs/content/nginx/how-to/build-pipeline.mdx
@@ -26,11 +26,11 @@ Zerops supports different build environments:
If you just need to deploy your static content, use the [manual deploy](/nginx/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) via Zerops CLI.
-## Add zerops.yml to your repository
+## Add zerops.yaml to your repository
-Start by adding `zerops.yml` file to the **root of your repository** and modify it to fit your application:
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
@@ -95,9 +95,9 @@ The top-level element is always `zerops`.
### Setup
The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
-Zerops supports the definition of multiple runtime services in a single `zerops.yml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yml`:
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
-```yml
+```yaml
zerops:
# definition for app service
- setup: app
@@ -123,7 +123,7 @@ Following options are available for Nginx builds:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -146,12 +146,12 @@ zerops:
:::info
-You can change the base environment when you need to. Just simply modify the `zerops.yml` in your repository.
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
:::
If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -171,7 +171,7 @@ zerops:
...
```
-See the full list of supported [run base environments](/zerops-yml/base-list).
+See the full list of supported [run base environments](/zerops-yaml/base-list).
To customize your build environment use the `prepareCommands` attribute.
@@ -250,7 +250,7 @@ _OPTIONAL._ Customizes the Nginx runtime environment by installing additional de
additional packages or tools add one or more prepare commands:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -311,14 +311,14 @@ You can configure your prepare commands to be run in a single shell instance or
The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the build section of your chosen technology.
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
# ==== how to build your application ====
build:
...
- addToRunPrepare: ./runtime-config.yml
+ addToRunPrepare: ./runtime-config.yaml
# ==== how to run your application ====
run:
@@ -330,13 +330,13 @@ zerops:
...
```
-In the example above Zerops will copy the `runtime-config.yml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
### initCommands
_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -381,7 +381,7 @@ By default, the document root is configured to `/var/www`.
Customize the folder that will be used as the root of the publicly accessible web server content. Enter the path relative to the `/var/www` folder.
E.g. `documentRoot: public` will set the web server document root to `/var/www/public`.
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -412,7 +412,7 @@ _OPTIONAL._ Defines the environment variables for the runtime environment.
Enter one or more env variables in following format:
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
@@ -449,7 +449,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -498,7 +498,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -545,7 +545,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -593,7 +593,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
diff --git a/apps/docs/content/nginx/how-to/create.mdx b/apps/docs/content/nginx/how-to/create.mdx
index fcd27efeb..239fca9df 100644
--- a/apps/docs/content/nginx/how-to/create.mdx
+++ b/apps/docs/content/nginx/how-to/create.mdx
@@ -7,6 +7,7 @@ import Image from '/src/components/Image';
import data from '@site/static/data.json';
import UnorderedList from '@site/src/components/UnorderedList';
import Video from '@site/src/components/Video';
+import ResourceTable from '/src/components/ResourceTable';
The Nginx static service contains the Nginx web server optimized for your static content. Nginx static service is highly scalable and customisable to suit both development and production.
@@ -81,33 +82,7 @@ Choose the CPU mode when starting a new service or change it later. The CPU mode
Vertical auto scaling has following default configuration:
-
-
-
- Resources Type
- Minimum resource
- Maximum resource
-
-
-
-
- CPU cores
- 1
- 5
-
-
- RAM
- 0.25 GB
- 32 GB
-
-
- Disk
- 1 GB
- 100 GB
-
-
-
-
+
Nginx static service always starts with the minimal resources.
@@ -182,7 +157,7 @@ Zerops uses a yaml format to describe the project infrastructure.
#### Basic example:
-Create a directory `my-project`. Create an `description.yml` file inside the `my-project` directory with following content:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
```yaml
# basic project data
@@ -205,7 +180,7 @@ services:
S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
```
-The yaml file describes your future project infrastructure. The project will contain one Nginx version 8.1 service with default [auto scaling](/nginx/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yml](/nginx/how-to/build-pipeline#ports). Following secret env variables will be configured:
+The yaml file describes your future project infrastructure. The project will contain one Nginx version 8.1 service with default [auto scaling](/nginx/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/nginx/how-to/build-pipeline#ports). Following secret env variables will be configured:
```env
S3_ACCESS_KEY_ID="P8cX1vVVb"
@@ -214,7 +189,7 @@ S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
#### Full example:
-Create a directory my-project. Create an description.yml file inside the my-project directory with following content:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
```yaml
# basic project data
@@ -255,14 +230,14 @@ services:
S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
```
-The yaml file describes your future project infrastructure. The project will contain an Nginx static service with `app` hostname. The internal port(s) the service listens on will be defined later in the [zerops.yml](/nginx/how-to/build-pipeline#ports). Nginx static service will run on version 1.22 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+The yaml file describes your future project infrastructure. The project will contain an Nginx static service with `app` hostname. The internal port(s) the service listens on will be defined later in the [zerops.yaml](/nginx/how-to/build-pipeline#ports). Nginx static service will run on version 1.22 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
```env
S3_ACCESS_KEY_ID="P8cX1vVVb"
S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
```
-#### Description of description.yml parameters
+#### Description of description.yaml parameters
The `project:` section is required. Only one project can be defined.
@@ -294,7 +269,7 @@ The `project:` section is required. Only one project can be defined.
-At least one service in `services:` section is required. You can create a project with multiple services. The example above contains an Nginx static service but you can create a `description.yml` with your own combination of [services](/features/infrastructure).
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains an Nginx static service but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
@@ -324,7 +299,7 @@ At least one service in `services:` section is required. You can create a projec
Specifies the service type and version.
- See what [nginx service types](/references/importyml/type-list#runtime-services) are currently supported.
+ See what [nginx service types](/references/import-yaml/type-list#runtime-services) are currently supported.
@@ -406,9 +381,9 @@ At least one service in `services:` section is required. You can create a projec
-### Create a project based on the description.yml
+### Create a project based on the description.yaml
-When you have your `description.yml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
```sh
Usage:
@@ -421,11 +396,11 @@ Flags:
--workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
```
-Zerops will create a project and one or more services based on the `description.yml` content.
+Zerops will create a project and one or more services based on the `description.yaml` content.
-Maximum size of the `description.yml` file is 100 kB.
+Maximum size of the `description.yaml` file is 100 kB.
-You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yml`.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
@@ -442,7 +417,7 @@ If you have access to more than one client, you must specify the client ID for w
#### Example:
-Create a directory `my-project` if it doesn't exist. Create an `import.yml` file inside the `my-project` directory with following content:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
```yaml
# basic project data
@@ -472,9 +447,9 @@ S3_ACCESS_KEY_ID="P8cX1vVVb"
S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
```
-The content of the `services:` section of `import.yml` is identical to the project description file. The `import.yml` never contains the `project:` section because the project already exists.
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
-When you have your `import.yml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
```sh
Usage:
@@ -488,4 +463,4 @@ Flags:
zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
-Maximum size of the import.yml file is 100 kB.
+Maximum size of the import.yaml file is 100 kB.
diff --git a/apps/docs/content/nginx/how-to/customize-runtime.mdx b/apps/docs/content/nginx/how-to/customize-runtime.mdx
index a5e1b502b..e6338b809 100644
--- a/apps/docs/content/nginx/how-to/customize-runtime.mdx
+++ b/apps/docs/content/nginx/how-to/customize-runtime.mdx
@@ -22,9 +22,9 @@ The default Nginx runtime environment contains:
- Git and Composer
:::note
-To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yml/specification#os--1) attribute.
+To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yaml/specification#os--1) attribute.
-Additional packages and tools can be installed using [run.prepareCommands](/zerops-yml/specification#preparecommands--1).
+Additional packages and tools can be installed using [run.prepareCommands](/zerops-yaml/specification#preparecommands--1).
:::
### Runtime Flow
diff --git a/apps/docs/content/nginx/how-to/customize-web-server.mdx b/apps/docs/content/nginx/how-to/customize-web-server.mdx
index fa4748120..dfb9988b2 100644
--- a/apps/docs/content/nginx/how-to/customize-web-server.mdx
+++ b/apps/docs/content/nginx/how-to/customize-web-server.mdx
@@ -26,7 +26,7 @@ server {
The configuration contains 2 variables:
-- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yml`. If the attribute is not specified, the default value `/var/www` is used.
+- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yaml`. If the attribute is not specified, the default value `/var/www` is used.
## Customize Nginx configuration
@@ -36,7 +36,7 @@ Follow these steps to customize the Nginx configuration in Nginx static service:
2. Optionally use following variables:
-- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yml`. If the attribute is not specified, the default value `/var/www` is used.
+- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yaml`. If the attribute is not specified, the default value `/var/www` is used.
Example:
@@ -44,7 +44,7 @@ Example:
root {{.DocumentRoot}};
```
-- **`{{.Environment.ENV_NAME}}`** is replaced by the [env variable](/nginx/how-to/env-variables) value. The env variable must be either defined in [run.envVariables](/nginx/how-to/build-pipeline#envvariables) in `zerops.yml` or set as a [secret](/nginx/how-to/env-variables#set-secret-env-variables-in-zerops-gui) or [generated](/nginx/how-to/env-variables#generated-env-variables) env variable in Zerops GUI.
+- **`{{.Environment.ENV_NAME}}`** is replaced by the [env variable](/nginx/how-to/env-variables) value. The env variable must be either defined in [run.envVariables](/nginx/how-to/build-pipeline#envvariables) in `zerops.yaml` or set as a [secret](/nginx/how-to/env-variables#set-secret-env-variables-in-zerops-gui) or [generated](/nginx/how-to/env-variables#generated-env-variables) env variable in Zerops GUI.
:::caution
Use the **.tmpl** file extension to make Zerops interpret the file as a template. Zerops will replace the supported variables listed above.
@@ -53,12 +53,12 @@ Use the **.tmpl** file extension to make Zerops interpret the file as a template
3. Check that your Nginx configuration is consistent with Zerops requirements:
- Do not use IP addresses in the `listen` directive
-- If you use other ports than `:80` in the `listen` directive, add them to the `run.ports` in your `zerops.yml` as well.
+- If you use other ports than `:80` in the `listen` directive, add them to the `run.ports` in your `zerops.yaml` as well.
- Do not use the port **:443**. All the incoming `https://` traffic is terminated on the Zerops internal balancer where the SSL certificate is installed and the request is forwarded to your Nginx static service as a **http://** on the port **:80**.
-4. Add the `siteConfigPath` to the run section of your `zerops.yml`
+4. Add the `siteConfigPath` to the run section of your `zerops.yaml`
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
diff --git a/apps/docs/content/nginx/how-to/deploy-process.mdx b/apps/docs/content/nginx/how-to/deploy-process.mdx
index 35a54cc90..4506db6e4 100644
--- a/apps/docs/content/nginx/how-to/deploy-process.mdx
+++ b/apps/docs/content/nginx/how-to/deploy-process.mdx
@@ -38,7 +38,7 @@ Zerops performs following actions for each new container:
Services with multiple containers are deployed in parallel.
:::info
-If your application needs to be initialized in each runtime container, add [init commands](/nginx/how-to/build-pipeline#initcommands) to `zerops.yml`.
+If your application needs to be initialized in each runtime container, add [init commands](/nginx/how-to/build-pipeline#initcommands) to `zerops.yaml`.
:::
:::caution
@@ -56,7 +56,7 @@ The old containers are then removed from the project balancer so they don't rece
## Readiness checks
-If your application isn't ready as soon as it is started, configure a [readiness check](/nginx/how-to/build-pipeline#readiness-check) in your `zerops.yml`.
+If your application isn't ready as soon as it is started, configure a [readiness check](/nginx/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
If the readiness check is defined, Zerops will:
@@ -92,7 +92,7 @@ The list of application versions is available in Zerops GUI. Go to the service d
The pipeline detail is accessible from the additional menu. The pipeline detail contains
-- The pipeline config (`zerops.yml`) that was used for the selected version
+- The pipeline config (`zerops.yaml`) that was used for the selected version
- The build log (if available)
- The prepare runtime log (if available)
diff --git a/apps/docs/content/nginx/how-to/env-variables.mdx b/apps/docs/content/nginx/how-to/env-variables.mdx
index a6d396ec5..b29e27ed9 100644
--- a/apps/docs/content/nginx/how-to/env-variables.mdx
+++ b/apps/docs/content/nginx/how-to/env-variables.mdx
@@ -23,12 +23,12 @@ There are 3 different sets of env variables in Zerops:
basic
build
- zerops.yml
+ zerops.yaml
basic
runtime
- zerops.yml
+ zerops.yaml
secret
@@ -41,13 +41,13 @@ There are 3 different sets of env variables in Zerops:
Use the [secret env variables](/nginx/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
-The basic build and runtime env variables are listed in your [zerops.yml](/zerops-yml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yml and redeploy your application to Zerops.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
You can [reference](/nginx/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/nginx/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
## Set secret env variables in Zerops GUI
-Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yml.
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
-
-
- Resources Type
- Minimum resource
- Maximum resource
-
-
-
-
- CPU cores
- 1
- 5
-
-
- RAM
- 0.25 GB
- 32 GB
-
-
- Disk
- 1 GB
- 100 GB
-
-
-
-
+
Nginx static service always starts with the minimal resources.
@@ -197,7 +172,7 @@ Zerops monitors CPU, RAM and Disk usage in all running containers each 10 second
The **scale up threshold** is derived from following **minimum free resources**:
- 0.1 CPU core
-- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 62.5 MB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
- 0.5 GB disk
If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
@@ -207,7 +182,7 @@ The scale up of RAM or disk is immediate. The scale up of CPU is configured to b
The **minimum step** for the vertical scaling is
- 1 CPU core
-- 0.25 GB RAM
+- 0.125 GB RAM
- 0.5 GB disk
When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
diff --git a/apps/docs/content/nginx/how-to/shared-storage.mdx b/apps/docs/content/nginx/how-to/shared-storage.mdx
index 1266d4c2f..829037485 100644
--- a/apps/docs/content/nginx/how-to/shared-storage.mdx
+++ b/apps/docs/content/nginx/how-to/shared-storage.mdx
@@ -37,15 +37,15 @@ zCLI is the Zerops command-line tool. To create a new Nginx static service via t
Zerops uses a yaml format to describe the project infrastructure.
-#### description.yml format
+#### description.yaml format
-[Read the basics](/nginx/how-to/create#create-a-project-description-file) how to define the Nginx static service using the description.yml.
+[Read the basics](/nginx/how-to/create#create-a-project-description-file) how to define the Nginx static service using the description.yaml.
#### Example with a shared storage
-Create a directory `my-project`. Create an `description.yml` file inside the `my-project` directory with following content:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
-```yml
+```yaml
# basic project data
project:
# project name
@@ -91,4 +91,4 @@ The mount attribute accepts an array of shared storage names you want to mount t
### Create a project with Nginx static service and a shared storage
-Follow the article [How to create a project based on the description.yml](/nginx/how-to/create#create-a-project-based-on-the-descriptionyml).
+Follow the article [How to create a project based on the description.yaml](/nginx/how-to/create#create-a-project-based-on-the-descriptionyaml).
diff --git a/apps/docs/content/nginx/how-to/trigger-pipeline.mdx b/apps/docs/content/nginx/how-to/trigger-pipeline.mdx
index f58a45069..1a2531ddb 100644
--- a/apps/docs/content/nginx/how-to/trigger-pipeline.mdx
+++ b/apps/docs/content/nginx/how-to/trigger-pipeline.mdx
@@ -20,7 +20,7 @@ Integrate Zerops to your GitHub or GitLab repository and configure the automatic
Follow these steps:
-1. Add [zerops.yml](/nginx/how-to/build-pipeline#add-zeropsyml-to-your-repository) to your repository.
+1. Add [zerops.yaml](/nginx/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
2. Connect your GitHub repository or connect your GitLab repository
Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
@@ -35,7 +35,7 @@ Then each time you create a new tag or push to a specific branch, depending on t
:::info
-You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yml` in your repository.
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
:::
### Skip the automatic pipeline once
@@ -61,13 +61,13 @@ To start a new build & deploy pipeline manually, use the Zerops CLI.
Follow these steps:
-1. Add `zerops.yml` to your repository.
+1. Add `zerops.yaml` to your repository.
2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
3. Run `zcli push` command.
The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
-The command triggers the [build pipeline](/nginx/how-to/trigger-pipeline) defined in `zerops.yml`. `zerops.yml` must be in the working directory. The working directory is by default the current directory and can be changed using the `--workingDir` flag.
+The command triggers the [build pipeline](/nginx/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the `--workingDir` flag.
zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
@@ -90,14 +90,14 @@ Flags:
command is to be executed.
--versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
--workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
- --zeropsYamlPath string Sets a custom path to the zerops.yml file relative to the working directory. By default zCLI
- looks for zerops.yml in the working directory.
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
```
zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
:::info
-You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yml` in your repository.
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
:::
## Manual deploy using Zerops CLI
@@ -106,7 +106,7 @@ To start only a deploy pipeline, use the Zerops CLI.
Follow these steps:
-1. Add [zerops.yml](/nginx/how-to/build-pipeline#add-zeropsyml-to-your-repository) to your repository. Omit the build section.
+1. Add [zerops.yaml](/nginx/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
3. Run `zcli service deploy` command.
@@ -121,8 +121,8 @@ Usage:
Flags:
--archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
to the working directory. By default, no archive is created.
- --deployGitFolder Sets a custom path to the zerops.yml file relative to the working directory. By default zCLI
- looks for zerops.yml in the working directory.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
-h, --help the service deploy command.
--projectId string If you have access to more than one project, you must specify the project ID for which the
command is to be executed.
@@ -130,14 +130,14 @@ Flags:
command is to be executed.
--versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
--workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
- --zeropsYamlPath string Sets a custom path to the zerops.yml file relative to the working directory. By default zCLI
- looks for zerops.yml in the working directory.
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
```
`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the `--workingDir` flag.
-`zerops.yml` must be placed in the working directory.
+`zerops.yaml` must be placed in the working directory.
:::info
-You can change the deploy pipeline when you need to. Just simply modify the `zerops.yml` in your working directory.
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
:::
diff --git a/apps/docs/content/nginx/how-to/upgrade.mdx b/apps/docs/content/nginx/how-to/upgrade.mdx
index 2b54b24cd..cac7327eb 100644
--- a/apps/docs/content/nginx/how-to/upgrade.mdx
+++ b/apps/docs/content/nginx/how-to/upgrade.mdx
@@ -3,4 +3,4 @@ title: How to upgrade the Nginx version
description: Learn how to upgrade your nginx service's version
---
-You can upgrade or downgrade your Nginx static service to a different major Nginx version by setting the `run.base` parameter in your `zerops.yml`. When you [trigger a new pipeline](/nginx/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Nginx version. If you don't specify the `run.base` attribute in your `zerops.yml`, Zerops keeps the current Nginx version for your runtime.
+You can upgrade or downgrade your Nginx static service to a different major Nginx version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/nginx/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Nginx version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Nginx version for your runtime.
diff --git a/apps/docs/content/nginx/overview.mdx b/apps/docs/content/nginx/overview.mdx
index 346e7153d..6b770f1cb 100644
--- a/apps/docs/content/nginx/overview.mdx
+++ b/apps/docs/content/nginx/overview.mdx
@@ -54,12 +54,12 @@ The Nginx static service contains the [Nginx ↗](https://nginx.org/) web server
},
{
type: 'link',
- href: '/nginx/how-to/build-pipeline#add-zeropsyml-to-your-repository',
- label: 'zerops.yml',
+ href: '/nginx/how-to/build-pipeline#add-zeropsyaml-to-your-repository',
+ label: 'zerops.yaml',
customProps: {
icon: Icons['puzzle'],
description:
- 'See a full example of zerops.yml file to create your own app.',
+ 'See a full example of zerops.yaml file to create your own app.',
},
},
{
@@ -119,7 +119,7 @@ Have you build something that others might find useful? Don't hesitate to share
2. Create a project.
- Learn more about projects in Zerops. See how to
+ Learn more about projects in Zerops. See how to
import a whole project into Zerops.
@@ -31,7 +31,7 @@ In the detail of each step, you can find a link with more information about the
3. In the left menu, click on Import services , copy & paste the
- contents of the `import-services.yml` config file from the recipe
+ contents of the `import-services.yaml` config file from the recipe
repository of your choice. Then click on Import service .
diff --git a/apps/docs/content/nginx/tutorial/step-by-step.mdx b/apps/docs/content/nginx/tutorial/step-by-step.mdx
index 6bae21cd3..858975240 100644
--- a/apps/docs/content/nginx/tutorial/step-by-step.mdx
+++ b/apps/docs/content/nginx/tutorial/step-by-step.mdx
@@ -23,7 +23,7 @@ In the detail of each step, you can find a link with more information about the
2. Create a project.
- Learn more about projects in
+ Learn more about projects in
Zerops. See how to import a whole project into Zerops.
@@ -31,7 +31,7 @@ In the detail of each step, you can find a link with more information about the
3. In the left menu, click on Import services , copy & paste the
- contents of this yaml file and click on Import service .
+ contents of this yaml file and click on Import service .
Learn more about services in Zerops and how to import a service to an existing project.
diff --git a/apps/docs/content/nodejs/faq.mdx b/apps/docs/content/nodejs/faq.mdx
deleted file mode 100644
index 8095ce1d6..000000000
--- a/apps/docs/content/nodejs/faq.mdx
+++ /dev/null
@@ -1,10 +0,0 @@
----
-title: Frequently Asked Questions
-description: Get quick answers to your related questions about Node.js from frequently asked questions by people at Zerops.
----
-
-import { FAQ, FAQItem } from '/src/components/Faq';
-
-
- sample answer
-
diff --git a/apps/docs/content/nodejs/how-to/access.mdx b/apps/docs/content/nodejs/how-to/access.mdx
index 2cfda64c8..6af3ee886 100644
--- a/apps/docs/content/nodejs/how-to/access.mdx
+++ b/apps/docs/content/nodejs/how-to/access.mdx
@@ -55,7 +55,7 @@ Use the `ssh` command to connect to your service v
## Public access through zerops.io subdomain
-By default, your Node.js service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zeropsapp-subdomain).
+By default, your Node.js service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
## Public access through your domain
@@ -63,4 +63,4 @@ By default, your Node.js service is not publicly accessible. When your applicati
## Public access from another Zerops project
-All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/nodejs/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zeropsapp-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/nodejs/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
diff --git a/apps/docs/content/nodejs/how-to/build-pipeline.mdx b/apps/docs/content/nodejs/how-to/build-pipeline.mdx
index ed0b7c3c6..0b6981a37 100644
--- a/apps/docs/content/nodejs/how-to/build-pipeline.mdx
+++ b/apps/docs/content/nodejs/how-to/build-pipeline.mdx
@@ -9,11 +9,11 @@ import UnorderedCodeList from 'docs/src/components/UnorderedCodeList';
Zerops provides a customizable build and runtime environment for your Node.js application.
-## Add zerops.yml to your repository
+## Add zerops.yaml to your repository
-Start by adding `zerops.yml` file to the **root of your repository** and modify it to fit your application:
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
@@ -78,9 +78,9 @@ The top-level element is always `zerops`.
### Setup
The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
-Zerops supports the definition of multiple runtime services in a single `zerops.yml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yml`:
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
-```yml
+```yaml
zerops:
# definition for app service
- setup: app
@@ -105,7 +105,7 @@ Following options are available for Node.js builds:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -122,12 +122,12 @@ zerops:
:::info
-You can change the base environment when you need to. Just simply modify the `zerops.yml` in your repository.
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
:::
If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -141,7 +141,7 @@ zerops:
...
```
-See the full list of supported [build base environments](/zerops-yml/base-list#runtime-services).
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
To customize your build environment use the [prepareCommands](/nodejs/how-to/build-pipeline#preparecommands) attribute.
@@ -186,7 +186,7 @@ The base build environment contains:
To install additional packages or tools add one or more prepare commands:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -227,7 +227,7 @@ You can configure your prepare commands to be run in a single shell instance or
_REQUIRED._ Defines build commands.
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -255,7 +255,7 @@ Before the build commands are triggered the build container contains:
Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it.
-```yml
+```yaml
buildCommands:
- |
npm i
@@ -266,7 +266,7 @@ buildCommands:
When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command.
-```yml
+```yaml
buildCommands:
- npm i
- npm run build
@@ -276,7 +276,7 @@ buildCommands:
If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/nodejs/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the --verbose option.
-```yml
+```yaml
buildCommands:
- npm i --verbose
- npm run build
@@ -288,7 +288,7 @@ If the command ends successfully, it returns the exit code 0 and Zerops triggers
_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
-```yml
+```yaml
# REQUIRED. Select which files / folders to deploy after
# the build has successfully finished
deployFiles:
@@ -299,7 +299,7 @@ deployFiles:
Determines files or folders produced by your build, which should be deployed to your runtime service containers.
-The path starts from the **root directory** of your project (the location of `zerops.yml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
@@ -307,7 +307,7 @@ The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/
Deploys a folder, and a file from the project root directory:
-```yml
+```yaml
deployFiles:
- dist
- package.json
@@ -315,13 +315,13 @@ deployFiles:
Deploys the whole content of the build container:
-```yml
+```yaml
deployFiles: .
```
Deploys a folder, and a file in a defined path:
-```yml
+```yaml
deployFiles:
- ./path/to/file.txt
- ./path/to/dir/
@@ -333,19 +333,19 @@ Zerops supports the `~` character as a wildcard for one or more folders in the p
Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
-```yml
+```yaml
deployFiles: ./path/~/to/file.txt
```
Deploys all folders that are located in any path that begins with `/path/to/`
-```yml
+```yaml
deployFiles: ./path/to/~/
```
Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
-```yml
+```yaml
deployFiles: ./path/~/to/
```
@@ -364,7 +364,7 @@ For consistency, it's recommended to configure both your `.gitignore` and `.depl
Examples:
-```yml title="zerops.yml"
+```yaml title="zerops.yaml"
zerops:
- setup: app
build:
@@ -391,7 +391,7 @@ This example above ignores `file.txt` in ANY directory named `src`, such as:
_OPTIONAL._ Defines which files or folders will be cached for the next build.
-```yml
+```yaml
# OPTIONAL. Which files / folders you want to cache for the next build.
# Next builds will be faster when the cache is used.
cache: file.txt
@@ -409,7 +409,7 @@ _OPTIONAL._ Defines the environment variables for the build environment.
Enter one or more env variables in following format:
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
@@ -440,7 +440,7 @@ Following options are available for Node.js builds:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -463,12 +463,12 @@ zerops:
:::info
-You can change the base environment when you need to. Just simply modify the `zerops.yml` in your repository.
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
:::
If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -488,7 +488,7 @@ zerops:
...
```
-See the full list of supported [run base environments](/zerops-yml/base-list).
+See the full list of supported [run base environments](/zerops-yaml/base-list).
To customize your build environment use the `prepareCommands` attribute.
@@ -555,7 +555,7 @@ _OPTIONAL._ Customises the Node.js runtime environment by installing additional
additional packages or tools add one or more prepare commands:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -609,14 +609,14 @@ You can configure your prepare commands to be run in a single shell instance or
The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
# ==== how to build your application ====
build:
...
- addToRunPrepare: ./runtime-config.yml
+ addToRunPrepare: ./runtime-config.yaml
# ==== how to run your application ====
run:
@@ -628,13 +628,13 @@ zerops:
...
```
-In the example above Zerops will copy the `runtime-config.yml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
### initCommands
_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -674,7 +674,7 @@ _OPTIONAL._ Defines the environment variables for the runtime environment.
Enter one or more env variables in following format:
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
@@ -695,7 +695,7 @@ Read more about [environment variables](/nodejs/how-to/env-variables) in Zerops.
_REQUIRED._ Defines the start command for your Node.js application.
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -731,7 +731,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -779,7 +779,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -808,7 +808,7 @@ _OPTIONAL._ Defines cron jobs.
Setup cron jobs in the following format:
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
@@ -847,7 +847,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -895,7 +895,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
diff --git a/apps/docs/content/nodejs/how-to/build-process.mdx b/apps/docs/content/nodejs/how-to/build-process.mdx
index 30585ec4f..d3c4f8112 100644
--- a/apps/docs/content/nodejs/how-to/build-process.mdx
+++ b/apps/docs/content/nodejs/how-to/build-process.mdx
@@ -24,9 +24,9 @@ The default NodeJS build environment contains:
- NPM, Yarn, Git and NPX tools
:::note
-To use Ubuntu instead of the default Alpine, set the [build.os](/zerops-yml/specification#os-) attribute.
+To use Ubuntu instead of the default Alpine, set the [build.os](/zerops-yaml/specification#os-) attribute.
-Additional packages and tools can be installed using [build.prepareCommands](/zerops-yml/specification#preparecommands-).
+Additional packages and tools can be installed using [build.prepareCommands](/zerops-yaml/specification#preparecommands-).
:::
@@ -70,11 +70,11 @@ The build cancellation is available before the build pipeline is finished. When
The default Node.js build environment contains:
- {data.alpine.default}
-- selected version of Node.js defined in `zerops.yml` [build.base](/nodejs/how-to/build-pipeline#base) parameter
+- selected version of Node.js defined in `zerops.yaml` [build.base](/nodejs/how-to/build-pipeline#base) parameter
- [zCLI](/references/cli), Zerops command line tool
- `npm`, `yarn`, `git` and `npx` tools
-If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/nodejs/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](/nodejs/how-to/build-pipeline#preparecommands) commands to your `zerops.yml`.
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/nodejs/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](/nodejs/how-to/build-pipeline#preparecommands) commands to your `zerops.yaml`.
:::info
The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
@@ -120,7 +120,7 @@ This will force Zerops to run the next build clean, including all prepare comman
If any [build command](/nodejs/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/nodejs/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `--verbose` option.
-```yml
+```yaml
buildCommands:
- npm i --verbose
- npm run build
diff --git a/apps/docs/content/nodejs/how-to/create.mdx b/apps/docs/content/nodejs/how-to/create.mdx
index f5124b952..7dda722a1 100644
--- a/apps/docs/content/nodejs/how-to/create.mdx
+++ b/apps/docs/content/nodejs/how-to/create.mdx
@@ -7,6 +7,7 @@ import Image from '/src/components/Image';
import data from '@site/static/data.json';
import UnorderedList from '@site/src/components/UnorderedList';
import Video from '@site/src/components/Video';
+import ResourceTable from '/src/components/ResourceTable';
Zerops provides a powerful Node.js runtime service with extensive build support. The Node.js runtime is highly scalable and customizable to suit your development and production needs. With just a few clicks or commands, you can have a production-ready Node.js environment up and running in no time.
@@ -81,32 +82,7 @@ You can choose the CPU mode when starting a new service or change it later. The
Vertical auto scaling has the following default configuration:
-
-
-
- Resources Type
- Minimum resource
- Maximum resource
-
-
-
-
- CPU cores
- 1
- 5
-
-
- RAM
- 0.25 GB
- 32 GB
-
-
- Disk
- 1 GB
- 100 GB
-
-
-
+
Node.js services always start with the minimal resources.
@@ -183,7 +159,7 @@ Zerops uses a YAML format to describe the project infrastructure.
#### Basic example:
-Create a directory called `my-project`. Inside the `my-project` directory, create a `description.yml` file with the following content:
+Create a directory called `my-project`. Inside the `my-project` directory, create a `description.yaml` file with the following content:
```yaml
# basic project data
project:
@@ -205,7 +181,7 @@ services:
S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
```
-The yaml file describes your future project infrastructure. The project will contain one Node.js version 20 service with default [auto scaling](/nodejs/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yml](/nodejs/how-to/build-pipeline#ports). Following secret env variables will be configured:
+The yaml file describes your future project infrastructure. The project will contain one Node.js version 20 service with default [auto scaling](/nodejs/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/nodejs/how-to/build-pipeline#ports). Following secret env variables will be configured:
```env
S3_ACCESS_KEY_ID="P8cX1vVVb"
@@ -214,7 +190,7 @@ S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
#### Full example:
-Create a directory my-project. Create an description.yml file inside the my-project directory with following content:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
```yaml
# basic project data
@@ -263,7 +239,7 @@ services:
The yaml file describes your future project infrastructure. The project will contain a Node.js service and a [PostgreSQL](/postgresql/overview) service.
-Node.js service with "app" hostname, the internal port(s) the service listens on will be defined later in the [zerops.yml](/nodejs/how-to/build-pipeline#ports). Node.js service will run on version 20 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+Node.js service with "app" hostname, the internal port(s) the service listens on will be defined later in the [zerops.yaml](/nodejs/how-to/build-pipeline#ports). Node.js service will run on version 20 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
```env
S3_ACCESS_KEY_ID="P8cX1vVVb"
@@ -272,7 +248,7 @@ S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
-#### Description of description.yml parameters
+#### Description of description.yaml parameters
The `project:` section is required. Only one project can be defined.
@@ -303,7 +279,7 @@ The `project:` section is required. Only one project can be defined.
-At least one service in `services:` section is required. You can create a project with multiple services. The example above contains Node.js and PostgreSQL services but you can create a `description.yml` with your own combination of [services](/features/infrastructure).
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains Node.js and PostgreSQL services but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
@@ -333,7 +309,7 @@ At least one service in `services:` section is required. You can create a projec
Specifies the service type and version.
- See what [Node.js service types](/references/importyml/type-list#runtime-services) are currently supported.
+ See what [Node.js service types](/references/import-yaml/type-list#runtime-services) are currently supported.
@@ -397,9 +373,9 @@ At least one service in `services:` section is required. You can create a projec
-### Create a project based on the description.yml
+### Create a project based on the description.yaml
-When you have your `description.yml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
```sh
Usage:
@@ -412,11 +388,11 @@ Flags:
--workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
```
-Zerops will create a project and one or more services based on the `description.yml` content.
+Zerops will create a project and one or more services based on the `description.yaml` content.
-Maximum size of the `description.yml` file is 100 kB.
+Maximum size of the `description.yaml` file is 100 kB.
-You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yml`.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
@@ -432,7 +408,7 @@ If you have access to more than one client, you must specify the client ID for w
#### Example:
-Create a directory `my-project` if it doesn't exist. Create an `import.yml` file inside the `my-project` directory with following content:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
```yaml
# basic project data
@@ -462,9 +438,9 @@ S3_ACCESS_KEY_ID="P8cX1vVVb"
S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
```
-The content of the `services:` section of `import.yml` is identical to the project description file. The `import.yml` never contains the `project:` section because the project already exists.
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
-When you have your `import.yml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
```sh
Usage:
@@ -478,4 +454,4 @@ Flags:
zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
-Maximum size of the import.yml file is 100 kB.
+Maximum size of the import.yaml file is 100 kB.
diff --git a/apps/docs/content/nodejs/how-to/customize-runtime.mdx b/apps/docs/content/nodejs/how-to/customize-runtime.mdx
index 244ca7b16..e05746965 100644
--- a/apps/docs/content/nodejs/how-to/customize-runtime.mdx
+++ b/apps/docs/content/nodejs/how-to/customize-runtime.mdx
@@ -24,9 +24,9 @@ The default Node.js runtime environment contains:
- NPM, Yarn, Git and NPX tools
:::note
-To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yml/specification#os--1) attribute.
+To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yaml/specification#os--1) attribute.
-Additional packages and tools can be installed using [run.prepareCommands](/zerops-yml/specification#preparecommands--1).
+Additional packages and tools can be installed using [run.prepareCommands](/zerops-yaml/specification#preparecommands--1).
:::
When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
diff --git a/apps/docs/content/nodejs/how-to/deploy-process.mdx b/apps/docs/content/nodejs/how-to/deploy-process.mdx
index 5f47d7c00..37570a105 100644
--- a/apps/docs/content/nodejs/how-to/deploy-process.mdx
+++ b/apps/docs/content/nodejs/how-to/deploy-process.mdx
@@ -40,7 +40,7 @@ Zerops performs following actions for each new container:
Services with multiple containers are deployed in parallel.
:::info
-If your application needs to be initialized in each runtime container, add [init commands](/nodejs/how-to/build-pipeline#initcommands) to `zerops.yml`.
+If your application needs to be initialized in each runtime container, add [init commands](/nodejs/how-to/build-pipeline#initcommands) to `zerops.yaml`.
:::
:::caution
@@ -58,7 +58,7 @@ The old containers are then removed from the project balancer so they don't rece
## Readiness checks
-If your application isn't ready to handle requests right after it is started via the [start command](/nodejs/how-to/build-pipeline#start), configure a [readiness check](/nodejs/how-to/build-pipeline#readiness-check) in your `zerops.yml`.
+If your application isn't ready to handle requests right after it is started via the [start command](/nodejs/how-to/build-pipeline#start), configure a [readiness check](/nodejs/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
If the readiness check is defined, Zerops will:
@@ -94,7 +94,7 @@ The list of application versions is available in Zerops GUI. Go to the service d
The pipeline detail is accessible from the additional menu. The pipeline detail contains
-- The pipeline config (`zerops.yml`) that was used for the selected version
+- The pipeline config (`zerops.yaml`) that was used for the selected version
- The build log (if available)
- The prepare runtime log (if available)
diff --git a/apps/docs/content/nodejs/how-to/env-variables.mdx b/apps/docs/content/nodejs/how-to/env-variables.mdx
index 9533838ee..093c98d1b 100644
--- a/apps/docs/content/nodejs/how-to/env-variables.mdx
+++ b/apps/docs/content/nodejs/how-to/env-variables.mdx
@@ -23,12 +23,12 @@ There are 3 different sets of env variables in Zerops:
basic
build
- zerops.yml
+ zerops.yaml
basic
runtime
- zerops.yml
+ zerops.yaml
secret
@@ -40,13 +40,13 @@ There are 3 different sets of env variables in Zerops:
Use the [secret env variables](/nodejs/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
-The basic build and runtime env variables are listed in your [zerops.yml](/zerops-yml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yml and redeploy your application to Zerops.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
You can [reference](/nodejs/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/nodejs/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
## Set secret env variables in Zerops GUI
-Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yml.
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
-
-
- Resources Type
- Minimum resource
- Maximum resource
-
-
-
-
- CPU cores
- 1
- 5
-
-
- RAM
- 0.25 GB
- 32 GB
-
-
- Disk
- 1 GB
- 100 GB
-
-
-
-
+
Node.js service always starts with the minimal resources.
@@ -207,7 +182,7 @@ The scale up of RAM or disk is immediate. The scale up of CPU is configured to b
The **minimum step** for the vertical scaling is
- 1 CPU core
-- 0.25 GB RAM
+- 0.125 GB RAM
- 0.5 GB disk
When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
diff --git a/apps/docs/content/nodejs/how-to/shared-storage.mdx b/apps/docs/content/nodejs/how-to/shared-storage.mdx
index 88b5dbb90..071ac24a5 100644
--- a/apps/docs/content/nodejs/how-to/shared-storage.mdx
+++ b/apps/docs/content/nodejs/how-to/shared-storage.mdx
@@ -37,15 +37,15 @@ zCLI is the Zerops command-line tool. To create a new Node.js service via the co
Zerops uses a yaml format to describe the project infrastructure.
-#### description.yml format
+#### description.yaml format
-[Read the basics](/nodejs/how-to/create#create-a-project-description-file) how to define the Node.js service using the description.yml.
+[Read the basics](/nodejs/how-to/create#create-a-project-description-file) how to define the Node.js service using the description.yaml.
#### Example with a shared storage
-Create a directory `my-project`. Create an `description.yml` file inside the `my-project` directory with following content:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
-```yml
+```yaml
# basic project data
project:
# project name
@@ -91,4 +91,4 @@ The mount attribute accepts an array of shared storage names you want to mount t
### Create a project with a Node.js service and a shared storage
-Follow the article [How to create a project based on the description.yml](/nodejs/how-to/create#create-a-project-based-on-the-descriptionyml).
+Follow the article [How to create a project based on the description.yaml](/nodejs/how-to/create#create-a-project-based-on-the-descriptionyaml).
diff --git a/apps/docs/content/nodejs/how-to/trigger-pipeline.mdx b/apps/docs/content/nodejs/how-to/trigger-pipeline.mdx
index d6d85e4f4..b60bf7136 100644
--- a/apps/docs/content/nodejs/how-to/trigger-pipeline.mdx
+++ b/apps/docs/content/nodejs/how-to/trigger-pipeline.mdx
@@ -20,7 +20,7 @@ Integrate Zerops to your GitHub or GitLab repository and configure the automatic
Follow these steps:
-1. Add [zerops.yml](/nodejs/how-to/build-pipeline#add-zeropsyml-to-your-repository) to your repository.
+1. Add [zerops.yaml](/nodejs/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
2. Connect your GitHub repository or connect your GitLab repository
Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
@@ -35,7 +35,7 @@ Then each time you create a new tag or push to a specific branch, depending on t
:::info
-You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yml` in your repository.
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
:::
### Skip the automatic pipeline once
@@ -61,13 +61,13 @@ To start a new build & deploy pipeline manually, use the Zerops CLI.
Follow these steps:
-1. Add `zerops.yml` to your repository.
+1. Add `zerops.yaml` to your repository.
2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
3. Run `zcli push` command.
The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
-The command triggers the [build pipeline](/nodejs/how-to/trigger-pipeline) defined in `zerops.yml`. `zerops.yml` must be in the working directory. The working directory is by default the current directory and can be changed using the `--workingDir` flag.
+The command triggers the [build pipeline](/nodejs/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the `--workingDir` flag.
zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
@@ -90,14 +90,14 @@ Flags:
command is to be executed.
--versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
--workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
- --zeropsYamlPath string Sets a custom path to the zerops.yml file relative to the working directory. By default zCLI
- looks for zerops.yml in the working directory.
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
```
zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
:::info
-You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yml` in your repository.
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
:::
## Manual deploy using Zerops CLI
@@ -106,7 +106,7 @@ To start only a deploy pipeline, use the Zerops CLI.
Follow these steps:
-1. Add [zerops.yml](/nodejs/how-to/build-pipeline#add-zeropsyml-to-your-repository) to your repository. Omit the build section.
+1. Add [zerops.yaml](/nodejs/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
3. Run `zcli service deploy` command.
@@ -121,8 +121,8 @@ Usage:
Flags:
--archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
to the working directory. By default, no archive is created.
- --deployGitFolder Sets a custom path to the zerops.yml file relative to the working directory. By default zCLI
- looks for zerops.yml in the working directory.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
-h, --help the service deploy command.
--projectId string If you have access to more than one project, you must specify the project ID for which the
command is to be executed.
@@ -130,14 +130,14 @@ Flags:
command is to be executed.
--versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
--workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
- --zeropsYamlPath string Sets a custom path to the zerops.yml file relative to the working directory. By default zCLI
- looks for zerops.yml in the working directory.
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
```
`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the `--workingDir` flag.
-`zerops.yml` must be placed in the working directory.
+`zerops.yaml` must be placed in the working directory.
:::info
-You can change the deploy pipeline when you need to. Just simply modify the `zerops.yml` in your working directory.
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
:::
diff --git a/apps/docs/content/nodejs/how-to/upgrade.mdx b/apps/docs/content/nodejs/how-to/upgrade.mdx
index 2d100b1da..1defee315 100644
--- a/apps/docs/content/nodejs/how-to/upgrade.mdx
+++ b/apps/docs/content/nodejs/how-to/upgrade.mdx
@@ -3,6 +3,6 @@ title: How to upgrade the Node.js version
description: Learn how to upgrade your node.js service's version
---
-You can upgrade or downgrade your Node.js service to a different major Node.js version by setting the `run.base` parameter in your `zerops.yml`. When you [trigger a new pipeline](/nodejs/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Node.js version. If you don't specify the `run.base` attribute in your `zerops.yml`, Zerops keeps the current Node.js version for your runtime.
+You can upgrade or downgrade your Node.js service to a different major Node.js version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/nodejs/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Node.js version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Node.js version for your runtime.
-If you want to build your application with a different major Node.js version, change the `build.base` parameter in your `zerops.yml`. The `build.base` is the required attribute.
+If you want to build your application with a different major Node.js version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
diff --git a/apps/docs/content/nodejs/overview.mdx b/apps/docs/content/nodejs/overview.mdx
index e4650e8c3..2bf3cf77a 100644
--- a/apps/docs/content/nodejs/overview.mdx
+++ b/apps/docs/content/nodejs/overview.mdx
@@ -25,9 +25,9 @@ As said, there is no need for coding yet, we have created a [Github repository
1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
-2. In the **Projects** box click on **Import a project** and paste in the following yml config ([source ↗](https://github.com/zeropsio/recipe-nodejs/blob/main/zerops-project-import.yml)):
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-nodejs/blob/main/zerops-project-import.yaml)):
-```yml
+```yaml
project:
name: recipe-nodejs
tags:
@@ -116,12 +116,12 @@ It doesn't matter whether it's your first curious introduction to Zerops, you ha
},
{
type: 'link',
- href: '/nodejs/how-to/build-pipeline#add-zeropsyml-to-your-repository',
- label: 'zerops.yml',
+ href: '/nodejs/how-to/build-pipeline#add-zeropsyaml-to-your-repository',
+ label: 'zerops.yaml',
customProps: {
icon: Icons['puzzle'],
description:
- 'See a full example of zerops.yml file to create your own app.',
+ 'See a full example of zerops.yaml file to create your own app.',
},
},
{
@@ -172,7 +172,7 @@ Have you build something that others might find useful? Don't hesitate to share
-At least one service in `services:` section is required. You can create a project with multiple services. The example above contains only Object storage service but you can create a description.yml with different types of services.
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains only Object storage service but you can create a description.yaml with different types of services.
@@ -305,9 +305,9 @@ Each Object storage service can only contain one bucket. If your application nee
Bucket will be created with a name based on the given service name and a random prefix. The name of the bucket cannot be changed later.
-### Create a project based on the description.yml
+### Create a project based on the description.yaml
-When you have your `description.yml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
```sh
Usage:
@@ -320,11 +320,11 @@ Flags:
--workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
```
-Zerops will create a project and one or more services based on the `description.yml` content.
+Zerops will create a project and one or more services based on the `description.yaml` content.
-Maximum size of the `description.yml` file is 100 kB.
+Maximum size of the `description.yaml` file is 100 kB.
-You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yml`.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
@@ -339,9 +339,9 @@ If you have access to more than one client, you must specify the client ID for w
### Add Object service to an existing project
-Create a directory `my-project` if it doesn't exist. Create an `import.yml` file inside the `my-project` directory with following content:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
-```yml
+```yaml
# array of project services
services:
- # service name
@@ -362,9 +362,9 @@ services:
The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Object storage service named upload will be created. The bucket quota will be set to 73 GB and the bucket access policy will be set to `public-write`.
-The content of the `services:` section of `import.yml` is identical to the [project description file]. The `import.yml` never contains the `project:` section because the project already exists.
+The content of the `services:` section of `import.yaml` is identical to the [project description file]. The `import.yaml` never contains the `project:` section because the project already exists.
-When you have your `import.yml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
```sh
Usage:
@@ -378,11 +378,11 @@ Flags:
zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
-Maximum size of the `import.yml` file is 100 kB.
+Maximum size of the `import.yaml` file is 100 kB.
#### Example
-Create a directory `my-project` if it doesn't exist. Create an `import.yml` file inside the `my-project` directory with following content:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
```bash
# array of project services
@@ -396,4 +396,4 @@ services:
The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Object storage service in the single container mode with default auto scaling configuration will be added to your project. Hostname of the new service will be set to `storage`.
-The content of the `services:` section of `import.yml` is identical to the [project description file](#create-a-project-description-file). The `import.yml` never contains the `project:` section because the project already exists.
+The content of the `services:` section of `import.yaml` is identical to the [project description file](#create-a-project-description-file). The `import.yaml` never contains the `project:` section because the project already exists.
diff --git a/apps/docs/content/object-storage/how-to/update-bucket.mdx b/apps/docs/content/object-storage/how-to/update-bucket.mdx
index 472e1cb15..52ba1ded3 100644
--- a/apps/docs/content/object-storage/how-to/update-bucket.mdx
+++ b/apps/docs/content/object-storage/how-to/update-bucket.mdx
@@ -52,7 +52,7 @@ Or you can set your own access policy in the [IAM Policy JSON format](https://mi
#### Example:
-```yml
+```yaml
{
'Version': '2012-10-17',
'Statement':
diff --git a/apps/docs/content/object-storage/overview.mdx b/apps/docs/content/object-storage/overview.mdx
index 5e0c14ef1..1be0a2d07 100644
--- a/apps/docs/content/object-storage/overview.mdx
+++ b/apps/docs/content/object-storage/overview.mdx
@@ -81,7 +81,7 @@ Have you build something that others might find useful? Don't hesitate to share
- sample answer
-
diff --git a/apps/docs/content/php/how-to/access.mdx b/apps/docs/content/php/how-to/access.mdx
index 65a8d99f7..5414a5a22 100644
--- a/apps/docs/content/php/how-to/access.mdx
+++ b/apps/docs/content/php/how-to/access.mdx
@@ -55,7 +55,7 @@ Use the `ssh` command to connect to your service v
## Public access through zerops.io subdomain
-By default, your PHP service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zeropsapp-subdomain).
+By default, your PHP service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
## Public access through your domain
@@ -63,4 +63,4 @@ By default, your PHP service is not publicly accessible. When your application i
## Public access from another Zerops project
-All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/php/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zeropsapp-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/php/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
diff --git a/apps/docs/content/php/how-to/build-pipeline.mdx b/apps/docs/content/php/how-to/build-pipeline.mdx
index 86aad20a1..edc3b65e0 100644
--- a/apps/docs/content/php/how-to/build-pipeline.mdx
+++ b/apps/docs/content/php/how-to/build-pipeline.mdx
@@ -9,11 +9,11 @@ import UnorderedCodeList from 'docs/src/components/UnorderedCodeList';
Zerops provides a customizable build and runtime environment for your PHP application.
-## Add zerops.yml to your repository
+## Add zerops.yaml to your repository
-Start by adding `zerops.yml` file to the **root of your repository** and modify it to fit your application:
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
@@ -76,9 +76,9 @@ The top-level element is always `zerops`.
### Setup
The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
-Zerops supports the definition of multiple runtime services in a single `zerops.yml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yml`:
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
-```yml
+```yaml
zerops:
# definition for app service
- setup: app
@@ -103,7 +103,7 @@ Following options are available for PHP builds:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -120,12 +120,12 @@ zerops:
:::info
-You can change the base environment when you need to. Just simply modify the `zerops.yml` in your repository.
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
:::
If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -139,7 +139,7 @@ zerops:
...
```
-See the full list of supported [build base environments](/zerops-yml/base-list#runtime-services).
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
To customise your build environment use the [prepareCommands](/php/how-to/build-pipeline#preparecommands) attribute.
@@ -184,7 +184,7 @@ The base build environment contains:
To install additional packages or tools add one or more prepare commands:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -225,7 +225,7 @@ You can configure your prepare commands to be run in a single shell instance or
_REQUIRED._ Defines build commands.
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -252,7 +252,7 @@ Before the build commands are triggered the build container contains:
Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it.
-```yml
+```yaml
buildCommands:
- |
composer install --optimize-autoloader --no-dev
@@ -263,7 +263,7 @@ buildCommands:
When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command.
-```yml
+```yaml
buildCommands:
- composer install --optimize-autoloader --no-dev
- php artisan env
@@ -273,7 +273,7 @@ buildCommands:
If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/php/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the verbose option.
-```yml
+```yaml
buildCommands:
- composer install -v
```
@@ -284,7 +284,7 @@ If the command ends successfully, it returns the exit code 0 and Zerops triggers
_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
-```yml
+```yaml
# REQUIRED. Select which files / folders to deploy after
# the build has successfully finished
deployFiles:
@@ -294,7 +294,7 @@ deployFiles:
Determines files or folders produced by your build, which should be deployed to your runtime service containers.
-The path starts from the **root directory** of your project (the location of `zerops.yml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
@@ -302,7 +302,7 @@ The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/
Deploys a folder, and a file from the project root directory:
-```yml
+```yaml
deployFiles:
- public
- file.txt
@@ -310,13 +310,13 @@ deployFiles:
Deploys the whole content of the build container:
-```yml
+```yaml
deployFiles: .
```
Deploys a folder, and a file in a defined path:
-```yml
+```yaml
deployFiles:
- ./path/to/file.txt
- ./path/to/dir/
@@ -328,19 +328,19 @@ Zerops supports the `~` character as a wildcard for one or more folders in the p
Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
-```yml
+```yaml
deployFiles: ./path/~/to/file.txt
```
Deploys all folders that are located in any path that begins with `/path/to/`
-```yml
+```yaml
deployFiles: ./path/to/~/
```
Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
-```yml
+```yaml
deployFiles: ./path/~/to/
```
@@ -359,7 +359,7 @@ For consistency, it's recommended to configure both your `.gitignore` and `.depl
Examples:
-```yml title="zerops.yml"
+```yaml title="zerops.yaml"
zerops:
- setup: app
build:
@@ -386,7 +386,7 @@ This example above ignores `file.txt` in ANY directory named `src`, such as:
_OPTIONAL._ Defines which files or folders will be cached for the next build.
-```yml
+```yaml
# OPTIONAL. Which files / folders you want to cache for the next build.
# Next builds will be faster when the cache is used.
cache: file.txt
@@ -404,7 +404,7 @@ _OPTIONAL._ Defines the environment variables for the build environment.
Enter one or more env variables in following format:
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
@@ -436,7 +436,7 @@ Following options are available for PHP builds:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -459,12 +459,12 @@ zerops:
:::info
-You can change the base environment when you need to. Just simply modify the `zerops.yml` in your repository.
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
:::
If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -484,7 +484,7 @@ zerops:
...
```
-See the full list of supported [run base environments](/zerops-yml/base-list).
+See the full list of supported [run base environments](/zerops-yaml/base-list).
To customise your build environment use the `prepareCommands` attribute.
@@ -563,7 +563,7 @@ _OPTIONAL._ Customises the PHP runtime environment by installing additional depe
additional packages or tools add one or more prepare commands:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -624,14 +624,14 @@ You can configure your prepare commands to be run in a single shell instance or
The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
# ==== how to build your application ====
build:
...
- addToRunPrepare: ./runtime-config.yml
+ addToRunPrepare: ./runtime-config.yaml
# ==== how to run your application ====
run:
@@ -643,13 +643,13 @@ zerops:
...
```
-In the example above Zerops will copy the `runtime-config.yml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
### initCommands
_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -694,7 +694,7 @@ By default, the document root is configured to `/var/www`.
Customize the folder that will be used as the root of the publicly accessible web server content. Enter the path relative to the `/var/www` folder.
E.g. `documentRoot: public` will set the web server document root to `/var/www/public`.
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -725,7 +725,7 @@ _OPTIONAL._ Defines the environment variables for the runtime environment.
Enter one or more env variables in following format:
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
@@ -763,7 +763,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -812,7 +812,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -842,7 +842,7 @@ _OPTIONAL._ Defines cron jobs.
Setup cron jobs in the following format:
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
@@ -881,7 +881,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -929,7 +929,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
diff --git a/apps/docs/content/php/how-to/build-process.mdx b/apps/docs/content/php/how-to/build-process.mdx
index 510b3e25b..836cf65cf 100644
--- a/apps/docs/content/php/how-to/build-process.mdx
+++ b/apps/docs/content/php/how-to/build-process.mdx
@@ -35,14 +35,14 @@ The build cancellation is available before the build pipeline is finished. When
The default PHP build environment contains:
- {data.alpine.default}
-- selected version of PHP defined in `zerops.yml` [build.base](/php/how-to/build-pipeline#base) parameter
+- selected version of PHP defined in `zerops.yaml` [build.base](/php/how-to/build-pipeline#base) parameter
- Git and Composer
- [zCLI](/references/cli)
:::note
-To use Ubuntu instead of the default Alpine, set the [build.os](/zerops-yml/specification#os-) attribute.
+To use Ubuntu instead of the default Alpine, set the [build.os](/zerops-yaml/specification#os-) attribute.
-Additional packages and tools can be installed using [build.prepareCommands](/zerops-yml/specification#preparecommands-).
+Additional packages and tools can be installed using [build.prepareCommands](/zerops-yaml/specification#preparecommands-).
:::
## PHP build hardware resources
@@ -85,7 +85,7 @@ This will force Zerops to run the next build clean, including all prepare comman
If any [build command](/php/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/php/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `-v` verbose option.
-```yml
+```yaml
buildCommands:
- composer install -v
```
diff --git a/apps/docs/content/php/how-to/create.mdx b/apps/docs/content/php/how-to/create.mdx
index 7fc7143b5..7365b4778 100644
--- a/apps/docs/content/php/how-to/create.mdx
+++ b/apps/docs/content/php/how-to/create.mdx
@@ -6,6 +6,7 @@ description: Learn how you can create a php service in Zerops.
import Image from '/src/components/Image';
import data from '@site/static/data.json';
import UnorderedList from '@site/src/components/UnorderedList';
+import ResourceTable from '/src/components/ResourceTable';
Zerops provides 2 PHP services with an included web server: **PHP+Nginx** and **PHP+Apache**. PHP runtime is highly scalable and customisable to suit both development and production.
@@ -77,33 +78,7 @@ Choose the CPU mode when starting a new service or change it later. The CPU mode
Vertical auto scaling has following default configuration:
-
-
-
- Resources Type
- Minimum resource
- Maximum resource
-
-
-
-
- CPU cores
- 1
- 5
-
-
- RAM
- 0.25 GB
- 32 GB
-
-
- Disk
- 1 GB
- 100 GB
-
-
-
-
+
PHP service always starts with the minimal resources.
@@ -180,7 +155,7 @@ Zerops uses a yaml format to describe the project infrastructure.
#### Basic example:
-Create a directory `my-project`. Create an `description.yml` file inside the `my-project` directory with following content:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
```yaml
# basic project data
@@ -203,7 +178,7 @@ services:
S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
```
-The yaml file describes your future project infrastructure. The project will contain one PHP version 8.1 service with default [auto scaling](/php/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yml](/php/how-to/build-pipeline#ports). Following secret env variables will be configured:
+The yaml file describes your future project infrastructure. The project will contain one PHP version 8.1 service with default [auto scaling](/php/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/php/how-to/build-pipeline#ports). Following secret env variables will be configured:
```env
S3_ACCESS_KEY_ID="P8cX1vVVb"
@@ -212,7 +187,7 @@ S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
#### Full example:
-Create a directory my-project. Create an description.yml file inside the my-project directory with following content:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
```yaml
# basic project data
@@ -261,7 +236,7 @@ services:
The yaml file describes your future project infrastructure. The project will contain a PHP service and a [PostgreSQL](/postgresql/overview) service.
-PHP service with "app" hostname, the internal port(s) the service listens on will be defined later in the [zerops.yml](/php/how-to/build-pipeline#ports). PHP service will run on version 8.1 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+PHP service with "app" hostname, the internal port(s) the service listens on will be defined later in the [zerops.yaml](/php/how-to/build-pipeline#ports). PHP service will run on version 8.1 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
```env
S3_ACCESS_KEY_ID="P8cX1vVVb"
@@ -270,7 +245,7 @@ S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
-#### Description of description.yml parameters
+#### Description of description.yaml parameters
The `project:` section is required. Only one project can be defined.
@@ -302,7 +277,7 @@ The `project:` section is required. Only one project can be defined.
-At least one service in `services:` section is required. You can create a project with multiple services. The example above contains PHP and PostgreSQL services but you can create a `description.yml` with your own combination of [services](/features/infrastructure).
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains PHP and PostgreSQL services but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
@@ -332,7 +307,7 @@ At least one service in `services:` section is required. You can create a projec
Specifies the service type and version.
- See what [PHP service types](/references/importyml/type-list#runtime-services) are currently supported.
+ See what [PHP service types](/references/import-yaml/type-list#runtime-services) are currently supported.
@@ -396,9 +371,9 @@ At least one service in `services:` section is required. You can create a projec
-### Create a project based on the description.yml
+### Create a project based on the description.yaml
-When you have your `description.yml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
```sh
Usage:
@@ -411,11 +386,11 @@ Flags:
--workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
```
-Zerops will create a project and one or more services based on the `description.yml` content.
+Zerops will create a project and one or more services based on the `description.yaml` content.
-Maximum size of the `description.yml` file is 100 kB.
+Maximum size of the `description.yaml` file is 100 kB.
-You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yml`.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
@@ -432,7 +407,7 @@ If you have access to more than one client, you must specify the client ID for w
#### Example:
-Create a directory `my-project` if it doesn't exist. Create an `import.yml` file inside the `my-project` directory with following content:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
```yaml
# basic project data
@@ -462,9 +437,9 @@ S3_ACCESS_KEY_ID="P8cX1vVVb"
S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
```
-The content of the `services:` section of `import.yml` is identical to the project description file. The `import.yml` never contains the `project:` section because the project already exists.
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
-When you have your `import.yml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
```sh
Usage:
@@ -478,4 +453,4 @@ Flags:
zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
-Maximum size of the import.yml file is 100 kB.
+Maximum size of the import.yaml file is 100 kB.
diff --git a/apps/docs/content/php/how-to/customize-runtime.mdx b/apps/docs/content/php/how-to/customize-runtime.mdx
index 02dc1595d..72114f78e 100644
--- a/apps/docs/content/php/how-to/customize-runtime.mdx
+++ b/apps/docs/content/php/how-to/customize-runtime.mdx
@@ -13,9 +13,9 @@ The default PHP runtime environment contains:
- Git and Composer
:::note
-To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yml/specification#os--1) attribute.
+To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yaml/specification#os--1) attribute.
-Additional packages and tools can be installed using [run.prepareCommands](/zerops-yml/specification#preparecommands--1).
+Additional packages and tools can be installed using [run.prepareCommands](/zerops-yaml/specification#preparecommands--1).
:::
## Runtime Flow
@@ -33,7 +33,7 @@ When the first deploy with a defined `prepareCommands` attribute is triggered, Z
1. Create a prepare runtime container
2. Optionally: [copy selected folders or files from your build container](/php/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
-3. Run the [run.prepareCommands](/zerops-yml/specification#preparecommands--1) commands in the defined order
+3. Run the [run.prepareCommands](/zerops-yaml/specification#preparecommands--1) commands in the defined order
## Command exit code
@@ -63,11 +63,11 @@ When the custom runtime cache is used, Zerops doesn't create a prepare runtime c
### Overwrite php.ini files
-You can override PHP configuration directives by setting environment variables in your `zerops.yml` file.
+You can override PHP configuration directives by setting environment variables in your `zerops.yaml` file.
Here's an example of how to adjust PHP's `post_max_size` directive:
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
diff --git a/apps/docs/content/php/how-to/customize-web-server.mdx b/apps/docs/content/php/how-to/customize-web-server.mdx
index 1c1242851..90907ea6c 100644
--- a/apps/docs/content/php/how-to/customize-web-server.mdx
+++ b/apps/docs/content/php/how-to/customize-web-server.mdx
@@ -45,7 +45,7 @@ server {
The configuration contains 2 variables:
-- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yml`. If the attribute is not specified, the default value `/var/www` is used.
+- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yaml`. If the attribute is not specified, the default value `/var/www` is used.
- **`{{.PhpSocket}}`** is replaced by a path to the PHP socket based on the PHP version.
@@ -53,11 +53,11 @@ The configuration contains 2 variables:
Follow these steps to customize the Nginx configuration in PHP+Nginx service:
-1. Create a **.tmpl** file with the Nginx configuration in your repository.
+1. Create a **.tmpl** file with the Apache configuration in your repository.
2. Optionally use following variables:
-- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yml`. If the attribute is not specified, the default value `/var/www` is used.
+- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yaml`. If the attribute is not specified, the default value `/var/www` is used.
Example:
@@ -73,7 +73,7 @@ Example:
fastcgi_pass unix:{{.PhpSocket}};
```
-- **`{{.Environment.ENV_NAME}}`** is replaced by the [env variable](/php/how-to/env-variables) value. The env variable must be either defined in [run.envVariables](/php/how-to/build-pipeline#envvariables-1) in `zerops.yml` or set as a [secret](/php/how-to/env-variables#set-secret-env-variables-in-zerops-gui) or [generated](/php/how-to/env-variables#generated-env-variables) env variable in Zerops GUI.
+- **`{{.Environment.ENV_NAME}}`** is replaced by the [env variable](/php/how-to/env-variables) value. The env variable must be either defined in [run.envVariables](/php/how-to/build-pipeline#envvariables-1) in `zerops.yaml` or set as a [secret](/php/how-to/env-variables#set-secret-env-variables-in-zerops-gui) or [generated](/php/how-to/env-variables#generated-env-variables) env variable in Zerops GUI.
:::caution
Use the **.tmpl** file extension to make Zerops interpret the file as a template. Zerops will replace the supported variables listed above.
@@ -82,12 +82,12 @@ Use the **.tmpl** file extension to make Zerops interpret the file as a template
3. Check that your Nginx configuration is consistent with Zerops requirements:
- Do not use IP addresses in the `listen` directive
-- If you use other ports than `:80` in the `listen` directive, add them to the `run.ports` in your `zerops.yml` as well.
+- If you use other ports than `:80` in the `listen` directive, add them to the `run.ports` in your `zerops.yaml` as well.
- Do not use the port **:443**. All the incoming `https://` traffic is terminated on the Zerops internal balancer where the SSL certificate is installed and the request is forwarded to your PHP+Nginx service as a **http://** on the port **:80**.
-4. Add the `siteConfigPath` to the run section of your `zerops.yml`
+4. Add the `siteConfigPath` to the run section of your `zerops.yaml`
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
@@ -146,7 +146,7 @@ The default PHP+Apache service has following Apache configuration:
The configuration contains 2 variables:
-- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yml`. If the attribute is not specified, the default value `/var/www` is used.
+- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yaml`. If the attribute is not specified, the default value `/var/www` is used.
- **`{{.PhpSocket}}`** is replaced by a path to the PHP socket based on the PHP version.
@@ -158,7 +158,7 @@ Follow these steps to customize the Apache configuration in PHP+Apache service:
2. Optionally use following variables:
-- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yml`. If the attribute is not specified, the default value `/var/www` is used.
+- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yaml`. If the attribute is not specified, the default value `/var/www` is used.
Example:
@@ -176,7 +176,7 @@ Example:
```
-- **`{{.Environment.ENV_NAME}}`** is replaced by the [env variable](/php/how-to/env-variables) value. The env variable must be either defined in [run.envVariables](<(/php/how-to/build-pipeline#envvariables-1)>) in `zerops.yml` or set as a [secret](/php/how-to/env-variables#set-secret-env-variables-in-zerops-gui) or [generated](/php/how-to/env-variables#generated-env-variables) env variable in Zerops GUI.
+- **`{{.Environment.ENV_NAME}}`** is replaced by the [env variable](/php/how-to/env-variables) value. The env variable must be either defined in [run.envVariables](<(/php/how-to/build-pipeline#envvariables-1)>) in `zerops.yaml` or set as a [secret](/php/how-to/env-variables#set-secret-env-variables-in-zerops-gui) or [generated](/php/how-to/env-variables#generated-env-variables) env variable in Zerops GUI.
:::caution
Use the **.tmpl** file extension to make Zerops interpret the file as a template. Zerops will replace the supported variables listed above.
@@ -185,12 +185,12 @@ Use the **.tmpl** file extension to make Zerops interpret the file as a template
3. Check that your Apache configuration is consistent with Zerops requirements:
- Do not use IP addresses in the `` directive
-- If you use other ports than `:80` in the `` directive, add them to the `run.ports` in your `zerops.yml` as well.
+- If you use other ports than `:80` in the `` directive, add them to the `run.ports` in your `zerops.yaml` as well.
Do not use the port **:443**. All the incoming `https://` traffic is terminated on the Zerops internal balancer where the SSL certificate is installed and the request is forwarded to your PHP+Apache service as a **http://** on the port **:80**.
-4. Add the `siteConfigPath` to the run section of your `zerops.yml`.
+4. Add the `siteConfigPath` to the run section of your `zerops.yaml`.
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
diff --git a/apps/docs/content/php/how-to/deploy-process.mdx b/apps/docs/content/php/how-to/deploy-process.mdx
index b14b317b6..eae4905e5 100644
--- a/apps/docs/content/php/how-to/deploy-process.mdx
+++ b/apps/docs/content/php/how-to/deploy-process.mdx
@@ -40,7 +40,7 @@ Zerops performs following actions for each new container:
Services with multiple containers are deployed in parallel.
:::info
-If your application needs to be initialized in each runtime container, add [init commands](/php/how-to/build-pipeline#initcommands) to `zerops.yml`.
+If your application needs to be initialized in each runtime container, add [init commands](/php/how-to/build-pipeline#initcommands) to `zerops.yaml`.
:::
:::caution
@@ -58,7 +58,7 @@ The old containers are then removed from the project balancer so they don't rece
## Readiness checks
-If your application isn't ready as soon as it starts, configure a [readiness check](/php/how-to/build-pipeline#readiness-check) in your `zerops.yml`.
+If your application isn't ready as soon as it starts, configure a [readiness check](/php/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
If the readiness check is defined, Zerops will:
@@ -94,7 +94,7 @@ The list of application versions is available in Zerops GUI. Go to the service d
The pipeline detail is accessible from the additional menu. The pipeline detail contains
-- The pipeline config (`zerops.yml`) that was used for the selected version
+- The pipeline config (`zerops.yaml`) that was used for the selected version
- The build log (if available)
- The prepare runtime log (if available)
diff --git a/apps/docs/content/php/how-to/env-variables.mdx b/apps/docs/content/php/how-to/env-variables.mdx
index ffe2288e4..5b56f3089 100644
--- a/apps/docs/content/php/how-to/env-variables.mdx
+++ b/apps/docs/content/php/how-to/env-variables.mdx
@@ -23,12 +23,12 @@ There are 3 different sets of env variables in Zerops:
basic
build
- zerops.yml
+ zerops.yaml
basic
runtime
- zerops.yml
+ zerops.yaml
secret
@@ -41,13 +41,13 @@ There are 3 different sets of env variables in Zerops:
Use the [secret env variables](/php/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
-The basic build and runtime env variables are listed in your [zerops.yml](/zerops-yml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yml and redeploy your application to Zerops.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
You can [reference](/php/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/php/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
## Set secret env variables in Zerops GUI
-Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yml.
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
-
-
- Resources Type
- Minimum resource
- Maximum resource
-
-
-
-
- CPU cores
- 1
- 5
-
-
- RAM
- 0.25 GB
- 32 GB
-
-
- Disk
- 1 GB
- 100 GB
-
-
-
-
+
PHP service always starts with the minimal resources.
@@ -207,7 +182,7 @@ The scale up of RAM or disk is immediate. The scale up of CPU is configured to b
The **minimum step** for the vertical scaling is
- 1 CPU core
-- 0.25 GB RAM
+- 0.125 GB RAM
- 0.5 GB disk
When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
diff --git a/apps/docs/content/php/how-to/shared-storage.mdx b/apps/docs/content/php/how-to/shared-storage.mdx
index d34ff8d9c..b90a0f835 100644
--- a/apps/docs/content/php/how-to/shared-storage.mdx
+++ b/apps/docs/content/php/how-to/shared-storage.mdx
@@ -37,15 +37,15 @@ zCLI is the Zerops command-line tool. To create a new PHP service via the comman
Zerops uses a yaml format to describe the project infrastructure.
-#### description.yml format
+#### description.yaml format
-[Read the basics](/php/how-to/create#create-a-project-description-file) how to define the PHP service using the description.yml.
+[Read the basics](/php/how-to/create#create-a-project-description-file) how to define the PHP service using the description.yaml.
#### Example with a shared storage
-Create a directory `my-project`. Create an `description.yml` file inside the `my-project` directory with following content:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
-```yml
+```yaml
# basic project data
project:
# project name
@@ -91,4 +91,4 @@ The mount attribute accepts an array of shared storage names you want to mount t
### Create a project with a PHP service and a shared storage
-Follow the article [How to create a project based on the description.yml](/php/how-to/create#create-a-project-based-on-the-descriptionyml).
+Follow the article [How to create a project based on the description.yaml](/php/how-to/create#create-a-project-based-on-the-descriptionyaml).
diff --git a/apps/docs/content/php/how-to/trigger-pipeline.mdx b/apps/docs/content/php/how-to/trigger-pipeline.mdx
index 16013e1f8..268334dea 100644
--- a/apps/docs/content/php/how-to/trigger-pipeline.mdx
+++ b/apps/docs/content/php/how-to/trigger-pipeline.mdx
@@ -20,7 +20,7 @@ Integrate Zerops to your GitHub or GitLab repository and configure the automatic
Follow these steps:
-1. Add [zerops.yml](/php/how-to/build-pipeline#add-zeropsyml-to-your-repository) to your repository.
+1. Add [zerops.yaml](/php/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
2. Connect your GitHub repository or connect your GitLab repository
Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
@@ -35,7 +35,7 @@ Then each time you create a new tag or push to a specific branch, depending on t
:::info
-You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yml` in your repository.
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
:::
### Skip the automatic pipeline once
@@ -61,13 +61,13 @@ To start a new build & deploy pipeline manually, use the Zerops CLI.
Follow these steps:
-1. Add `zerops.yml` to your repository.
+1. Add `zerops.yaml` to your repository.
2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
3. Run `zcli push` command.
The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
-The command triggers the [build pipeline](/php/how-to/trigger-pipeline) defined in `zerops.yml`. `zerops.yml` must be in the working directory. The working directory is by default the current directory and can be changed using the `--workingDir` flag.
+The command triggers the [build pipeline](/php/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the `--workingDir` flag.
zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
@@ -90,14 +90,14 @@ Flags:
command is to be executed.
--versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
--workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
- --zeropsYamlPath string Sets a custom path to the zerops.yml file relative to the working directory. By default zCLI
- looks for zerops.yml in the working directory.
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
```
zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
:::info
-You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yml` in your repository.
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
:::
## Manual deploy using Zerops CLI
@@ -106,7 +106,7 @@ To start only a deploy pipeline, use the Zerops CLI.
Follow these steps:
-1. Add [zerops.yml](/php/how-to/build-pipeline#add-zeropsyml-to-your-repository) to your repository. Omit the build section.
+1. Add [zerops.yaml](/php/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
3. Run `zcli service deploy` command.
@@ -121,8 +121,8 @@ Usage:
Flags:
--archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
to the working directory. By default, no archive is created.
- --deployGitFolder Sets a custom path to the zerops.yml file relative to the working directory. By default zCLI
- looks for zerops.yml in the working directory.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
-h, --help the service deploy command.
--projectId string If you have access to more than one project, you must specify the project ID for which the
command is to be executed.
@@ -130,14 +130,14 @@ Flags:
command is to be executed.
--versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
--workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
- --zeropsYamlPath string Sets a custom path to the zerops.yml file relative to the working directory. By default zCLI
- looks for zerops.yml in the working directory.
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
```
`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the `--workingDir` flag.
-`zerops.yml` must be placed in the working directory.
+`zerops.yaml` must be placed in the working directory.
:::info
-You can change the deploy pipeline when you need to. Just simply modify the `zerops.yml` in your working directory.
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
:::
diff --git a/apps/docs/content/php/how-to/upgrade.mdx b/apps/docs/content/php/how-to/upgrade.mdx
index 6878f091d..90c77a3d5 100644
--- a/apps/docs/content/php/how-to/upgrade.mdx
+++ b/apps/docs/content/php/how-to/upgrade.mdx
@@ -3,6 +3,6 @@ title: How to upgrade the PHP version
description: Learn how to upgrade your php service's version
---
-You can upgrade or downgrade your PHP service to a different major PHP version by setting the `run.base` parameter in your `zerops.yml`. When you [trigger a new pipeline](/php/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required PHP version. If you don't specify the `run.base` attribute in your `zerops.yml`, Zerops keeps the current PHP version for your runtime.
+You can upgrade or downgrade your PHP service to a different major PHP version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/php/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required PHP version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current PHP version for your runtime.
-If you want to build your application with a different major PHP version, change the `build.base` parameter in your `zerops.yml`. The `build.base` is the required attribute.
+If you want to build your application with a different major PHP version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
diff --git a/apps/docs/content/php/overview.mdx b/apps/docs/content/php/overview.mdx
index 4c7f86d5b..c9bfc1f45 100644
--- a/apps/docs/content/php/overview.mdx
+++ b/apps/docs/content/php/overview.mdx
@@ -23,9 +23,9 @@ As said, there is no need for coding yet, we have created a [Github repository
1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
-2. In the **Projects** box click on **Import a project** and paste in the following yml config ([source ↗](https://github.com/zeropsio/recipe-php-hello-world/blob/main/import-project/description.yml)):
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-php-hello-world/blob/main/import-project/description.yaml)):
-```yml
+```yaml
project:
name: my-first-project
services:
@@ -96,12 +96,12 @@ Do you have any questions? Check the step-by-step tutorial, browse the documenta
},
{
type: 'link',
- href: '/php/how-to/build-pipeline#add-zeropsyml-to-your-repository',
- label: 'zerops.yml',
+ href: '/php/how-to/build-pipeline#add-zeropsyaml-to-your-repository',
+ label: 'zerops.yaml',
customProps: {
icon: Icons['puzzle'],
description:
- 'See a full example of zerops.yml file to create your own app.',
+ 'See a full example of zerops.yaml file to create your own app.',
},
},
{
@@ -152,7 +152,7 @@ Have you build something that others might find useful? Don't hesitate to share
+
+
+ Parameter
+ Internal Connection
+ Direct IP Access (TLS)
+
+
+
+
+ Hostname/IP
+ Service hostname
+ Public IP address
+
+
+ Port
+ 5432
+ 6432
+
+
+ User
+ Identical to the service hostname
+ Same as internal
+
+
+ Password
+ Randomly generated during service creation
+ Same as internal
+
+
+ Port env variable
+ `port`
+ `portTls`
+
+
+ Connection string env variable
+ `connectionString`
+ `connectionTlsString`
+
+
+
+
+:::warning
+Zerops creates a system user named `zps` with full privileges for maintenance purposes. Do not delete, change the password, or remove privileges from this user, as it will disrupt Zerops' ability to maintain the database cluster.
+:::
:::info
-Zerops creates a second DB user: `zps` for maintenance reasons with full privileges. Do not delete, change the password or remove privileges from this user, it will disrupt Zerops ability to maintain the database cluster.
+For more information about default PostgreSQL setup, users, and databases, see [Manage PostgreSQL Users and Databases](/postgresql/how-to/manage).
:::
-## Copy access details from Zerops GUI
-
-You will find the PostgreSQL access details under the **Access details** button in the project dashboard page.
-
-{/*TODO screenshot (Access detail popover)*/}
+## Connect from Services in the Same Project
-The same information is available in the service detail page in the left menu under the **Peek access details** button.
+All services within a Zerops project share a dedicated private network. There are two ways to implement connections between services in the same project:
-### PostgreSQL access parameters:
+### Method 1: Direct Connection Parameters
-| Parameter | Description |
-| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
-| **Hostname** | The service hostname specified when the PostgreSQL service was created. |
-| **Port** | **5432** This port is fixed for all PostgreSQL services and cannot be customized. |
-| **User** | Zerops creates a database user automatically when the service is created. The user name is always identical to the service hostname. |
-| **Password** | Zerops sets a random password when the service is created. |
-| **Connection string** | The connection string for PostgreSQL service is: `postgresql://${user}:${password}@{hostname}:5432` |
-
-## Connect to PostgreSQL from runtime services of the same project
-
-Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
-
-{/*TODO image (project example diagram)*/}
-
-#### Example
-
-To connect to PostgreSQL `database1` service, set
+You can directly use the connection parameters from Access Details:
```
host = database1
+port = 5432
user = database1
-password = **********
+password = ********** (find under Access Details)
```
-You will find the password under the [**Access details**](#copy-access-details-from-zerops-gui) button in Zerops GUI.
-
-:::caution
-Do not use SSL/TLS protocols when connecting to PostgreSQL from other runtime services in the same project. Zerops PostgreSQL is not configured to support these protocols. The security is assured by the project private network. Due to security reasons Zerops doesn't allow exposing PostgreSQL service to the internet.
-:::
-
-## Use PostgreSQL environment variables
-
-Zerops creates default environment variables for each PostgreSQL service to help you with connection from runtime services in the same project. To avoid the need to copy database access parameters manually, use environment variables in your [runtime service].
-
-### Prefix the environment variable key
-
-All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
-
-#### Example
-
-To access the `connectionString` env variable of the `postgresql1` service, use `postgresql1_connectionString` as the env variable key.
-To access the `password` env variable of the `postgresql2` service, use `postgresql2_password` as the env variable key.
-
-### PostgreSQL environment variables
-
-List of service environment variables is available in Zerops GUI. Go to a PostgreSQL service detail and choose **Environment variables** in the left menu.
+### Method 2: Environment Variables (Recommended)
-{/*TODO screenshot (Service env variables table page in the PostgreSQL detail)*/}
+For better maintainability, Zerops creates environment variables for each PostgreSQL service that you can use in your application configuration. List of service environment variables is available in Zerops GUI. Go to a PostgreSQL service detail and choose **Environment variables**.
-Zerops creates following environment variables when the PostgreSQL service is created:
+To use variables from one service in another, prefix the variable name with the service hostname and underscore - to access the `connectionString` variable of `postgresql1`, use `postgresql1_connectionString`.
-| Variable | Description |
-| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| **Hostname** | The service hostname specified when the PostgreSQL service was created. |
-| **Port** | **5432** This port is fixed for all PostgreSQL services and cannot be customized. |
-| **projectId** | ID of the project. Generated by Zerops. |
-| **serviceId** | ID of the PostgreSQL service. Generated by Zerops. |
-| **Connection string** | The connection string for PostgreSQL service is: `postgresql://${user}:${password}@{hostname}:5432` Connection string contains [references](/postgresql/how-to/connect#postgresql-access-parameters) to `user` and `password` variables. Each time the `user` or `password` variable is updated, the `connectionString` variable is automatically updated as well. |
-| **User** | Zerops creates a database user automatically when the service is created. The user name is always identical to the service hostname. |
-| **Password** | Zerops sets a random password when the service is created. |
+For more details on how to use environment variables, and instructions for adding your own custom variables, see the [Environment Variables](/features/env-variables) documentation.
-:::caution
-When you change the value of the password env variable, only the env variable is updated, not the actual password of the PostgreSQL user. You have to update the password of the database user manually.
-
-When you change the password of the default PostgreSQL user in the database, the new password is not synchronised to the password env variable. You have to update the `password` env variable manually.
-:::
-:::caution
-The official PostgreSQL documentation states that both `postgresql://` and `postgres://` URIs are valid. In Zerops, we chose to generate the connection string with the widely used `postgresql://` schema.
-Some softwares however require the connection string to start with the shorter `postgres://` version only, which might cause errors. To fix that, create your own environment variable with the correct URI, e.g. when your PostgreSQL service is called `db` - `postgres://${db_user}:${db_password}@${db_hostname}:${db_port}`.
+:::caution Important notes
+- When changing passwords, update both the database user password and the environment variable separately - they don't automatically synchronize.
+- While both `postgresql://` and `postgres://` URI formats are valid, Zerops uses the `postgresql://` format. If your software requires `postgres://`, create a custom environment variable with this format.
+- Do not use SSL/TLS protocols for internal connections. Security is assured by the project's private network.
:::
-You can create own custom [environment variables](/features/env-variables) for the PostgreSQL service in Zerops GUI and use them in the same way as the default variables.
+## Connect Remotely
-## Connect to PostgreSQL in Zerops remotely
-
-:::caution
-Due to security reasons Zerops doesn't allow exposing PostgreSQL service directly to the internet.
-:::
+Zerops offers two methods for connecting to your PostgreSQL database from outside the Zerops environment:
-### Start VPN connection
+### Method 1: Connect via Zerops VPN
-You can securely connect to PostgreSQL from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+You can securely connect to PostgreSQL from your local workstation via Zerops VPN:
-1. [Install & setup zCLI](/references/cli)
+1. [Install & set up zCLI](/references/cli)
2. [Start the Zerops VPN](/references/vpn#start-vpn)
+3. Use the connection details from Access Details in the PostgreSQL service detail in Zerops GUI
+4. When finished, [stop the Zerops VPN](/references/vpn#stop-vpn)
-### Access PostgreSQL through VPN
-
-Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](#use-postgresql-environment-variables) are available when connected through VPN. To connect to PostgreSQL in Zerops you have to copy the [access details](#copy-access-details-from-zerops-gui) manually from Zerops GUI.
-
-:::caution
-Do not use SSL/TLS protocols when connecting to PostgreSQL over VPN. Zerops PostgreSQL is not configured to support these protocols. The security is assured by the VPN.
+:::warning Important notes
+* Do not use SSL/TLS protocols when connecting over VPN. Security is provided by the VPN tunnel.
+* If your connection over VPN doesn't work, try adding `.zerops` suffix to the service hostname (e.g., `database1.zerops`). For additional help, check the [VPN troubleshooting page](/references/vpn/troubleshooting).
:::
-### Stop VPN connection
+### Method 2: Connect via Direct IP Access
+
+Direct IP Access uses [pgBouncer](https://www.pgbouncer.org/) for connection pooling and TLS termination.
-[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+Internally, port `5432` is available without SSL. Externally, connections are secured with TLS through pgBouncer (port `6432`) before being routed to your PostgreSQL service.
-### Connect to PostgreSQL from another Zerops project
+#### Enable external access
-All services of the same project share a **dedicated private network**. You can use the service hostname to connect from one service to another within the same project.
+1. Navigate to your PostgreSQL service in the Zerops GUI and choose the **Public Access through IP Addresses** section
+2. Choose either IPv6 (available by default) or IPv4 (requires the [unique IPv4](/features/access#dedicated-ipv4-address-330-days) add-on)
+3. Open one or more ports and point them to your PostgreSQL service (the system will direct them through pgBouncer)
+ - Choose any port from 10-65435 (except 80 and 443)
+ - Select destination service and internal port
+ - Each public port can be mapped to any internal service port
+ - Multiple public ports can point to the same internal port if needed
+ - Port configurations can be set independently for IPv4 and IPv6
+4. Optionally enable firewall protection for additional security
+5. Click the **Publish X IP access change(s)** button to apply your settings
-Different Zerops projects have no special connection. They can communicate with each other only via the internet. If you need to connect to a PostgreSQL service in a Zerops project from a runtime service in another project, you need to use the [Zerops VPN](#access-postgresql-through-vpn). Due to security reasons Zerops doesn't allow exposing PostgreSQL service directly to the internet.
+For database management tools and how to manage users and databases, see [Manage PostgreSQL Users and Databases](/postgresql/how-to/manage).
\ No newline at end of file
diff --git a/apps/docs/content/postgresql/how-to/create.mdx b/apps/docs/content/postgresql/how-to/create.mdx
index 595c6725f..efe641ec4 100644
--- a/apps/docs/content/postgresql/how-to/create.mdx
+++ b/apps/docs/content/postgresql/how-to/create.mdx
@@ -7,6 +7,7 @@ import Image from '/src/components/Image';
import data from '@site/static/data.json';
import UnorderedList from '@site/src/components/UnorderedList';
import Video from '@site/src/components/Video';
+import ResourceTable from '/src/components/ResourceTable';
## Create PostgreSQL using Zerops GUI
@@ -106,11 +107,11 @@ Choose the CPU mode when starting a new service or change it later. The CPU mode
Vertical auto-scaling has the following default configuration:
-| | Minimum resource | Maximum resource |
-| ------------- | ---------------- | ---------------- |
-| **CPU cores** | 1 | 5 |
-| **RAM** | 0.25 GB | 8 GB |
-| **Disk** | 1 GB | 2.5 GB |
+
For most cases, the default parameters will work without issues. If you need to limit the cost of the PostgreSQL service, lower the maximal resources. Zerops will never scale above the selected maximums.
@@ -142,9 +143,9 @@ Zerops uses a YAML format file to describe the project infrastructure.
#### Basic example
-Create a directory `my-project`. Create a `description.yml` file inside the directory with the following content:
+Create a directory `my-project`. Create a `description.yaml` file inside the directory with the following content:
-```yml
+```yaml
# Basic project data
project:
# project name
@@ -163,9 +164,9 @@ The YAML file describes your future project infrastructure. The project will con
#### Full example
-Create a directory `my-project`. Create a `description.yml` file inside the directory with the following content:
+Create a directory `my-project`. Create a `description.yaml` file inside the directory with the following content:
-```yml
+```yaml
# Basic project data
project:
# project name
@@ -210,7 +211,7 @@ The hostname of the first service will be set to `postgresql1`. The [high availa
The hostname of the second service will be set to `postgresql2`. The [single container](#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/scale) will be set.
-#### Description of description.yml parameters
+#### Description of description.yaml parameters
The `project:` section is required. Only one project can be defined.
@@ -242,7 +243,7 @@ The `project:` section is required. Only one project can be defined.
-At least one service in the `services:` section is required. You can create a project with multiple services. The example above contains only PostgreSQL services but you can create a `description.yml` with [different types] of services.
+At least one service in the `services:` section is required. You can create a project with multiple services. The example above contains only PostgreSQL services but you can create a `description.yaml` with [different types] of services.
@@ -277,7 +278,7 @@ At least one service in the `services:` section is required. You can create a pr
Specifies the service type and version.
- See what [PostgreSQL service types](/references/importyml/type-list#database-services) are currently supported.
+ See what [PostgreSQL service types](/references/import-yaml/type-list#database-services) are currently supported.
@@ -363,9 +364,9 @@ At least one service in the `services:` section is required. You can create a pr
The PostgreSQL service **hostname** and **mode** are fixed after the service is created. They can't be changed later.
:::
-### Create a project based on the description.yml
+### Create a project based on the description.yaml
-When you have your `description.yml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
```sh
Usage:
@@ -378,11 +379,11 @@ Flags:
--workingDie string Sets a custom working directory. The default working directory is the current directory. (default "./")
```
-Zerops will create a project and one or more services based on the `description.yml` content.
+Zerops will create a project and one or more services based on the `description.yaml` content.
-The maximum size of the `description.yml` file is 100 kB.
+The maximum size of the `description.yaml` file is 100 kB.
-You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yml`.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
@@ -398,7 +399,7 @@ If you have access to more than one client, you must specify the client ID for w
#### Example
-Create a directory `my-project` if it doesn't exist. Create an `import.yml` file inside the `my-project` directory with following content:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
```bash
# array of project services
@@ -414,9 +415,9 @@ services:
The YAML file describes the list of one or more services that you want to add to your existing project. In the example above, one PostgreSQL service in the [single container mode](#single-container) with default [auto scaling](/postgresql/how-to/scale) configuration will be added to your project. The hostname of the new service will be set to `postgresql1`.
-The content of the `services:` section of `import.yml` is identical to the [project description file](#create-a-project-description-file). The `import.yml` never contains the `project:` section because the project already exists.
+The content of the `services:` section of `import.yaml` is identical to the [project description file](#create-a-project-description-file). The `import.yaml` never contains the `project:` section because the project already exists.
-When your `import.yml` is ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+When your `import.yaml` is ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
```sh
Usage:
@@ -430,4 +431,4 @@ Flags:
zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
-The maximum size of the `import.yml` file is 100 kB.
+The maximum size of the `import.yaml` file is 100 kB.
diff --git a/apps/docs/content/postgresql/how-to/export-import-data.mdx b/apps/docs/content/postgresql/how-to/export-import-data.mdx
index 6986f27f0..f8ddd71ff 100644
--- a/apps/docs/content/postgresql/how-to/export-import-data.mdx
+++ b/apps/docs/content/postgresql/how-to/export-import-data.mdx
@@ -3,25 +3,18 @@ title: Export or import PostgreSQL data
description: Learn how to export or import postgresql data on Zerops.
---
-## Use Adminer to export or import data
+## Use Adminer or phpMyAdmin to export or import data
+* [Adminer ↗](https://www.adminer.org) - an open source full-featured database management tool written in PHP
+* [phpMyAdmin ↗](https://www.phpmyadmin.net) - a free software tool written in PHP, intended to handle the administration of PostgreSQL over the Web
-[Adminer ↗](https://www.adminer.org) is an open source full-featured database management tool written in PHP.
-
-1. [Install Adminer to Zerops](/postgresql/how-to/manage#how-to-install-adminer-to-zerops)
-2. Use Adminer standard export or import functions
-
-## Use phpMyAdmin to export or import data
-
-[phpMyAdmin ↗](https://www.phpmyadmin.net) is a free software tool written in PHP, intended to handle the administration of PostgreSQL over the Web.
-
-1. [Install phpMyAdmin to Zerops](/postgresql/how-to/manage#how-to-install-phpmyadmin-to-zerops)
-2. Use phpMyAdmin standard export or import functions
+1. [Install the tools to Zerops](/postgresql/how-to/manage#installing-management-tools)
+2. Use their standard export or import functions
## Use a database management tool on your workstation to export or import data
Do you already use a database management tool that supports PostgreSQL on your workstation? Connect it securely to PostgreSQL from your local workspace via Zerops VPN.
-Zerops VPN client is included into zCLI, the Zerops command-line tool. To start the VPN connection, read [how to connect to PostgreSQL remotely](/postgresql/how-to/connect#connect-to-postgresql-in-zerops-remotely).
+Zerops VPN client is included into zCLI, the Zerops command-line tool. To start the VPN connection, read [how to connect to PostgreSQL remotely](/postgresql/how-to/connect#connect-remotely).
:::caution
Do not use SSL/TLS protocols when connecting to PostgreSQL over VPN. Zerops PostgreSQL is not configured to support these protocols. The security is assured by the VPN.
:::
@@ -32,9 +25,9 @@ Once the connection to PostgreSQL is established, use the standard export or imp
If you are using the [psql ↗](https://www.postgresql.org/docs/current/app-psql.html) command-line client to manage your PostgreSQL on your local workspace, you can connect it securely to PostgreSQL via Zerops VPN.
-Zerops VPN client is included into zCLI, the Zerops command-line tool. To start the VPN connection, read [how to connect to PostgreSQL remotely](/postgresql/how-to/connect#connect-to-postgresql-in-zerops-remotely).
+Zerops VPN client is included into zCLI, the Zerops command-line tool. To start the VPN connection, read [how to connect to PostgreSQL remotely](/postgresql/how-to/connect#connect-remotely).
-Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/postgresql/how-to/connect#use-postgresql-environment-variables) are available when connected through VPN. To connect to PostgreSQL in Zerops you have to copy the [access details](/postgresql/how-to/connect#connect-to-postgresql-in-zerops-remotely) manually from Zerops GUI.
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/postgresql/how-to/connect#method-2-environment-variables-recommended) are available when connected through VPN. To connect to PostgreSQL in Zerops you have to copy the [access details](/postgresql/how-to/connect#connection-details) manually from Zerops GUI.
Use [psql ↗](https://www.postgresql.org/docs/current/app-psql.html) command to connect to PostgreSQL in Zerops:
diff --git a/apps/docs/content/postgresql/how-to/manage.mdx b/apps/docs/content/postgresql/how-to/manage.mdx
index b8ef2c060..c673ecbc7 100644
--- a/apps/docs/content/postgresql/how-to/manage.mdx
+++ b/apps/docs/content/postgresql/how-to/manage.mdx
@@ -1,148 +1,181 @@
---
-title: Manage PostgreSQL users and databases in Zerops
-description: Learn how you can manage postgresql users and databases on Zerops.
+title: Manage PostgreSQL Users, Databases and Plugins in Zerops
+description: Learn how to manage PostgreSQL users, databases, plugins, and use database administration tools in Zerops.
---
-## Default database and user
+import { Dropdown, DropdownItem } from '/src/components/Dropdown';
+import TabbedCodeBlocks from '/src/components/TabbedCodeBlock';
-Zerops creates a default database and a default user automatically when a new PostgreSQL service is [created](/postgresql/how-to/create).
+This guide covers how to manage your PostgreSQL databases in Zerops, including default setup, database management tools, plugins, and best practices.
-#### Database
+## Default Database and User
-The default database name is identical to the service hostname. The default encoding is set to `utf8mb4`.
+Zerops creates a default database and user automatically when a new PostgreSQL service is [created](/postgresql/how-to/create).
-#### DB user
+### Database
-Default user name is identical to the service hostname. Default user password is generated randomly. You will find the password in [Zerops GUI](/postgresql/how-to/connect#copy-access-details-from-zerops-gui) or you can use the [environment variable](/postgresql/how-to/connect#use-postgresql-environment-variables).
+- **Name**: Identical to the service hostname
+- **Encoding**: `utf8mb4`
-:::info
-Zerops creates a second DB user: `zps` for maintenance reasons with full privileges. Do not delete, change the password or remove privileges from this user, it will disrupt Zerops ability to maintain the database cluster.
-:::
-
-## How to install Adminer to Zerops
-
-[Adminer ↗](https://www.adminer.org) is a open source full-featured database management tool written in PHP.
-
-### Single-click installation
-
-To install Adminer into your project, open your project in Zerops GUI and select **import services** in the left menu.
-
-Copy the following yaml file into the text area and start the import:
-
-```yml
-services:
- - # Service will be accessible through zCLI VPN under: http://adminer
- hostname: adminer
- # Type and version of service used.
- type: php-apache@8.0+2.4
- # Whether the service will be run on one or multiple containers.
- # Since this is a utility service, using a single container is fine.
- minContainers: 1
- maxContainers: 1
- # Folder name used as the root of the publicly accessible web server content.
- documentRoot: public
- # Link to Zerops repository that contains Adminer code with Zerops build and deploy instructions.
- buildFromGit: https://github.com/zeropsio/recipe-adminer@main
-```
-
-When the import is finished, Adminer will be running as a PHP service in your project.
-
-## How to access Adminer
-
-### Use Zerops VPN
+### DB User
-By default Adminer service is private and is accessible from your local workstation over VPN.
+- **Username**: Identical to the service hostname
+- **Password**: Generated randomly
-You can securely connect to PostgreSQL from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
-
-1. [Install & setup zCLI](/references/cli)
-2. [Start the Zerops VPN](/references/vpn)
-3. Type `http://adminer` into your browser
-
-:::caution
-Do not use https when connecting to Adminer via VPN.
+:::info
+For connection methods and environment variables, see the [Connect to PostgreSQL in Zerops](/postgresql/how-to/connect) page.
:::
-### Enable public access
-
-You can enable the public access to the Adminer service via the [Zerops subdomain].
+:::caution Important notes
+- When changing passwords, update both the database user password and the environment variable separately - they don't automatically synchronize.
+- While both `postgresql://` and `postgres://` URI formats are valid, Zerops uses the `postgresql://` format. If your software requires `postgres://`, create a custom environment variable with this format.
+- Do not use SSL/TLS protocols for internal connections. Security is assured by the project's private network.
+:::
-Or you can configure the [Public routing] on the Adminer service to make it accessible on your own domain.
+## Database Management Tools
-## How to install phpMyAdmin to Zerops
+You can use any PostgreSQL management tool of your choice to administer your databases in Zerops. For convenience, Zerops provides ready-to-use recipes for two popular web-based database management tools:
-[phpMyAdmin ↗](https://www.phpmyadmin.net) is a free software tool written in PHP, intended to handle the administration of PostgreSQL over the Web.
+* [AdminerEvo](https://github.com/adminerevo/adminerevo) - developed by the AdminerEvo community and is a continuation of the [Adminer](https://www.adminer.org) project by Jakub Vrána
+* [phpMyAdmin](https://www.phpmyadmin.net) - a popular free database administration tool that works with both MySQL and PostgreSQL databases
-### Single-click installation
+### Installing Management Tools
-To install phpMyAdmin into your project, open your project in Zerops GUI and select **import services** in the left menu.
+You can install these tools with a simple one-click import in Zerops:
-Copy the following yaml file into the text area and start the import:
+1. In Zerops GUI, open your project and select **Import services** from the left menu
+2. Copy and paste one of the following YAML configurations:
-```yml
-services:
- - # Service will be accessible through zCLI VPN under: http://phpmyadmin
- hostname: phpmyadmin
- # Type and version of service used.
+
-## How to access phpMyAdmin
+### Accessing Management Tools
-### Use Zerops VPN
+After installation, you can access these tools via VPN:
-By default phpMyAdmin service is private and is accessible from your local workstation over VPN.
+1. [Start the Zerops VPN](/references/vpn)
+2. Type `http://adminerevo` or `http://phpmyadmin` in your browser
-You can securely connect to PostgreSQL from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
-
-1. [Install & setup zCLI](/references/cli)
-2. [Start the Zerops VPN](/references/vpn)
-3. Type `http://phpmyadmin` into your browser
+:::tip
+Try `http://adminerevo.zerops` or `http://phpmyadmin.zerops` if you encounter any connection issues.
+:::
:::caution
-Do not use https when connecting to phpMyAdmin via VPN.
+Do not use https when connecting to management tools via VPN.
:::
-### Enable public access
+## Database Tools on Your Workstation
-You can enable the public access to the phpMyAdmin service via the [Zerops subdomain].
+You can use various database management tools from your local workstation to connect to your PostgreSQL database in Zerops:
-Or you can configure the [Public routing] on the phpMyAdmin service to make it accessible on your own domain.
+1. **Establish a secure tunnel** using the [Zerops VPN](/references/vpn) to create an encrypted connection to your Zerops project
+2. **Obtain the [connection details](/postgresql/how-to/connect#connection-details)** from Zerops GUI
+ - Environment variables are not available through VPN connections
+3. Connect with your **preferred database tool**
+ - Do not use SSL/TLS (security is provided by the VPN)
+ - **Desktop Database Tools** - popular GUI tools like pgAdmin, DBeaver, DataGrip, or any other PostgreSQL-compatible client will work with Zerops
+ - **Command Line with psql** - connect using the standard PostgreSQL command-line client with the credential obtained above:
+ ```sh
+ psql -h [hostname] -U [user] -d [database_name]
+ ```
-## How to use a database management tool on your workstation
+:::tip
+ Try `{hostname}.zerops` instead of just `{hostname}` if you encounter any connection issues.
+:::
-Do you already use a database management tool that supports PostgreSQL on your workstation? Connect it securely to PostgreSQL from your local workspace via Zerops VPN.
+## How to install and manage PostgreSQL plugins
-Zerops VPN client is included into zCLI, the Zerops command-line tool. To start the VPN connection, read [how to connect to PostgreSQL remotely](/postgresql/how-to/connect#connect-to-postgresql-in-zerops-remotely).
+### Viewing available plugins
+You can list all available PostgreSQL plugins by running the following query *(superuser privileges not required)*:
-:::caution
-Do not use SSL/TLS protocols when connecting to PostgreSQL over VPN. Zerops PostgreSQL is not configured to support these protocols. The security is assured by the VPN.
-:::
+```sql
+SELECT * FROM pg_available_extensions ORDER BY name;
+```
+
+### Installing plugins (requires superuser)
-## How to use psql CLI on your workstation
+1. **Connect with superuser credentials**:
+ - Use the `superUser` (user `postgres`) and `superUserPassword` environment variables from your PostgreSQL service
-If you use the [psql ↗](https://www.postgresql.org/docs/current/app-psql.html) command-line client to manage your PostgreSQL on your local workspace, you can connect it securely to PostgreSQL via Zerops VPN.
+2. **Switch to your service database**:
+ When logging in as the superuser, you're initially in the `postgres` database, not your service database.
-Zerops VPN client is included into zCLI, the Zerops command-line tool. To start the VPN connection, read [how to connect to PostgreSQL remotely](/postgresql/how-to/connect#connect-to-postgresql-in-zerops-remotely).
+3. **Install required extensions**:
+ ```sql
+ CREATE EXTENSION pg_stat_statements;
+ CREATE EXTENSION vector;
+ CREATE EXTENSION postgis;
+ ```
-Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/postgresql/how-to/connect#connect-to-postgresql-in-zerops-remotely) are available when connected through VPN. To connect to PostgreSQL in Zerops you have to copy the [access details](/postgresql/how-to/connect#connect-to-postgresql-in-zerops-remotely) manually from Zerops GUI.
+:::warning
+Currently, it is not possible to add new plugins that are not already listed in `pg_available_extensions`.
+:::
-Use `psql` command to connect to PostgreSQL in Zerops:
+When working with text search functionality, you'll need to reference the correct `stop`, `dict`, and `affix` files when creating dictionaries in your database. These files are essential for proper text search configuration.
-```sh
-psql -h [hostname] -U [user] -p [password] -d [database_name]
-```
+Zerops PostgreSQL includes the following dictionary files:
-:::caution
-Do not use SSL/TLS protocols when connecting to PostgreSQL over VPN. Zerops PostgreSQL is not configured to support these protocols. The security is assured by the VPN.
-:::
+
+
+**Stop word files** - used to remove common words that don't add significant meaning:
+```
+czech.stop
+danish.stop
+dutch.stop
+english.stop
+finnish.stop
+french.stop
+german.stop
+hungarian.stop
+italian.stop
+nepali.stop
+norwegian.stop
+polish.stop
+portuguese.stop
+russian.stop
+slovak.stop
+spanish.stop
+swedish.stop
+turkish.stop
+```
+**Dictionary and affix files** - used for stemming and word normalization:
+```
+cs_CZ.affix
+cs_CZ.dict
+en_US.affix
+en_US.dict
+pl_PL.affix
+pl_PL.dict
+sk_SK.affix
+sk_SK.dict
+```
+**Special rules file:**
+```
+unaccent.rules
+```
+
+
+For more information on text search dictionaries, refer to the [PostgreSQL documentation](https://www.postgresql.org/docs/16/textsearch-dictionaries.html).
\ No newline at end of file
diff --git a/apps/docs/content/postgresql/how-to/scale.mdx b/apps/docs/content/postgresql/how-to/scale.mdx
index 53d3325ef..1c907af5e 100644
--- a/apps/docs/content/postgresql/how-to/scale.mdx
+++ b/apps/docs/content/postgresql/how-to/scale.mdx
@@ -4,6 +4,7 @@ description: Get to know how Zerops scales your postgresql service.
---
import Image from '/src/components/Image';
+import ResourceTable from '/src/components/ResourceTable';
Zerops performs an automated scaling of hardware resources required to run your database based on its usage. If the current use of your database does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your database is under heavy load or needs to store more data, then auto scaling increases the resources for the database to make sure it runs smoothly.
@@ -38,11 +39,11 @@ Choose the CPU mode when starting a new service or change it later. The CPU mode
Vertical auto scaling has following default configuration:
-| | Minimum resource | Maximum resource |
-| ------------- | ---------------- | ---------------- |
-| **CPU cores** | 1 | 5 |
-| **RAM** | 0.25 GB | 8 GB |
-| **Disk** | 1 GB | 2.5 GB |
+
For most cases, the default parameters will work without issues. If you need to limit the cost of the PostgreSQL service, lower the maximal resources. Zerops will never scale above the selected maximums.
@@ -106,7 +107,7 @@ Zerops monitors CPU, RAM and Disk usage in all running containers each 10 second
The **scale up threshold** is derived from following **minimum free resources**:
- 0.1 CPU core
-- 0.25 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
- 0.5 GB disk
If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
@@ -116,7 +117,7 @@ The scale up of RAM or disk is immediate. The scale up of CPU is configured to b
The **minimum step** for the vertical scaling is
- 1 CPU core
-- 0.25 GB RAM
+- 0.125 GB RAM
- 0.5 GB disk
When the database is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
diff --git a/apps/docs/content/postgresql/overview.mdx b/apps/docs/content/postgresql/overview.mdx
index 8fd11b5d7..644c111a3 100644
--- a/apps/docs/content/postgresql/overview.mdx
+++ b/apps/docs/content/postgresql/overview.mdx
@@ -61,7 +61,7 @@ import LargeCard from '@site/src/components/LargeCard';
},
{
type: 'link',
- href: '/postgresql/how-to/connect#connect-to-postgresql-from-runtime-services-of-the-same-project',
+ href: '/postgresql/how-to/connect#connect-from-services-in-the-same-project',
label: 'Connect from the same project',
customProps: {
icon: Icons['link'],
@@ -69,7 +69,7 @@ import LargeCard from '@site/src/components/LargeCard';
},
{
type: 'link',
- href: '/postgresql/how-to/connect#connect-to-postgresql-in-zerops-remotely',
+ href: '/postgresql/how-to/connect#connect-remotely',
label: 'Connect remotely',
customProps: {
icon: Icons['globe-europe'],
@@ -113,7 +113,7 @@ Have you build something that others might find useful? Don't hesitate to share
- sample answer
-
diff --git a/apps/docs/content/python/how-to/access.mdx b/apps/docs/content/python/how-to/access.mdx
index 1f9f00286..e9c172ce7 100644
--- a/apps/docs/content/python/how-to/access.mdx
+++ b/apps/docs/content/python/how-to/access.mdx
@@ -55,7 +55,7 @@ Use the `ssh` command to connect to your service v
## Public access through zerops.io subdomain
-By default, your Python service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zeropsapp-subdomain).
+By default, your Python service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
## Public access through your domain
@@ -63,4 +63,4 @@ By default, your Python service is not publicly accessible. When your applicatio
## Public access from another Zerops project
-All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/python/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zeropsapp-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/python/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
diff --git a/apps/docs/content/python/how-to/build-pipeline.mdx b/apps/docs/content/python/how-to/build-pipeline.mdx
index f29a9539f..3d4ceb891 100644
--- a/apps/docs/content/python/how-to/build-pipeline.mdx
+++ b/apps/docs/content/python/how-to/build-pipeline.mdx
@@ -9,11 +9,11 @@ import UnorderedCodeList from 'docs/src/components/UnorderedCodeList';
Zerops provides a customizable build and runtime environment for your Python application.
-## Add zerops.yml to your repository
+## Add zerops.yaml to your repository
-Start by adding `zerops.yml` file to the **root of your repository** and modify it to fit your application:
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
@@ -74,9 +74,9 @@ The top-level element is always `zerops`.
### Setup
The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
-Zerops supports the definition of multiple runtime services in a single `zerops.yml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yml`:
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
-```yml
+```yaml
zerops:
# definition for app service
- setup: app
@@ -101,7 +101,7 @@ Following options are available for Python builds:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -118,12 +118,12 @@ zerops:
:::info
-You can change the base environment when you need to. Just simply modify the `zerops.yml` in your repository.
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
:::
If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -137,7 +137,7 @@ zerops:
...
```
-See the full list of supported [build base environments](/zerops-yml/base-list#runtime-services).
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
To customize your build environment use the [prepareCommands](/python/how-to/build-pipeline#preparecommands) attribute.
@@ -182,7 +182,7 @@ The base build environment contains:
To install additional packages or tools add one or more prepare commands:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -218,7 +218,7 @@ If any command fails, it returns an exit code other than 0 and the build is canc
Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it.
-```yml
+```yaml
prepareCommands:
- |
apt update
@@ -229,7 +229,7 @@ prepareCommands:
When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command.
-```yml
+```yaml
prepareCommands:
- apt update
- apt install python3-pip # already installed for Python services
@@ -239,7 +239,7 @@ prepareCommands:
_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
-```yml
+```yaml
# REQUIRED. Select which files / folders to deploy after
# the build has successfully finished
deployFiles:
@@ -248,7 +248,7 @@ deployFiles:
Determines files or folders produced by your build, which should be deployed to your runtime service containers.
-The path starts from the **root directory** of your project (the location of `zerops.yml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
@@ -256,20 +256,20 @@ The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/
Deploys a folder, and a file from the project root directory:
-```yml
+```yaml
deployFiles:
- app.py
```
Deploys the whole content of the build container:
-```yml
+```yaml
deployFiles: .
```
Deploys a folder, and a file in a defined path:
-```yml
+```yaml
deployFiles:
- ./path/to/file.txt
- ./path/to/dir/
@@ -281,19 +281,19 @@ Zerops supports the `~` character as a wildcard for one or more folders in the p
Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
-```yml
+```yaml
deployFiles: ./path/~/to/file.txt
```
Deploys all folders that are located in any path that begins with `/path/to/`
-```yml
+```yaml
deployFiles: ./path/to/~/
```
Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
-```yml
+```yaml
deployFiles: ./path/~/to/
```
@@ -313,7 +313,7 @@ For consistency, it's recommended to configure both your `.gitignore` and `.depl
Examples:
-```yml title="zerops.yml"
+```yaml title="zerops.yaml"
zerops:
- setup: app
build:
@@ -340,7 +340,7 @@ This example above ignores `file.txt` in ANY directory named `src`, such as:
_OPTIONAL._ Defines which files or folders will be cached for the next build.
-```yml
+```yaml
# OPTIONAL. Which files / folders you want to cache for the next build.
# Next builds will be faster when the cache is used.
cache: file.txt
@@ -358,7 +358,7 @@ _OPTIONAL._ Defines the environment variables for the build environment.
Enter one or more env variables in following format:
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
@@ -389,7 +389,7 @@ Following options are available for Python builds:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -412,12 +412,12 @@ zerops:
:::info
-You can change the base environment when you need to. Just simply modify the `zerops.yml` in your repository.
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
:::
If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -437,7 +437,7 @@ zerops:
...
```
-See the full list of supported [run base environments](/zerops-yml/base-list).
+See the full list of supported [run base environments](/zerops-yaml/base-list).
To customize your build environment use the `prepareCommands` attribute.
@@ -504,7 +504,7 @@ _OPTIONAL._ Customises the Python runtime environment by installing additional d
prepare commands:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -557,7 +557,7 @@ You can configure your prepare commands to be run in a single shell instance or
The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -576,13 +576,13 @@ zerops:
...
```
-In the example above Zerops will copy the `runtime-config.yml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
### initCommands
_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -622,7 +622,7 @@ _OPTIONAL._ Defines the environment variables for the runtime environment.
Enter one or more env variables in following format:
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
@@ -643,7 +643,7 @@ Read more about [environment variables](/python/how-to/env-variables) in Zerops.
_REQUIRED._ Defines the start command for your Python application.
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -677,7 +677,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -727,7 +727,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -756,7 +756,7 @@ _OPTIONAL._ Defines cron jobs.
Setup cron jobs in the following format:
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
@@ -795,7 +795,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -845,7 +845,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
diff --git a/apps/docs/content/python/how-to/build-process.mdx b/apps/docs/content/python/how-to/build-process.mdx
index df59e7962..e339f192b 100644
--- a/apps/docs/content/python/how-to/build-process.mdx
+++ b/apps/docs/content/python/how-to/build-process.mdx
@@ -44,11 +44,11 @@ The build cancellation is available before the build pipeline is finished. When
The default Python build environment contains:
- {data.alpine.default}
-- selected version of Python defined in `zerops.yml` [build.base](/python/how-to/build-pipeline#base) parameter
+- selected version of Python defined in `zerops.yaml` [build.base](/python/how-to/build-pipeline#base) parameter
- [zCLI](/references/cli), Zerops command line tool
- `pip` and `git`
-If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/python/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](/python/how-to/build-pipeline#preparecommands) commands to your `zerops.yml`.
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/python/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](/python/how-to/build-pipeline#preparecommands) commands to your `zerops.yaml`.
:::info
The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
diff --git a/apps/docs/content/python/how-to/create.mdx b/apps/docs/content/python/how-to/create.mdx
index a0ce080a5..04a215582 100644
--- a/apps/docs/content/python/how-to/create.mdx
+++ b/apps/docs/content/python/how-to/create.mdx
@@ -7,6 +7,7 @@ import Image from '/src/components/Image';
import data from '@site/static/data.json';
import UnorderedList from '@site/src/components/UnorderedList';
import Video from '@site/src/components/Video';
+import ResourceTable from '/src/components/ResourceTable';
Zerops provides a Python runtime service with extensive build support. Python runtime is highly scalable and customisable to suit both development and production.
@@ -81,32 +82,7 @@ Choose the CPU mode when starting a new service or change it later. The CPU mode
Vertical auto scaling has following default configuration:
-
-
-
- Resources Type
- Minimum resource
- Maximum resource
-
-
-
-
- CPU cores
- 1
- 5
-
-
- RAM
- 0.25 GB
- 32 GB
-
-
- Disk
- 5 GB
- 100 GB
-
-
-
+
Python service always starts with the minimal resources.
@@ -183,7 +159,7 @@ Zerops uses a yaml format to describe the project infrastructure.
#### Basic example:
-Create a directory `my-project`. Create an `description.yml` file inside the `my-project` directory with following content:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
```yaml
# basic project data
@@ -206,7 +182,7 @@ services:
S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
```
-The yaml file describes your future project infrastructure. The project will contain one Python version 3.12 service with default [auto scaling](/python/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yml](/python/how-to/build-pipeline#ports). Following secret env variables will be configured:
+The yaml file describes your future project infrastructure. The project will contain one Python version 3.12 service with default [auto scaling](/python/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/python/how-to/build-pipeline#ports). Following secret env variables will be configured:
```env
S3_ACCESS_KEY_ID="P8cX1vVVb"
@@ -215,7 +191,7 @@ S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
#### Full example:
-Create a directory my-project. Create an description.yml file inside the my-project directory with following content:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
```yaml
# basic project data
@@ -264,7 +240,7 @@ services:
The yaml file describes your future project infrastructure. The project will contain a Python service and a [PostgreSQL](/postgresql/overview) service.
-Python service with "app" hostname, the internal port(s) the service listens on will be defined later in the zerops.yml. Python service will run on version 3.12 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+Python service with "app" hostname, the internal port(s) the service listens on will be defined later in the zerops.yaml. Python service will run on version 3.12 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
```env
S3_ACCESS_KEY_ID="P8cX1vVVb"
@@ -273,7 +249,7 @@ S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
-#### Description of description.yml parameters
+#### Description of description.yaml parameters
The `project:` section is required. Only one project can be defined.
@@ -305,7 +281,7 @@ The `project:` section is required. Only one project can be defined.
-At least one service in `services:` section is required. You can create a project with multiple services. The example above contains Python and PostgreSQL services but you can create a `description.yml` with your own combination of [services](/features/infrastructure).
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains Python and PostgreSQL services but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
@@ -335,7 +311,7 @@ At least one service in `services:` section is required. You can create a projec
Specifies the service type and version.
- See what [Python service types](/references/importyml/type-list#runtime-services) are currently supported.
+ See what [Python service types](/references/import-yaml/type-list#runtime-services) are currently supported.
@@ -399,9 +375,9 @@ At least one service in `services:` section is required. You can create a projec
-### Create a project based on the description.yml
+### Create a project based on the description.yaml
-When you have your `description.yml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
```sh
Usage:
@@ -414,11 +390,11 @@ Flags:
--workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
```
-Zerops will create a project and one or more services based on the `description.yml` content.
+Zerops will create a project and one or more services based on the `description.yaml` content.
-Maximum size of the `description.yml` file is 100 kB.
+Maximum size of the `description.yaml` file is 100 kB.
-You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yml`.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
@@ -434,7 +410,7 @@ If you have access to more than one client, you must specify the client ID for w
#### Example:
-Create a directory `my-project` if it doesn't exist. Create an `import.yml` file inside the `my-project` directory with following content:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
```yaml
# basic project data
@@ -464,9 +440,9 @@ S3_ACCESS_KEY_ID="P8cX1vVVb"
S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
```
-The content of the `services:` section of `import.yml` is identical to the project description file. The `import.yml` never contains the `project:` section because the project already exists.
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
-When you have your `import.yml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
```sh
Usage:
@@ -480,4 +456,4 @@ Flags:
zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
-Maximum size of the import.yml file is 100 kB.
+Maximum size of the import.yaml file is 100 kB.
diff --git a/apps/docs/content/python/how-to/customize-runtime.mdx b/apps/docs/content/python/how-to/customize-runtime.mdx
index a755a0d77..5e7e4aa12 100644
--- a/apps/docs/content/python/how-to/customize-runtime.mdx
+++ b/apps/docs/content/python/how-to/customize-runtime.mdx
@@ -22,9 +22,9 @@ The default Python runtime environment contains:
- Git and PIP
:::note
-To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yml/specification#os--1) attribute.
+To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yaml/specification#os--1) attribute.
-Additional packages and tools can be installed using [run.prepareCommands](/zerops-yml/specification#preparecommands--1).
+Additional packages and tools can be installed using [run.prepareCommands](/zerops-yaml/specification#preparecommands--1).
:::
## Runtime Flow
diff --git a/apps/docs/content/python/how-to/deploy-process.mdx b/apps/docs/content/python/how-to/deploy-process.mdx
index e7d25f8d5..97211a54a 100644
--- a/apps/docs/content/python/how-to/deploy-process.mdx
+++ b/apps/docs/content/python/how-to/deploy-process.mdx
@@ -40,7 +40,7 @@ Zerops performs following actions for each new container:
Services with multiple containers are deployed in parallel.
:::info
-If your application needs to be initialized in each runtime container, add [init commands](/python/how-to/build-pipeline#initcommands) to `zerops.yml`.
+If your application needs to be initialized in each runtime container, add [init commands](/python/how-to/build-pipeline#initcommands) to `zerops.yaml`.
:::
:::caution
@@ -58,7 +58,7 @@ The old containers are then removed from the project balancer so they don't rece
## Readiness checks
-If your application isn't ready to handle requests right after it is started via the [start command](/python/how-to/build-pipeline#start), configure a [readiness check](/python/how-to/build-pipeline#readiness-check) in your `zerops.yml`.
+If your application isn't ready to handle requests right after it is started via the [start command](/python/how-to/build-pipeline#start), configure a [readiness check](/python/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
If the readiness check is defined, Zerops will:
@@ -94,7 +94,7 @@ The list of application versions is available in Zerops GUI. Go to the service d
The pipeline detail is accessible from the additional menu. The pipeline detail contains
-- The pipeline config (`zerops.yml`) that was used for the selected version
+- The pipeline config (`zerops.yaml`) that was used for the selected version
- The build log (if available)
- The prepare runtime log (if available)
diff --git a/apps/docs/content/python/how-to/env-variables.mdx b/apps/docs/content/python/how-to/env-variables.mdx
index 99ce45a80..0345b09dd 100644
--- a/apps/docs/content/python/how-to/env-variables.mdx
+++ b/apps/docs/content/python/how-to/env-variables.mdx
@@ -23,12 +23,12 @@ There are 3 different sets of env variables in Zerops:
basic
build
- zerops.yml
+ zerops.yaml
basic
runtime
- zerops.yml
+ zerops.yaml
secret
@@ -41,13 +41,13 @@ There are 3 different sets of env variables in Zerops:
Use the [secret env variables](/python/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
-The basic build and runtime env variables are listed in your [zerops.yml](/zerops-yml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yml and redeploy your application to Zerops.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
You can [reference](/python/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/python/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
## Set secret env variables in Zerops GUI
-Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yml.
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
-
-
- Resources Type
- Minimum resource
- Maximum resource
-
-
-
-
- CPU cores
- 1
- 5
-
-
- RAM
- 0.25 GB
- 32 GB
-
-
- Disk
- 1 GB
- 100 GB
-
-
-
-
+
Python service always starts with the minimal resources.
@@ -207,7 +182,7 @@ The scale up of RAM or disk is immediate. The scale up of CPU is configured to b
The **minimum step** for the vertical scaling is
- 1 CPU core
-- 0.25 GB RAM
+- 0.125 GB RAM
- 0.5 GB disk
When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
diff --git a/apps/docs/content/python/how-to/shared-storage.mdx b/apps/docs/content/python/how-to/shared-storage.mdx
index a99a32ec8..96055c380 100644
--- a/apps/docs/content/python/how-to/shared-storage.mdx
+++ b/apps/docs/content/python/how-to/shared-storage.mdx
@@ -37,15 +37,15 @@ zCLI is the Zerops command-line tool. To create a new Python service via the com
Zerops uses a yaml format to describe the project infrastructure.
-#### description.yml format
+#### description.yaml format
-[Read the basics](/python/how-to/create#create-a-project-description-file) how to define the Python service using the description.yml.
+[Read the basics](/python/how-to/create#create-a-project-description-file) how to define the Python service using the description.yaml.
#### Example with a shared storage
-Create a directory `my-project`. Create an `description.yml` file inside the `my-project` directory with following content:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
-```yml
+```yaml
# basic project data
project:
# project name
@@ -91,4 +91,4 @@ The mount attribute accepts an array of shared storage names you want to mount t
### Create a project with a Python service and a shared storage
-Follow the article [How to create a project based on the description.yml](/python/how-to/create#create-a-project-based-on-the-descriptionyml).
+Follow the article [How to create a project based on the description.yaml](/python/how-to/create#create-a-project-based-on-the-descriptionyaml).
diff --git a/apps/docs/content/python/how-to/trigger-pipeline.mdx b/apps/docs/content/python/how-to/trigger-pipeline.mdx
index 210dbdcfc..32f8ce251 100644
--- a/apps/docs/content/python/how-to/trigger-pipeline.mdx
+++ b/apps/docs/content/python/how-to/trigger-pipeline.mdx
@@ -20,7 +20,7 @@ Integrate Zerops to your GitHub or GitLab repository and configure the automatic
Follow these steps:
-1. Add [zerops.yml](/python/how-to/build-pipeline#add-zeropsyml-to-your-repository) to your repository.
+1. Add [zerops.yaml](/python/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
2. Connect your GitHub repository or connect your GitLab repository
Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
@@ -35,7 +35,7 @@ Then each time you create a new tag or push to a specific branch, depending on t
:::info
-You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yml` in your repository.
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
:::
### Skip the automatic pipeline once
@@ -61,13 +61,13 @@ To start a new build & deploy pipeline manually, use the Zerops CLI.
Follow these steps:
-1. Add `zerops.yml` to your repository.
+1. Add `zerops.yaml` to your repository.
2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
3. Run `zcli push` command.
The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
-The command triggers the [build pipeline](/python/how-to/trigger-pipeline) defined in `zerops.yml`. `zerops.yml` must be in the working directory. The working directory is by default the current directory and can be changed using the `--workingDir` flag.
+The command triggers the [build pipeline](/python/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the `--workingDir` flag.
zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
@@ -90,14 +90,14 @@ Flags:
command is to be executed.
--versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
--workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
- --zeropsYamlPath string Sets a custom path to the zerops.yml file relative to the working directory. By default zCLI
- looks for zerops.yml in the working directory.
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
```
zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
:::info
-You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yml` in your repository.
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
:::
## Manual deploy using Zerops CLI
@@ -106,7 +106,7 @@ To start only a deploy pipeline, use the Zerops CLI.
Follow these steps:
-1. Add [zerops.yml](/python/how-to/build-pipeline#add-zeropsyml-to-your-repository) to your repository. Omit the build section.
+1. Add [zerops.yaml](/python/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
3. Run `zcli service deploy` command.
@@ -121,8 +121,8 @@ Usage:
Flags:
--archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
to the working directory. By default, no archive is created.
- --deployGitFolder Sets a custom path to the zerops.yml file relative to the working directory. By default zCLI
- looks for zerops.yml in the working directory.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
-h, --help the service deploy command.
--projectId string If you have access to more than one project, you must specify the project ID for which the
command is to be executed.
@@ -130,14 +130,14 @@ Flags:
command is to be executed.
--versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
--workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
- --zeropsYamlPath string Sets a custom path to the zerops.yml file relative to the working directory. By default zCLI
- looks for zerops.yml in the working directory.
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
```
`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the `--workingDir` flag.
-`zerops.yml` must be placed in the working directory.
+`zerops.yaml` must be placed in the working directory.
:::info
-You can change the deploy pipeline when you need to. Just simply modify the `zerops.yml` in your working directory.
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
:::
diff --git a/apps/docs/content/python/how-to/upgrade.mdx b/apps/docs/content/python/how-to/upgrade.mdx
index 0e3146931..33162f47e 100644
--- a/apps/docs/content/python/how-to/upgrade.mdx
+++ b/apps/docs/content/python/how-to/upgrade.mdx
@@ -3,6 +3,6 @@ title: How to upgrade the Python version
description: Learn how to upgrade your python service's version
---
-You can upgrade or downgrade your Python service to a different major Python version by setting the `run.base` parameter in your `zerops.yml`. When you [trigger a new pipeline](/python/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Python version. If you don't specify the `run.base` attribute in your `zerops.yml`, Zerops keeps the current Python version for your runtime.
+You can upgrade or downgrade your Python service to a different major Python version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/python/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Python version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Python version for your runtime.
-If you want to build your application with a different major Python version, change the `build.base` parameter in your `zerops.yml`. The `build.base` is the required attribute.
+If you want to build your application with a different major Python version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
diff --git a/apps/docs/content/python/overview.mdx b/apps/docs/content/python/overview.mdx
index c7ae04d3b..644e5ee19 100644
--- a/apps/docs/content/python/overview.mdx
+++ b/apps/docs/content/python/overview.mdx
@@ -23,9 +23,9 @@ As said, there is no need for coding yet, we have created a [Github repository
1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
-2. In the **Projects** box click on **Import a project** and paste in the following yml config ([source ↗](https://github.com/zeropsio/recipe-python-hello-world/blob/main/import-project/description.yml)):
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-python-hello-world/blob/main/import-project/description.yaml)):
-```yml
+```yaml
project:
name: my-first-project
services:
@@ -95,12 +95,12 @@ Do you have any questions? Check the step-by-step tutorial, browse the documenta
},
{
type: 'link',
- href: '/python/how-to/build-pipeline#add-zeropsyml-to-your-repository',
- label: 'zerops.yml',
+ href: '/python/how-to/build-pipeline#add-zeropsyaml-to-your-repository',
+ label: 'zerops.yaml',
customProps: {
icon: Icons['puzzle'],
description:
- 'See a full example of zerops.yml file to create your own app.',
+ 'See a full example of zerops.yaml file to create your own app.',
},
},
{
@@ -151,7 +151,7 @@ Have you build something that others might find useful? Don't hesitate to share
1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
-2. In the **Projects** box click on **Import a project** and paste in the following yml config ([source ↗](https://github.com/zeropsio/recipe-python-hello-world/blob/main/import-project/description.yml)):
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-python-hello-world/blob/main/import-project/description.yaml)):
-```yml
+```yaml
project:
name: my-first-project
services:
diff --git a/apps/docs/content/python/tutorial/runtime-sql.mdx b/apps/docs/content/python/tutorial/runtime-sql.mdx
index b321e70f7..37b776d3d 100644
--- a/apps/docs/content/python/tutorial/runtime-sql.mdx
+++ b/apps/docs/content/python/tutorial/runtime-sql.mdx
@@ -23,7 +23,7 @@ In the detail of each step, you can find a link with more information about the
2. Create a project.
- Learn more about projects in
+ Learn more about projects in
Zerops. See how to import a whole project into Zerops.
@@ -31,7 +31,7 @@ In the detail of each step, you can find a link with more information about the
3. In the left menu, click on Import services , copy & paste the
- contents of the `import-services.yml` config file from the recipe
+ contents of the `import-services.yaml` config file from the recipe
repository of your choice. Then click on Import service .
diff --git a/apps/docs/content/python/tutorial/step-by-step.mdx b/apps/docs/content/python/tutorial/step-by-step.mdx
index 5b6d35a64..135216c8e 100644
--- a/apps/docs/content/python/tutorial/step-by-step.mdx
+++ b/apps/docs/content/python/tutorial/step-by-step.mdx
@@ -23,7 +23,7 @@ In the detail of each step, you can find a link with more information about the
2. Create a project.
- Learn more about projects in
+ Learn more about projects in
Zerops. See how to import a whole project into Zerops.
@@ -31,7 +31,7 @@ In the detail of each step, you can find a link with more information about the
3. In the left menu, click on Import services , copy & paste the
- contents of this yaml file and click on Import service .
+ contents of this yaml file and click on Import service .
Learn more about services in
diff --git a/apps/docs/content/qdrant/overview.mdx b/apps/docs/content/qdrant/overview.mdx
new file mode 100644
index 000000000..b82a12013
--- /dev/null
+++ b/apps/docs/content/qdrant/overview.mdx
@@ -0,0 +1,62 @@
+---
+title: Qdrant
+desc: Production-ready Qdrant vector database on Zerops platform with managed infrastructure, automatic cluster configuration, and built-in high availability.
+---
+
+import UnorderedList from '@site/src/components/UnorderedList';
+import UnorderedCodeList from '@site/src/components/UnorderedCodeList';
+import data from '@site/static/data.json';
+
+[Qdrant](https://qdrant.tech/) on Zerops provides a fully managed vector database solution designed for AI applications. Focus on building vector search features while we handle infrastructure maintenance, high availability, and data protection.
+
+## Supported Versions
+
+Currently supported Qdrant versions:
+
+
+Import configuration version:
+
+
+## Deployment Modes
+
+#### Non-HA Mode
+- Single node setup ideal for development and non-production projects
+- Simple deployment and management
+
+#### HA Cluster
+- Automatically configured with 3 nodes
+- Recommended for production environments
+- Built-in data replication across nodes
+- By default (`automaticClusterReplication=true`), automatically creates replicas of all shards across all three nodes
+ - Can be disabled by setting `automaticClusterReplication` to `false`
+- Automatic cluster recovery and node replacement in case of failures
+
+## Data Backup
+
+Backups are performed in `snapshot` format. For HA Cluster, backups are created on the primary container (leader) and saved to the local disk before being compressed and streamed to backup storage. The local file is then deleted.
+
+For general information about backup frequency and storage limits, see our [Backup documentation](/features/backup).
+
+## Network Architecture & Access
+
+Qdrant can be accessed only from services within the same project, public access is not available.
+
+### API Keys
+API key authentication is required for both HTTP and gRPC API calls. Include the key in your request headers. The keys can be found in generated environment variables of the service:
+
+- **API Key:** Full access API key for administrative operations (creating collections, indexing)
+- **Read-only API Key:** Restricted API key for search operations
+
+#### HTTP API
+- **Port:** `6333`
+- **Connection String:** `http://${hostname}:${port}`
+
+#### gRPC API
+- **Port:** `6334`
+- **gRPC Connection String:** `tcp://${hostname}:${grpcPort}`
+
+## Support
+
+For advanced configurations or custom requirements:
+- Join our [Discord community](https://discord.gg/zeropsio)
+- Contact support via [email](mailto:support@zerops.io)
\ No newline at end of file
diff --git a/apps/docs/content/references/api.mdx b/apps/docs/content/references/api.mdx
new file mode 100644
index 000000000..38d980096
--- /dev/null
+++ b/apps/docs/content/references/api.mdx
@@ -0,0 +1,111 @@
+---
+title: REST API Reference
+desc: Overview of Zerops REST API endpoints and authentication, designed to help you integrate with Zerops programmatically
+---
+
+The Zerops REST API allows you to programmatically interact with Zerops platform by providing access to resources like projects, services, users, billing, and configurations.
+
+## Base URL
+
+All API requests should be made to:
+```
+https://api.app-prg1.zerops.io/api/rest/public
+```
+
+## Authentication
+
+The API uses Bearer token authentication. You can obtain your Personal access token from the **Access Token management** section in the Zerops GUI.
+
+Include the token in the Authorization header:
+```
+Authorization: Bearer
+```
+
+## API Resources
+
+:::note
+Some resource groups have non-obvious naming:
+- `/service-stack` endpoints handle services management
+- `/user-data` endpoints handle environment variables management
+:::
+
+View the [full Swagger documentation](https://api.app-prg1.zerops.io/api/rest/public/swagger) or jump to a specific resource group:
+
+
+
+
+ Group
+ Description
+
+
+
+
+ /app-version
+ Manage application versions, builds, and deployments
+
+
+ /auth
+ Authentication and token management
+
+
+ /billing
+ Billing operations and payment management
+
+
+ /client
+ Client account management
+
+
+ /client-user
+ User management within client accounts
+
+
+ /github
+ GitHub repository connections and authorization
+
+
+ /gitlab
+ GitLab repository connections and authorization
+
+
+ /project
+ Project management operations
+
+
+ /project-env
+ Project environment variables management
+
+
+ /public-http-routing
+ HTTP routing configuration
+
+
+ /public-port-routing
+ Port routing and firewall rules configuration
+
+
+ /service-stack
+ Service stack operations and configuration
+
+
+ /settings
+ System settings and configurations
+
+
+ /user
+ User account management
+
+
+ /user-data
+ Environment variables management
+
+
+ /user-notification
+ User notifications management
+
+
+ /user-token
+ Personal access tokens management
+
+
+
\ No newline at end of file
diff --git a/apps/docs/content/references/cli.mdx b/apps/docs/content/references/cli.mdx
index 0d53e9df5..65afba042 100644
--- a/apps/docs/content/references/cli.mdx
+++ b/apps/docs/content/references/cli.mdx
@@ -6,9 +6,9 @@ description: Learn how to install and use zCLI, the powerful command-line tool f
import CustomCard from '/src/components/CustomCard';
import Image from '/src/components/Image';
-## What is zCLI?
+zCLI is the command-line tool for Zerops that allows users to manage services, simplify interactions, and configure infrastructure directly from the terminal.
-zCLI is the command-line tool for Zerops that allows users to manage services, simplify interactions, configure infrastructure directly from the terminal.
+For detailed information, see the [Configuration](/references/cli/configuration) and [Commands Reference](/references/cli/commands) pages.
## Platforms
@@ -20,20 +20,17 @@ zCLI currently supports:
## Get started
-To get started, you may install **zCLI** globally using [NPM](https://www.npmjs.com) or [Yarn](https://yarnpkg.com/) package manager:
+### Manual Installation
-```sh
-npm i -g @zerops/zcli
-```
+To download the zCLI directly, get the [latest release](https://github.com/zeropsio/zcli/releases) from GitHub.
+
+### Linux/MacOS
```sh
-yarn global add @zerops/zcli
+curl -L https://zerops.io/zcli/install.sh | sh
```
-
- To download the zCLI directly, get the [latest
- ↗](https://github.com/zeropsio/zcli/releases) release from GitHub.
-
+zCLI will be installed inside `/usr/bin` or `/usr/local/bin`.
### Windows
@@ -43,13 +40,17 @@ irm https://zerops.io/zcli/install.ps1 | iex
zCLI will be installed inside `C:\Program Files\` or `C:\Program Files (x86)\`
-### Linux/MacOS
+### Using Package Managers
+
+You can also install zCLI using package managers:
```sh
-curl -L https://zerops.io/zcli/install.sh | sh
+npm i -g @zerops/zcli
```
-zCLI will be installed inside `/usr/bin` or `/usr/local/bin`.
+```sh
+yarn global add @zerops/zcli
+```
### NixOS
@@ -102,8 +103,4 @@ You may use an access token to access Zerops using this command:
```sh
zcli login
-```
-
-## References
-
-[zCLI Commands and Usage](/references/cli/commands)
+```
\ No newline at end of file
diff --git a/apps/docs/content/references/cli/access-logs.mdx b/apps/docs/content/references/cli/access-logs.mdx
deleted file mode 100644
index dca65bab0..000000000
--- a/apps/docs/content/references/cli/access-logs.mdx
+++ /dev/null
@@ -1,59 +0,0 @@
----
-title: How to access logs via zCLI
-description: Learn more about how you can access your logs via zCLI.
----
-
-To start the VPN you need first [install & setup zCLI](/references/cli), the Zerops command-line tool.
-
-## Build log
-
-To access a build log in Zerops CLI use
-
-```sh
-zcli service log --showBuildLogs
-```
-
-The command returns the build log to `stdout` with a streaming option. By default the command returns the last 100 log messages and exits. Use the `--follow` flag to continuously pool for new log messages.
-
-#### Command annotation
-
-```sh
-Usage:
- zcli service log [flags]
-
-Flags:
- --follow If set, zCLI will continuously poll for new log messages. By default, the command will exit
- once there are no more logs to display. To exit from this mode, use Control-C.
- --format string The format of returned log messages. Following formats are supported:
- FULL: This is the default format. Messages will be returned in the complete Syslog format.
- SHORT: Returns only timestamp and log message.
- JSON: Messages will be returned as one JSON object.
- JSONSTREAM: Messages will be returned as stream of JSON objects. (default "FULL")
- --formatTemplate string Set a custom log format. Can be used only with --format=FULL.
- Example: --formatTemplate="{{.timestamp}} {{.severity}} {{.facility}} {{.message}}".
- Supports standard GoLang template format and functions.
- -h, --help the service log command.
- --limit int How many of the most recent log messages will be returned. Allowed interval is <1;1000>.
- Default value = 100. (default 100)
- --messageType string Select either APPLICATION or WEBSERVER log messages to be returned. Default value = APPLICATION. (default "APPLICATION")
- --minimumSeverity string Returns log messages with requested or higher severity. Set either severity number in the interval
- <0;7> or one of following severity codes:
- EMERGENCY, ALERT, CRITICAL, ERROR, WARNING, NOTICE, INFORMATIONAL, DEBUG.
- --projectId string If you have access to more than one project, you must specify the project ID for which the
- command is to be executed.
- --serviceId string If you have access to more than one service, you must specify the service ID for which the
- command is to be executed.
- --showBuildLogs If set, zCLI will return build log messages instead of runtime log messages.
-```
-
-zCLI commands are interactive, when you press enter after `zcli service log`, you will be given a list of your projects to choose from.
-
-## Runtime log
-
-To access the log of the first runtime container in Zerops CLI use
-
-```sh
-zcli service log
-```
-
-The command returns the runtime log of the first container to `stdout` with a streaming option. By default the command returns the last 100 log messages and exits. Use the `--follow` flag to continuously pool for new log messages.
diff --git a/apps/docs/content/references/cli/commands.mdx b/apps/docs/content/references/cli/commands.mdx
index 031b886fe..24c9d4a0b 100644
--- a/apps/docs/content/references/cli/commands.mdx
+++ b/apps/docs/content/references/cli/commands.mdx
@@ -1,280 +1,301 @@
---
-title: Available Commands
-description: The available commands in our command line tool which you can use to interact with Zerops.
+title: Zerops CLI Commands Reference
+description: A comprehensive reference for all available commands in the Zerops command line tool (zcli)
---
-## Usage
+
+## Basic Usage
```sh
-zcli {command} [flags]
+zcli [flags]
```
-### Example output
-
-```sh title="bash"
-Welcome in Zerops!
-You are loged as
-and your VPN connection is not active.
-
-Usage:
-──────
-zcli [flags]
-zcli [command]
-
-Available Commands:
-───────────────────
-completion Generate the autocompletion script for the specified shell
-env Displays global environment variables, their paths and additional options
-help Help about any command
-login Login into Zerops with generated Zerops token
-logout Disconnect from VPN and log out from your Zerops account
-project Project commands group
-push Builds your application in Zerops and deploys it
-scope Scope commands group
-service Zerops service commands group
-show-debug-logs Shows zCLI debug logs
-support How to contact Zerops support for assistance
-version Shows the current zCLI version
-vpn VPN commands group
-
-Flags:
-──────
- -h, --help help for zcli
-
-Use "zcli [command] --help" for more information about a command.
-```
+:::note Tip
+All commands support the `-h, --help` flag which displays help information about the command.
+:::
-## Commands
+:::tip Configuration
+For detailed information about configuration options, environment variables, and logging, see the [Zerops CLI Configuration](/references/cli/configuration) page.
+:::
----
+## Command Groups
+- [Account & VPN](#account--vpn)
+- [Project Management](#project-management)
+- [Service Operations](#service-operations)
+- [Utility Commands](#utility-commands)
+
+## Account & VPN
-### help
+### login
-This command lists available commands and flags on a command by placing `help`, `-h` or `--help` flag after the command.
+Logs you into Zerops using a generated token or your login credentials.
```sh
-zcli help
-# or
-zcli --help
-# or
-zcli -h
+zcli login
```
----
+### logout
-### env
+Disconnects from VPN and logs out from your Zerops account.
-Displays global environment variables, their paths and additional options.
+```sh
+zcli logout
+```
+
+### vpn up
+
+Connects to the Zerops VPN.
```sh
-zcli env [flags]
+zcli vpn up [projectId] [flags]
```
-#### Available flags
-- `-h, --help`: Help for the env command
+**Flags:**
+- `--auto-disconnect` - Automatically disconnect from VPN if already connected
+- `--mtu int` - Set custom MTU value for Wireguard interface (default: 1420)
+- `--projectId string` - Required when you have access to multiple projects
----
+:::note
+You can set a default project ID for VPN connections in a `.zcli.yml` file or via the `ZEROPS_PROJECTID` environment variable. See the [Configuration](/references/cli/configuration) page for details.
+:::
-### completion
+### vpn down
-Generate the autocompletion script for the specified shell.
+Disconnects from the Zerops VPN.
```sh
-zcli completion {bash|fish|powershell|zsh} [flags]
+zcli vpn down
```
-#### Available flags
-- `-h, --help`: Help for completion
-- `--no-descriptions`: Disable completion descriptions (bash only)
+:::note
+For more detailed information about Zerops VPN configuration and troubleshooting, visit the [VPN Documentation](/references/vpn).
+:::
----
+## Project Management
-### login
+### project list
-Logs you into Zerops. Use a generated Zerops token or your login e-mail and password.
+Lists all projects you have access to.
```sh
-zcli login
+zcli project list
```
----
-
-### project
+### project delete
-Project related commands.
+Deletes a project and all its services.
```sh
-zcli project {sub-command} [arguments] [flags]
+zcli project delete [projectId] [flags]
```
-#### Available sub-commands
+**Flags:**
+- `--confirm` - Skip confirmation prompts for destructive operations
+- `--projectId string` - Required when you have access to multiple projects
-- `delete`: Deletes a project and all of its services
-- `list`: Lists all projects
-- `project-import`: Creates a new project with one or more services
-- `service-import`: Creates one or more Zerops services in an existing project
+### project project-import
-#### Available flags
+Creates a new project with one or more services from a YAML definition.
-- `delete`
+```sh
+zcli project project-import [flags]
+```
- - `--confirm`: If set, zCLI will not ask for confirmation of destructive operations
- - `--projectId `: Required if you have access to multiple projects
- - `-h, --help`: Help for project delete
+**Flags:**
+- `--orgId string` - Organization ID where the project should be created (required for multiple organizations)
+- `--workingDir string` - Sets a custom working directory (default: "./")
-- `list`
+### project service-import
- - `-h, --help`: Help for project list
+Creates one or more services in an existing project from a YAML definition.
-- `project-import`
+```sh
+zcli project service-import [flags]
+```
- - `--orgId `: Required if you have access to multiple organizations
- - `--workingDir `: Sets custom working directory (default: "./")
- - `-h, --help`: Help for project import
+**Flags:**
+- `--projectId string` - Required when you have access to multiple projects
----
+### scope project
-### push
+Sets the default project for commands that require a project ID.
```sh
-zcli push {flags}
+zcli scope project [projectId]
```
-#### Available flags
+:::tip
+Instead of using the `scope project` command, you can also set a default project ID in a `.zcli.yml` file or via the `ZEROPS_PROJECTID` environment variable. See the [Configuration](/references/cli/configuration) page for details.
+:::
-- `--archiveFilePath `: Creates a tar.gz archive of the application code at the specified path relative to the working directory. If not set, no archive is created.
-- `--deployGitFolder`: Includes the `.git` folder in the upload. By default, the `.git` folder is excluded.
-- `--projectId `: Required if you have access to multiple projects. Specifies the target project ID for command execution.
-- `--serviceId `: Required if you have access to multiple services. Specifies the target service ID for command execution.
-- `--versionName `: Sets a custom version name. If the `VERSIONNAME` environment variable exists, its value is used automatically.
-- `--workingDir `: Sets a custom working directory. Defaults to the current directory (`./`).
-- `--zeropsYamlPath `: Specifies a custom path to the `zerops.yml` file relative to the working directory. By default, zCLI looks for `zerops.yml` in the working directory.
+### scope reset
----
-
-### scope
+Resets the default project and service scope.
```sh
-zcli scope [sub-command]
+zcli scope reset
```
-#### Available sub-commands
+## Service Operations
-- `project`: Sets the scope for project. All commands that require project ID will use the selected one.
-- `reset`: Resets the scope for project and service.
+### service list
-#### Required parameters
+Lists all services in a project.
-- `project-id`
+```sh
+zcli service list [flags]
+```
----
+**Flags:**
+- `--projectId string` - Required when you have access to multiple projects
-### service
+### service push
-Service related commands.
+Builds your application in Zerops and deploys it. This is the recommended way to deploy your code.
```sh
-zcli service {sub-command} [arguments] [flags]
+zcli service push [serviceIdOrName] [flags]
```
-#### Available sub-commands
-
-- `delete` - Deletes the Zerops service
-- `deploy` - Deploys your application to Zerops
-- `enable-subdomain` - Enables access through Zerops subdomain
-- `list` - Lists all services in the project
-- `log` - Get service runtime or build log to stdout
-- `push` - Builds your application in Zerops and deploys it
-- `start` - Starts the Zerops service
-- `stop` - Stops the Zerops service
+**Flags:**
+- `--archiveFilePath string` - Creates a tar.gz archive with application code
+- `-g, --deployGitFolder` - Include the .git folder in the upload
+- `--disableLogs` - Disable logs during push
+- `-v, --verbose` - Log additional debug data to the zCLI [debug log file](/references/cli/configuration#logging-configuration)
+- `--projectId string` - Required when you have access to multiple projects
+- `--serviceId string` - Required when you have access to multiple services
+- `--setup string` - Choose setup to use from zerops.yml
+- `--versionName string` - Adds a custom version name
+- `--workingDir string` - Sets a custom working directory (default: "./")
+- `-w, --workspaceState string` - Defines version of workspace to push:
+ - `clean` - pushes the HEAD without local changes
+ - `staged` - pushes only staged files
+ - `all` - pushes all staged and unstaged files (default)
+- `--zeropsYamlPath string` - Sets a custom path to the zerops.yml file
-#### Available flags
+:::tip
+You can also use `zcli push` as a shorthand for `zcli service push`.
-- `delete`
+To avoid specifying `--projectId` and `--serviceId` flags repeatedly, you can set default values in a `.zcli.yml` file or via environment variables. See the [Configuration](/references/cli/configuration) page for details.
+:::
- - `--confirm`: If set, zCLI will not ask for confirmation of destructive operations
- - `--projectId `: Required if you have access to multiple projects
- - `--serviceId `: Required if you have access to multiple services
+### service deploy
-- `deploy`
+Deploys your application to Zerops. Similar to `push` but focuses on deployment only.
- - `--archiveFilePath `: Creates a tar.gz archive of the application code at the specified path
- - `--deployGitFolder`: Includes the `.git` folder in the upload
- - `--projectId `: Required if you have access to multiple projects
- - `--serviceId `: Required if you have access to multiple services
- - `--versionName `: Sets a custom version name
- - `--workingDir `: Sets a custom working directory (default: `./`)
- - `--zeropsYamlPath `: Specifies a custom path to the `zerops.yml` file
+```sh
+zcli service deploy [serviceIdOrName]
+```
- See how to use [.deployignore](/zerops-yml/specification#deployignore) file.
+**Flags:**
+Same as service push
command.
-- `enable-subdomain`
+### service start/stop
- - `--projectId `: Required if you have access to multiple projects
- - `--serviceId `: Required if you have access to multiple services
+Commands to start or stop a Zerops service.
-- `list`
+```sh
+zcli service start [serviceIdOrName] [flags]
+zcli service stop [serviceIdOrName] [flags]
+```
- - `--projectId `: Required if you have access to multiple projects
+**Flags for both commands:**
+- `--projectId string` - Required when you have access to multiple projects
+- `--serviceId string` - Required when you have access to multiple services
-- `log`
+### service delete
- - `--follow`: Continuously poll for new log messages
- - `--format `: The format of returned log messages (FULL, SHORT, JSON, JSONSTREAM)
- - `--formatTemplate `: Set a custom log format
- - `--limit `: Number of most recent log messages to return (1-1000, default: 100)
- - `--messageType `: Select APPLICATION or WEBSERVER log messages
- - `--minimumSeverity `: Returns log messages with requested or higher severity
- - `--projectId `: Required if you have access to multiple projects
- - `--serviceId `: Required if you have access to multiple services
- - `--showBuildLogs`: Return build log messages instead of runtime log messages
+Deletes a Zerops service.
-- `push`
+```sh
+zcli service delete [serviceIdOrName] [flags]
+```
- - Same flags as `deploy`
+**Flags:**
+- `--confirm` - Skip confirmation prompts for destructive operations
+- `--projectId string` - Required when you have access to multiple projects
+- `--serviceId string` - Required when you have access to multiple services
-- `start`
+### service enable-subdomain
- - `--projectId `: Required if you have access to multiple projects
- - `--serviceId `: Required if you have access to multiple services
+Enables access to your service through a Zerops subdomain.
-- `stop`
- - `--projectId `: Required if you have access to multiple projects
- - `--serviceId `: Required if you have access to multiple services
+```sh
+zcli service enable-subdomain [serviceIdOrName] [flags]
+```
----
+**Flags:**
+- `--projectId string` - Required when you have access to multiple projects
+- `--serviceId string` - Required when you have access to multiple services
-### show-debug-logs
+### service log
-Log debug-logs
+Gets service runtime or build logs to stdout.
```sh
-zcli show-debug-logs
+zcli service log [serviceIdOrName] [flags]
```
----
+**Flags:**
+- `--follow` - Continuously poll for new log messages
+- `--format ` - Log output format (FULL, SHORT, JSON, JSONSTREAM)
+- `--formatTemplate ` - Custom log format
+- `--limit ` - Number of recent log messages to return (1-1000, default: 100)
+- `--messageType ` - Select APPLICATION or WEBSERVER log messages
+- `--minimumSeverity ` - Filter by severity level
+- `--projectId string` - Required when you have access to multiple projects
+- `--serviceId string` - Required when you have access to multiple services
+- `--showBuildLogs` - Show build logs instead of runtime logs
+
+## Utility Commands
+
+### env
+
+Displays global environment variables and their paths.
+
+```sh
+zcli env
+```
### version
-Shows zCLI's current version
+Shows the current zCLI version.
```sh
zcli version
```
----
+### show-debug-logs
-### vpn
+Displays debug logs for troubleshooting.
```sh
-zcli vpn [up|down] [flags]
+zcli show-debug-logs
```
-#### Available sub-commands
+### support
-- `up`: Connects to the Zerops VPN.
-- `down`: Disconnects from the Zerops VPN.
+Displays information about how to contact Zerops support.
-#### Available flags
+```sh
+zcli support
+```
-- `--auto-disconnect`: if set, zCLI will automatically disconnect from the VPN if it is already connected
-- `--projectId`: if you have access to more than one project, you must specify the project ID for which the command is to be executed
+### completion
+
+Generates shell autocompletion scripts.
+
+```sh
+zcli completion {bash|fish|powershell|zsh}
+```
+
+**Available Shells:**
+- `bash` - Generate autocompletion script for Bash
+- `fish` - Generate autocompletion script for Fish
+- `powershell` - Generate autocompletion script for PowerShell
+- `zsh` - Generate autocompletion script for Zsh
+
+**Example:**
+```sh
+zcli completion bash > ~/.zerops-completion.bash
+echo 'source ~/.zerops-completion.bash' >> ~/.bashrc
+```
\ No newline at end of file
diff --git a/apps/docs/content/references/cli/configuration.mdx b/apps/docs/content/references/cli/configuration.mdx
new file mode 100644
index 000000000..2e8045873
--- /dev/null
+++ b/apps/docs/content/references/cli/configuration.mdx
@@ -0,0 +1,113 @@
+---
+title: Zerops CLI Configuration
+description: Configuration options, environment variables, and logging capabilities for the Zerops command line tool (zcli)
+---
+
+:::tip Commands Reference
+For a comprehensive reference of all available commands, see the [Commands Reference](/references/cli/commands) page.
+:::
+
+## Configuration Overview
+
+You can configure default values for zCLI commands using the following methods (in order of increasing precedence):
+
+1. [Configuration files](#configuration-files)
+2. [Environment variables](#environment-variables)
+3. [Command-line flags](/references/cli/commands)
+
+:::note Precedence
+This precedence order means that command-line flags will override environment variables, which will override settings in configuration files.
+:::
+
+## Configuration Files
+
+zCLI supports configuration via YAML files in the following locations:
+
+1. Global config (user home): `~/.config/zerops/zcli.yaml` or `~/zerops/zcli.yaml`
+2. Project-specific config: `./.zcli.yaml` in the root of your application repository
+
+The system first loads the global config file, then merges in the project-specific config if it exists:
+- Settings unique to the global config are preserved
+- Settings in the project-specific config will override any duplicate keys from the global config
+
+### Configuration File Examples
+
+**Global config file:**
+```yaml
+# Set organization-wide defaults
+workspaceState: "all"
+```
+
+**Project-specific file:**
+```yaml
+# Set project-specific settings
+projectId: "your-project-id"
+serviceId: "your-service-id"
+
+# Override global workspace state for this project
+workspaceState: "clean"
+```
+
+## Environment Variables
+
+### Standard Environment Variables
+
+Any flag can be set via environment variables by:
+- Using the `ZEROPS_` prefix
+- Converting the flag name to uppercase
+- Using the full flag name (not shorthand)
+
+**Example:**
+```sh
+export ZEROPS_WORKSPACESTATE=clean
+export ZEROPS_PROJECTID=your-project-id
+```
+
+### Special Environment Variables
+
+zCLI also recognizes special environment variables that control its behavior:
+
+#### Terminal Mode Configuration
+
+The `ZEROPS_CLI_TERMINAL_MODE` environment variable controls the interactive mode of zCLI:
+
+```sh
+export ZEROPS_CLI_TERMINAL_MODE=
+```
+
+Available modes:
+- `auto` (default): Automatically detects if interactive mode can be used and enables it when possible
+- `enabled`: Forces interactive mode to be enabled
+- `disabled`: Forces interactive mode to be disabled
+
+This setting affects interactive prompts, progress indicators, and other terminal-based user interface elements.
+
+#### Logging Configuration
+
+zCLI maintains a debug log file for the `service push` and `service deploy` commands. This logging feature is designed specifically for debugging purposes. The log file can be found in one of these locations:
+
+**1. Default locations** (checked in this order):
+ - `/var/log/zcli.log` (if zCLI has write permissions)
+ - `~/.config/zerops/zerops.log` (as fallback)
+
+**2. Custom location** (if specified):
+ - Set with `ZEROPS_CLI_LOG_FILE_PATH` environment variable
+
+:::note
+zCLI must have write permissions for the specified log file locations.
+:::
+
+To enable verbose logging with additional debug information, use the `--verbose` flag (or its shorthand `-v`):
+```sh
+zcli service push --verbose
+zcli service push -v
+```
+
+To troubleshoot deployment issues, you can check these log files using commands like `cat` or `tail`:
+```sh
+# View the entire log file
+cat ~/.config/zerops/zerops.log
+
+# Stream new log entries
+tail -f ~/.config/zerops/zerops.log
+```
\ No newline at end of file
diff --git a/apps/docs/content/references/github-integration.mdx b/apps/docs/content/references/github-integration.mdx
index 2a1883fad..ca3e29506 100644
--- a/apps/docs/content/references/github-integration.mdx
+++ b/apps/docs/content/references/github-integration.mdx
@@ -13,8 +13,8 @@ This guide walks you through both integration methods, helping you choose and im
## Prerequisites
-Before starting the integration process, ensure your repository contains a valid `zerops.yml` configuration file located in the root directory. This file is essential for defining the build, deploy, and run processes.
-For detailed information on how to create or modify this file, refer to the [Zerops YAML configuration](/zerops-yml/specification) guide.
+Before starting the integration process, ensure your repository contains a valid `zerops.yaml` configuration file located in the root directory. This file is essential for defining the build, deploy, and run processes.
+For detailed information on how to create or modify this file, refer to the [Zerops YAML configuration](/zerops-yaml/specification) guide.
---
@@ -105,7 +105,7 @@ As an alternative to direct integration, you can use GitHub Actions to manage yo
1. **Create Workflow Configuration**
- Create a new file at `.github/workflows/deploy.yml` in your repository:
+ Create a new file at `.github/workflows/deploy.yaml` in your repository:
```yaml
name: Deploy to Zerops
diff --git a/apps/docs/content/references/gitlab-integration.mdx b/apps/docs/content/references/gitlab-integration.mdx
index 769a08a66..7b9f72395 100644
--- a/apps/docs/content/references/gitlab-integration.mdx
+++ b/apps/docs/content/references/gitlab-integration.mdx
@@ -11,8 +11,8 @@ This guide walks you through the step-by-step process to link your repository, c
## Prerequisites
-Before starting the integration process, ensure your repository contains a valid `zerops.yml` configuration file located in the root directory. This file is essential for defining the build, deploy, and run processes.
-For detailed information on how to create or modify this file, refer to the [Zerops YAML configuration](/zerops-yml/specification) guide.
+Before starting the integration process, ensure your repository contains a valid `zerops.yaml` configuration file located in the root directory. This file is essential for defining the build, deploy, and run processes.
+For detailed information on how to create or modify this file, refer to the [Zerops YAML configuration](/zerops-yaml/specification) guide.
---
diff --git a/apps/docs/content/references/importyml/pre-processor.mdx b/apps/docs/content/references/import-yaml/pre-processor.mdx
similarity index 99%
rename from apps/docs/content/references/importyml/pre-processor.mdx
rename to apps/docs/content/references/import-yaml/pre-processor.mdx
index a84c07393..393676cd9 100644
--- a/apps/docs/content/references/importyml/pre-processor.mdx
+++ b/apps/docs/content/references/import-yaml/pre-processor.mdx
@@ -13,7 +13,7 @@ The `yamlPreprocessor` option in your project & service import YAML allows you t
The `yamlPreprocessor=on` is required as the first line in your import YAML to enable the preprocessor.
-```yml
+```yaml
#yamlPreprocessor=on
project:
name: project
@@ -1206,7 +1206,7 @@ services:
- Generated as a multiline value
- The same value as in APP_PUBLIC_KEY.
- ```yml
+ ```yaml
GENERATED_PUBLIC_KEY: |
-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA1kYEJ7bjBiXzBMI/cC6w
diff --git a/apps/docs/content/references/importyml/type-list.mdx b/apps/docs/content/references/import-yaml/type-list.mdx
similarity index 100%
rename from apps/docs/content/references/importyml/type-list.mdx
rename to apps/docs/content/references/import-yaml/type-list.mdx
diff --git a/apps/docs/content/references/import.mdx b/apps/docs/content/references/import.mdx
index 8f62af0bb..5438dd8d8 100644
--- a/apps/docs/content/references/import.mdx
+++ b/apps/docs/content/references/import.mdx
@@ -6,46 +6,56 @@ description: Learn how to define, import and export projects and services using
import { Dropdown, DropdownItem } from '/src/components/Dropdown';
import { Tooltip } from 'docs-ui';
-The Zerops YAML configuration provides powerful capabilities for both importing and exporting your projects and services. This documentation covers both aspects to help you effectively manage your infrastructure configurations.
+The Zerops YAML configuration provides powerful capabilities for both importing and exporting projects and services. This documentation covers how to define your infrastructure as code and move configurations between environments.
-## Import
+## YAML Configuration Basics
-Create or replicate services in Zerops using YAML definitions. You can do this in two ways:
+The Zerops YAML configuration can be used to create or replicate services in Zerops. You can import configurations in two ways:
-- **Using the GUI**: Import entire projects or specific services with a simple point-and-click interface
+- **Using the GUI**:
+ - **For projects**: In the Zerops dashboard, click on **Import a project** in the Projects section
+ - **For services**: Navigate to a project's details page and click **Import services** in the services section
- **Using the [CLI](/references/cli)**: Run `zcli project project-import` for projects or `zcli project service-import` for individual services
-Both methods provide an easy way to migrate or replicate your infrastructure according to your needs.
+Both methods provide straightforward ways to migrate or replicate infrastructure as needed.
This section provides a comprehensive example of an import YAML configuration file, allowing you to define and import a project and its services with environment variables.
- ```yml
+```yaml
# ==== Define a project to import ====
project:
# REQUIRED. Name of your project
name: project0
# Project description
description: "This project is an example only"
+ # Project core package - LIGHT/SERIOUS
+ corePackage: SERIOUS
# List of project tags for filtering
tags:
- test
- dev
+ # Project-level environment variables
+ envVariables:
+ LOG_LEVEL: info
+ API_VERSION: v1
# ==== Define a list of services to import into the project ====
services:
# REQUIRED. Name of your service
- - hostname: service1
+ - hostname: app
# REQUIRED. Choose from list of supported technologies and their versions
- type: nodejs@latest
+ type: nodejs@22
# HA or NON_HA mode
mode: HA
# Map of secret environment variables
envSecrets:
SECRET_KEY: <@generateRandomString(<32>)>
- DATABASE_HOST: ${db_hostname}
- DATABASE_NAME: ${db_hostname}
+ # Environment variables defined in .env format (automatically creates secret envs)
+ dotEnvSecrets: |
+ APP_KEY=<@generateRandomString(<32>)>
+ DB_PASSWORD=secure123
# Object storage size in GB
objectStorageSize: 2
# Choose object storage policy from a predefined list
@@ -53,26 +63,26 @@ services:
# Define additional policy
objectStorageRawPolicy:
# One time build git repository
- buildFromGit: https://github.com/zeropsio/recipe-nodejs
+ buildFromGit: https://github.com/myorg/myapp
# true or false
enableSubdomainAccess: true
# The higher the sooner the service is created
priority: 1
# Vertical autoscaling configuration object
verticalAutoscaling:
- minVCpu: 1
- maxVCpu: 5
+ minCpu: 1
+ maxCpu: 3
# Choose SHARED or DEDICATED
cpuMode: DEDICATED
minRam: 1
- maxRam: 32
+ maxRam: 4
minDisk: 1
- maxDisk: 100
- startCpuCoreCount:
- minFreeCpuCores:
- minFreeCpuPercent:
- minFreeRamGB:
- minFreeRamPercent:
+ maxDisk: 10
+ startCpuCoreCount: 2
+ minFreeCpuCores: 0.5
+ minFreeCpuPercent: 20
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
# Minimum number of containers
minContainers: 2
# Maximum number of containers
@@ -96,49 +106,43 @@ services:
access_log syslog:server=unix:/dev/log,facility=local1 default_short;
error_log syslog:server=unix:/dev/log,facility=local1;
}
- # zerops.yml service name or full config file
- zeropsSetup:
- build:
- base: nodejs@latest
- buildCommands:
- - echo zerops.yml from import
- - yarn
- - yarn run build
- deployFiles: ./
- cache: node_modules
- run:
- initCommands:
- - |
- if ! zcli bucket s3 create $STORAGE_HOSTNAME $STORAGE_BUCKET_NAME --x-amz-acl=private; then
- echo "The bucket was not created, you have to do it manually!"
- fi
- start: yarn start
+ # Zerops.yaml configuration
+ zeropsSetup: backendapi
+ zeropsYaml:
+ zerops:
+ - setup: backendapi
+ build:
+ base: nodejs@22
+ buildCommands:
+ - npm ci
+ - npm run build
+ deployFiles: ./
+ cache: node_modules
+ run:
+ initCommands:
+ - npm run db:migrate
+ start: npm start
+ # When set to true, enables overriding an existing runtime service with the same hostname and triggers a redeploy
+ override: false
# REQUIRED. Name of your other service
- hostname: teststorage1
type: shared-storage
...
- ```
+```
-:::warning
-This is a general guideline; not all keys are valid for every service type. For technology-specific details, refer to the **Create service** page in the **How To** section of the Zerops documentation.
-:::
-
----
-
:::note
+The example above is a general guideline; not all keys are valid for every service type. For technology-specific details, refer to the **Create service** page in the **How To** section of the Zerops documentation.
+
- `REQUIRED.` If a parent object is defined, the key-value pair is required to be filled. All other key-value pairs are optional.
:::
-### Project Configuration
+## Project Configuration
The project configuration is used to define the project you want to import.
-#### Usage
-
-
-
+### Usage
@@ -150,64 +154,183 @@ The project configuration is used to define the project you want to import.
- project
+ project
object
-
- _REQUIRED, if a whole project is imported_
- Only one project can be defined.
-
+ _REQUIRED, if a whole project is imported_ Only one project can be defined.
- name
+ name
string, REQUIRED
-
- The name of the new project. Duplicates are allowed.
-
+ The name of the new project. Duplicates are allowed.
- description
- string
-
- Description of the new project.
-
+ description
+ string
+ Description of the new project.
- tags
+ corePackage
+ string
+ [Core package](/features/infrastructure#project-core) of the new project. Values: LIGHT /SERIOUS (default LIGHT)
+
+
+ tags
list of strings
-
- One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects.
-
+ One or more string tags. Tags provide better orientation in projects.
+
+
+ envVariables
+ map[string]string
+ [Project-level environment variables](/features/env-variables#project-variables) that are available to all services in the project.
-
-
-```yml
+:::warning
+The `corePackage` value can't be changed later. Make sure to choose a suitable core package for your project.
+:::
+
+This example will create a project named `project0` with [serious core](/features/infrastructure#serious-core) package and the description `This project is an example only`. The project will have two tags: `test` and `dev`, and two environment variables: `LOG_LEVEL` and `API_VERSION`:
+
+```yaml
# ==== Define a project to import ====
project:
# REQUIRED. Name of your project
name: project0
# Project description
description: "This project is an example only"
+ # Project core package
+ corePackage: LIGHT
# List of project tags for filtering
tags:
- test
- dev
+ # Project-level environment variables
+ envVariables:
+ LOG_LEVEL: info
+ API_VERSION: v1
```
-This will create a project with the name `project0` and the description `This project is an example only`. The project will have two tags: `test` and `dev`.
+## Service Configuration
-The `project` object requires only the `name` parameter - both `description` and `tags` are optional.
+The service configuration defines one or more services to import into your project. Services are specified as an array under the `services` key, allowing you to configure multiple services in a single YAML file. You need at least one service and either an existing project to import into or a project defined in the YAML file.
-### Service Configuration
+The Service Configuration section is divided into multiple subsections for better organization:
+- [**Service Basic Configuration**](#service-basic-configuration) - Core parameters like hostname, type, mode, and environment variables
+- [**Service Vertical Autoscaling**](#service-vertical-autoscaling) - CPU, RAM, and disk scaling settings
+- [**Service Horizontal Autoscaling**](#service-horizontal-autoscaling) - Container count scaling settings
+- [**Service Mount Shared Storage**](#service-mount-shared-storage) - Connecting to shared storage services
+- [**Service Nginx Configuration**](#service-nginx-configuration) - Custom web server settings
+- [**Service zerops.yaml Configuration**](#service-zeropsyaml-configuration) - Build and run configurations
-The service configuration is used to define the services, environment variables, and other settings you want to import into the project(You require at least one service and you need to have a project to import into or define the project in the yaml).
+
+
-#### Usage
+```yaml
+#yamlPreprocessor=on
+services:
+ - hostname: app # REQUIRED: Unique service identifier
+ type: nodejs@22 # REQUIRED: Service type and version
+ mode: HA # HA or NON_HA mode (default: NON_HA)
+
+ # Environment variables
+ envSecrets: # Secret environment variables (blurred in GUI)
+ SECRET_KEY: <@generateRandomString(<32>)> # Generated random string
+ dotEnvSecrets: | # Environment vars in .env format
+ APP_KEY=<@generateRandomString(<32>)>
+
+ # Storage configuration
+ objectStorageSize: 2 # Object storage size in GB
+ objectStoragePolicy: public-read-write # Predefined S3 bucket policy
+ # Note: Typically you would use either objectStoragePolicy OR objectStorageRawPolicy, not both
+ objectStorageRawPolicy: | # Custom S3 bucket policy
+ {
+ "Version": "2012-10-17",
+ "Statement": [
+ {
+ "Effect": "Allow",
+ "Principal": "*",
+ "Action": ["s3:GetObject"],
+ "Resource": ["arn:aws:s3:::{{ .BucketName }}/*"]
+ }
+ ]
+ }
+
+ # Build and deployment
+ buildFromGit: https://github.com/myorg/myapp # Git repo for one-time build
+ enableSubdomainAccess: true # Enable public access via Zerops subdomain
+ priority: 1 # Higher priority services are created sooner
+ override: true # When true, triggers redeploy of existing service
+
+ # Vertical autoscaling
+ verticalAutoscaling:
+ minCpu: 1 # Minimum number of virtual CPUs
+ maxCpu: 3 # Maximum number of virtual CPUs
+ cpuMode: DEDICATED # SHARED or DEDICATED CPU mode
+ minRam: 1 # Minimum RAM in GB
+ maxRam: 4 # Maximum RAM in GB
+ minDisk: 1 # Minimum disk space in GB
+ maxDisk: 10 # Maximum disk space in GB
+ startCpuCoreCount: 2 # Initial CPU core count
+ minFreeCpuCores: 0.5 # Min free CPU cores before scaling
+ minFreeCpuPercent: 20 # Min free CPU percentage before scaling
+ minFreeRamGB: 0.5 # Min free RAM in GB before scaling
+ minFreeRamPercent: 20 # Min free RAM percentage before scaling
+
+ # Horizontal autoscaling
+ minContainers: 2 # Minimum number of containers (default: 1, max: 10)
+ maxContainers: 6 # Maximum number of containers (max: 10)
+
+ # Shared storage
+ mount: # List of shared storage services to mount
+ - teststorage1
+
+ # Nginx configuration
+ nginxConfig: |- # Custom nginx configuration
+ server {
+ listen 80 default_server;
+ listen [::]:80 default_server;
+ server_name _;
+ root /var/www/public;
+
+ location / {
+ try_files $uri $uri/ /index.html;
+ }
+
+ access_log syslog:server=unix:/dev/log,facility=local1 default_short;
+ error_log syslog:server=unix:/dev/log,facility=local1;
+ }
+
+ # Zerops.yaml configuration
+ zeropsSetup: backendapi # Service setup name from zeropsYaml or repo
+ zeropsYaml: # Full zerops.yaml configuration
+ zerops:
+ - setup: backendapi
+ build:
+ base: nodejs@22
+ buildCommands:
+ - npm ci
+ - npm run build
+ deployFiles: ./
+ cache: node_modules
+ run:
+ initCommands:
+ - npm run db:migrate
+ start: npm start
+
+ # A second, simpler service example
+ - hostname: teststorage1
+ type: shared-storage
+```
+
+This example includes all possible configuration options for Zerops services. Not all options are required or applicable to every service type. The example shows two services in the same YAML file: a fully configured Node.js API service and a simpler static frontend service.
+
+
+
+### Service Basic Configuration
-
+
@@ -219,14 +342,12 @@ The service configuration is used to define the services, environment variables,
- services
+ services
list of objects, REQUIRED
-
- At least one service is required.
-
+ At least one service is required.
- hostname
+ hostname
string, REQUIRED
The unique service identifier.
@@ -236,36 +357,32 @@ The service configuration is used to define the services, environment variables,
- type
+ type
enum, REQUIRED
-
- Specifies the service type and version. See [supported types](/references/importyml/type-list).
-
+ Specifies the service type and version. See [supported types](/references/import-yaml/type-list).
- mode
+ mode
enum
-
- Values: **HA / NON_HA** (default NON_HA)
- Defines the operation mode of the service.
-
+ Values: HA / NON_HA (default NON_HA) Defines the operation mode of the service.
- envSecrets
+ envSecrets
map[string]string
-
- Environment variables that are blurred by default in Zerops GUI. Can be edited or deleted in Zerops GUI.
-
+ Environment variables that are blurred by default in Zerops GUI. Can be edited or deleted in Zerops GUI.
- objectStorageSize
+ dotEnvSecrets
+ string (multiline)
+ Environment variables in .env file format that are automatically created as secret envs.
+
+
+ objectStorageSize
integer
-
- Object storage size in GB.
-
+ Object storage size in GB.
- objectStoragePolicy
+ objectStoragePolicy
enum
Values: **private / public-read / public-objects-read / public-write / public-read-write / custom**
@@ -273,7 +390,7 @@ The service configuration is used to define the services, environment variables,
- objectStorageRawPolicy
+ objectStorageRawPolicy
json
Define your own AWS S3 bucket access policy. See [AWS docs](https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-policy-language-overview.html) for details.
@@ -281,46 +398,56 @@ The service configuration is used to define the services, environment variables,
- buildFromGit
+ buildFromGit
string (URL)
A URL of a Github or Gitlab repository used for a one-time build of your service.
- enableSubdomainAccess
+ enableSubdomainAccess
boolean
- Default: false
+ Default: `false`
Set `true`, if you want to enable a public access to your service via a Zerops subdomain. Not suitable for production.
- priority
+ priority
integer
Services are sorted before creation by priority in descending order, i.e. the higher the priority the sooner the service is created.
+
+ override
+ boolean
+
+ Default: `false`
+ This only works for **runtime** services.
+ The parameter allows you to replace an existing runtime service with the same hostname byt triggering a redeploy if the service already exists.
+
+
-```yml
+```yaml
#yamlPreprocessor=on
services:
# REQUIRED: Name of your service
-- hostname: service1
+- hostname: app
# REQUIRED: Choose from list of supported technologies and their versions
- type: nodejs@latest
+ type: nodejs@22
# High-Availability or Non-High-Availability mode
mode: HA
# Map of secret environment variables
envSecrets:
SECRET_KEY: <@generateRandomString(<32>)>
- DATABASE_HOST: ${db_hostname}
- DATABASE_NAME: ${db_hostname}
+ # Environment variables in .env format
+ dotEnvSecrets: |
+ APP_KEY=<@generateRandomString(<32>)>
# Object storage size in GB
objectStorageSize: 2
# Choose object storage policy from a predefined list
@@ -328,34 +455,37 @@ services:
# Define additional policy
objectStorageRawPolicy:
# One time build git repository
- buildFromGit: https://github.com/zeropsio/recipe-nodejs-hello-world@main
+ buildFromGit: https://github.com/myorg/myapp
# Enables public access via zerops.app subdomain
enableSubdomainAccess: true
# The higher the sooner the service is created
priority: 1
+ # When set to true, triggers a redeploy of an existing runtime service with the same hostname
+ override: false
```
-This yaml will create a `nodejs@latest` service named `service1` in `HA` (High-Availability) mode with the following configurations:
-- Environment variables: `SECRET_KEY`(requires yamlPreprocessor), `DATABASE_HOST` and `DATABASE_NAME`(requires you to have a db service in the same project)
+This yaml will create a `nodejs@latest` service named `app` in `HA` (High-Availability) mode with the following configurations:
+- Environment variables:
+ - From `envSecrets`: `SECRET_KEY` (requires yamlPreprocessor)
+ - From `dotEnvSecrets`: `APP_KEY` in .env format (requires yamlPreprocessor)
- Object storage: 2GB with `public-read-write` policy
-- Git repository: `https://github.com/zeropsio/recipe-nodejs-hello-world@main`
+- Git repository: `https://github.com/zeropsio/recipe-nodejs`
- Public access enabled via Zerops subdomain
- Priority: 1
+- Override existing service: `false`
-The `services` object allows you to define one or more services in the same yaml file and you can define the same parameters like `hostname`, `type`, `mode`, `envSecrets`, `objectStorageSize`, `objectStoragePolicy`, `objectStorageRawPolicy`, `buildFromGit`, `enableSubdomainAccess`, `priority` for each service no matter if it's runtime, database, etc.
+The `services` object allows you to define one or more services in the same yaml file.
:::caution
-The `yamlPreprocessor` option in your project & service import YAML is required to generate random secret values, passwords, and public/private key pairs. For more information, see the [yamlPreprocessor](/references/importyml/pre-processor) page.
+The `yamlPreprocessor` option in your project & service import YAML is required to generate random secret values, passwords, and public/private key pairs. For more information, see the [yamlPreprocessor](/references/import-yaml/pre-processor) page.
:::
-### Vertical Autoscaling Configuration
+### Service Vertical Autoscaling
-The vertical autoscaling configuration is used to define the vertical autoscaling settings for the service.
-
-#### Usage
+The vertical autoscaling configuration defines how the service can scale its resources vertically.
-
+
@@ -367,78 +497,78 @@ The vertical autoscaling configuration is used to define the vertical autoscalin
- minVCpu
+ minCpu
integer
Minimum number of virtual CPUs
- maxVCpu
+ maxCpu
integer
Maximum number of virtual CPUs
- cpuMode
+ cpuMode
enum
Values: **SHARED / DEDICATED**
- minRam
+ minRam
float
Minimum RAM in GB that each container of the service can scale down to.
- maxRam
+ maxRam
float
Maximum RAM in GB that each container of the service can scale up to.
- minDisk
+ minDisk
float
Minimum disk space in GB that each container of the service can scale down to.
- maxDisk
+ maxDisk
float
Maximum disk space in GB that each container of the service can scale up to.
- startCpuCoreCount
+ startCpuCoreCount
integer
Number of CPU cores with which each container starts.
- minFreeCpuCores
+ minFreeCpuCores
float
Minimum number of unused CPU cores before a container starts scaling.
- minFreeCpuPercent
+ minFreeCpuPercent
float
Minimum percentage of unused CPU cores before a container starts scaling.
- minFreeRamGB
+ minFreeRamGB
float
Minimum unused memory in GB before a container starts scaling.
- minFreeRamPercent
+ minFreeRamPercent
float
Minimum percentage of unused memory before a container starts scaling.
@@ -449,73 +579,64 @@ The vertical autoscaling configuration is used to define the vertical autoscalin
-```yml
+```yaml
services:
- hostname: app
- type: php-nginx@8.4
- buildFromGit: https://github.com/example/app
+ type: nodejs@22
+ buildFromGit: https://github.com/myorg/myapp
enableSubdomainAccess: true
verticalAutoscaling:
- minVCpu: 1
- maxVCpu: 5
- # Choose SHARED or DEDICATED
- cpuMode: DEDICATED
- minRam: 1
- maxRam: 32
- minDisk: 1
- maxDisk: 100
- startCpuCoreCount:
- minFreeCpuCores:
- minFreeCpuPercent:
- minFreeRamGB:
- minFreeRamPercent:
+ minCpu: 1 # Minimum number of virtual CPUs
+ maxCpu: 3 # Maximum number of virtual CPUs
+ cpuMode: DEDICATED # SHARED or DEDICATED CPU mode
+ minRam: 1 # Minimum RAM in GB
+ maxRam: 4 # Maximum RAM in GB
+ minDisk: 1 # Minimum disk space in GB
+ maxDisk: 10 # Maximum disk space in GB
+ startCpuCoreCount: 2 # Initial CPU core count
+ minFreeCpuCores: 0.5 # Min free CPU cores before scaling
+ minFreeCpuPercent: 20 # Min free CPU percentage before scaling
+ minFreeRamGB: 0.5 # Min free RAM in GB before scaling
+ minFreeRamPercent: 20 # Min free RAM percentage before scaling
```
This yaml will create a service with the hostname `app` with `php-nginx@8.4` runtime with `HA` High-Availability mode for vertical autoscaling:
-- CPU: `1-5` virtual CPUs in `DEDICATED` mode
-- RAM: `1-32 GB`
-- Disk Space: `1-100 GB`
-
-The `VerticalAutoscaling` map allows you to define the vertical autoscaling settings for the service with parameters like `minVCpu`, `maxVCpu`, `cpuMode`, `minRam`, `maxRam`, `minDisk`, `maxDisk`, `startCpuCoreCount`, `minFreeCpuCores`, `minFreeCpuPercent`, `minFreeRamGB`, `minFreeRamPercent`.
+- CPU: `1-3` virtual CPUs in `DEDICATED` mode
+- RAM: `1-4 GB`
+- Disk Space: `1-10 GB`
-### Horizontal Autoscaling Configuration
+### Service Horizontal Autoscaling
The horizontal autoscaling configuration is used to define the horizontal autoscaling settings for the service.
-#### Usage
-
-
-
-
-
-
- Field
- Type
- Description
-
-
-
-
- minContainers
- integer
- Default: 1, maximum value: 6 - Minimum number of containers of the service.
-
+
+
- maxContainers
- integer
- Maximum value: 6 - Maximum number of containers of the service.
+ Field
+ Type
+ Description
-
-
-
-
+
+
+
+ minContainers
+ integer
+ Minimum number of containers of the service. Default: 1, maximum value: 10
+
+
+ maxContainers
+ integer
+ Maximum number of containers of the service. Maximum value: 10
+
+
+
-```yml
+```yaml
services:
- hostname: app
- type: php-nginx@8.4
- buildFromGit: https://github.com/example/app
+ type: nodejs@22
+ buildFromGit: https://github.com/zeropsio/recipe-php
enableSubdomainAccess: true
# Minimum number of containers
minContainers: 2
@@ -523,13 +644,11 @@ services:
maxContainers: 6
```
-The `minContainers` and `maxContainers` parameters allow you to define the minimum and maximum number of containers(It automatically scales the service between the minimum and maximum number of containers) for the service.
+The `minContainers` and `maxContainers` parameters allow you to define the minimum and maximum number of containers for the service. The service will automatically scale between these values as needed.
-### Mount Shared Storage
+### Service Mount Shared Storage
-The mount shared storage configuration is used to define the shared storage to mount to the service.
-
-#### Usage
+The mount shared storage configuration defines which shared storage services should be mounted to the service.
@@ -541,31 +660,28 @@ The mount shared storage configuration is used to define the shared storage to m
- mount
+ mount
list of strings
Mount shared storage to the service. `buildFromGit` must be filled.
-```yml
+```yaml
services:
- hostname: app
- type: php-nginx@8.4
- buildFromGit: https://github.com/example/app
+ type: nodejs@22
+ buildFromGit: https://github.com/myorg/myapp
enableSubdomainAccess: true
mount:
- teststorage1
```
-The `mount: |-` parameter allows you to mount a shared storage(should be created inside the project) to the service.
-
-
-### Using Nginx Configuration
+The `mount:` parameter allows you to mount a shared storage (which should be created inside the project) to the service.
-The nginx configuration is used to define the nginx settings for the service.
+### Service Nginx Configuration
-#### Usage
+The nginx configuration defines the nginx settings for the service.
@@ -577,22 +693,19 @@ The nginx configuration is used to define the nginx settings for the service.
- nginxConfig
+ nginxConfig
string (multiline)
Insert full nginx config.
-```yml
+```yaml
#yamlPreprocessor=on
services:
- hostname: app
type: php-nginx@8.4
- buildFromGit: https://github.com/example/app
enableSubdomainAccess: true
- envSecrets:
- APP_KEY: <@generateRandomString(<32>)>
nginxConfig: |-
server {
listen 80 default_server;
@@ -610,13 +723,11 @@ services:
}
```
-The `nginxConfig: |-` parameter allows you to use a custom nginx configuration for the service.
-
-### Using zerops.yml Configuration
+The `nginxConfig: |-` parameter allows you to specify a custom nginx configuration for the service.
-This shows you how you can use the `zeropsSetup` parameter as a way to insert a full [zerops.yml configuration file](/zerops-yml/specification) into your service using import yaml.
+### Service zerops.yaml Configuration
-#### Usage
+The `zeropsSetup` and `zeropsYaml` parameters provide flexibility in how you define and use your service configurations. Both parameters are optional and work together in the following ways:
@@ -628,39 +739,57 @@ This shows you how you can use the `zeropsSetup` parameter as a way to insert a
- zeropsSetup
- string or object
- Provide the name of the service from your zerops.yml (find it under `-setup: {name}`) or insert full [zerops.yml configuration file](/zerops-yml/specification).
+ zeropsSetup
+ string
+ Specifies which service setup to use. This should match a setup name found in either the `zeropsYaml` parameter (if provided) or the `zerops.yaml` file in the repository root. If not specified, defaults to the service hostname.
+
+
+ zeropsYaml
+ object
+ Contains the full [zerops.yaml configuration](/zerops-yaml/specification). If provided, this will be used instead of looking for a `zerops.yaml` file in the repository.
-```yml
-#yamlPreprocessor=on
+```yaml
services:
- hostname: app
- type: php-nginx@8.4
- buildFromGit: https://github.com/example/app
- enableSubdomainAccess: true
- envSecrets:
- APP_KEY: <@generateRandomString(<32>)>
- zeropsSetup:
- build:
- base: php-nginx@8.4
- buildCommands:
- - composer install
- deployFiles: ./
- cache: vendor
- run:
- initCommands:
- - |
- if ! zcli bucket s3 create $STORAGE_HOSTNAME $STORAGE_BUCKET_NAME --x-amz-acl=private; then
- echo "The bucket was not created, you have to do it manually!"
- fi
- start: yarn start
+ 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
```
-The `zeropsSetup: |-` parameter allows you to use a custom [zerops.yml](/zerops-yml/specification) configuration for the service.
+#### How They Work Together
+
+- **Neither parameter specified**:
+ - The system looks for a `zerops.yaml` file in the repository root
+ - It searches for a setup with a name that matches the service hostname
+- **Only `zeropsSetup` specified**:
+ - The system looks for a setup with the specified name in the `zerops.yaml` file in the repository root
+- **Only `zeropsYaml` specified**:
+ - The system uses the provided YAML configuration instead of looking for a file in the repository
+ - It searches for a setup with a name that matches the service hostname
+- **Both parameters specified**:
+ - The system uses the provided `zeropsYaml` configuration
+ - It specifically looks for the setup named in `zeropsSetup` within that YAML
+
+If the specified `zeropsSetup` does not exist in the available YAML configuration (either provided in `zeropsYaml` or found in the repository), the import will fail.
## Export
@@ -675,14 +804,14 @@ The exported YAML follows the same structure as the import YAML configuration de
### How to Export
#### Exporting a Single Service
-Navigate to your service dashboard in the Zerops GUI, click the three-dot menu (⋮), and choose **Export service as yaml**.
+Navigate to your service dashboard in the Zerops GUI, click the three-dot menu (⋮) in the top-right corner of the service card, and choose **Export service as yaml**.
#### Exporting an Entire Project
-In the Zerops GUI, click the three-dot menu (⋮) in the project dashboard and select **Export project as yaml**.
+In the Zerops GUI, go to the project dashboard, click the three-dot menu (⋮) in the top-right corner of the project card, and select **Export project as yaml**.
### Using Exported Configurations
-The exported YAML files are compatible with both:
+The exported YAML files are compatible with:
- The Zerops GUI import functionality
- The `zcli project project-import` command
- The `zcli project service-import` command (for single service exports)
diff --git a/apps/docs/content/references/ssh.mdx b/apps/docs/content/references/ssh.mdx
index d86693a01..922e20c4e 100644
--- a/apps/docs/content/references/ssh.mdx
+++ b/apps/docs/content/references/ssh.mdx
@@ -16,14 +16,14 @@ Before establishing an SSH connection to your runtime service, you must first co
### 1. Configure VPN Access
-The [Zerops CLI (zCLI)](/references/cli) comes bundled with the [Zerops VPN](/references/vpn) client. To connect to your [Zerops project](/features/infrastructure#project):
+The [Zerops CLI (zCLI)](/references/cli) comes bundled with the [Zerops VPN](/references/vpn) client. To connect to your [Zerops project](/features/infrastructure#projects):
1. [Install and configure zCLI](/references/cli)
2. [Initialize the Zerops VPN connection](/references/vpn#start-vpn)
### 2. Establish SSH Connection
-Once your VPN session is active, you can connect to any [service](/features/infrastructure#services--containers) using its hostname:
+Once your VPN session is active, you can connect to any [service](/features/infrastructure#services) using its hostname:
```sh
ssh
@@ -94,5 +94,5 @@ SSH connections should not be used for making persistent changes to your service
- In [HA mode](/features/scaling-ha), changes via SSH affect only the current container
- Container replacements or scaling events will deploy the original application version
- For persistent changes across all containers, use:
- - [`run.prepareCommands`](/zerops-yml/specification#preparecommands--1)
- - [`run.initCommands`](/zerops-yml/specification#initcommands-)
\ No newline at end of file
+ - [`run.prepareCommands`](/zerops-yaml/specification#preparecommands--1)
+ - [`run.initCommands`](/zerops-yaml/specification#initcommands-)
\ No newline at end of file
diff --git a/apps/docs/content/references/vpn/troubleshooting.mdx b/apps/docs/content/references/vpn/troubleshooting.mdx
index 8cf401313..67469935c 100644
--- a/apps/docs/content/references/vpn/troubleshooting.mdx
+++ b/apps/docs/content/references/vpn/troubleshooting.mdx
@@ -12,21 +12,27 @@ zcli vpn down
zcli vpn up
```
-## 2. macOS Hostname Resolution
-**Problem**: Even with VPN successfully connected, hostname resolution fails on macOS with errors like:
+## 2. Hostname Resolution
+**Problem**: Even with VPN successfully connected, hostname resolution fails with errors like:
```
could not translate host name "hostname" to address: nodename nor servname provided, or not known
```
-**Solution**: On macOS, append `.zerops` to the hostname, even when VPN shows as connected:
+* The issue is known to happen rarely on Windows
+
+**Solution**: Append `.zerops` to the hostname, even when VPN shows as connected:
```bash
# Instead of
-psql -h hostname -U user
+psql -h [hostname] -U [user]
# Use
-psql -h hostname.zerops -U user
+psql -h [hostname].zerops -U [user]
```
+:::tip Windows OS tip
+In the Advanced TCP/IP Settings dialog, navigate to the DNS tab and confirm that "zerops" appears in the "Append these DNS suffixes (in order)" list. If missing, add it using the Add button.
+:::
+
## 3. WSL2 VPN Connection
**Problem**: VPN not running in WSL2
diff --git a/apps/docs/content/references/zsc.mdx b/apps/docs/content/references/zsc.mdx
index b6c678783..b0f979146 100644
--- a/apps/docs/content/references/zsc.mdx
+++ b/apps/docs/content/references/zsc.mdx
@@ -5,202 +5,440 @@ description: Interacting with zerops containers by connecting to the project net
import Image from '/src/components/Image';
-Zerops Setup Control (zsc) is a cli tool / helper installed to all containers, runtime and build,
-which allows some direct modifications, like triggering scaling from inside the container,
-adding new technologies, making sure that commands (like migration) run only once (even when
-staring some high available setup with 3 containers)
+Zerops Setup Control (zsc) is a command-line utility automatically installed in all Zerops containers enabling developers to manage and control container environments directly from within both runtime and build contexts.
-:::info
-Zsc is automatically installed in all containers and is available both in runtime and build environments.
-:::
+Zerops Setup Control provides essential capabilities for container management, including resource scaling, technology installation, and environment configuration.
+
+Zerops Setup Control commands can be executed in two ways:
+
+- **Manual execution**:
+ - From the web terminal interface in Zerops GUI
+ - Using SSH connections to your containers
+- **Automated execution**:
+ - As part of your `zerops.yaml` configuration file
+
+## Usage
+
+```sh
+zsc [flags]
+```
-## Command Overview
+## Commands
+
+---
+
+### help
+
+This command lists available commands and flags on a command by placing `help`, `-h` or `--help` flag after the command.
```sh
+zsc help
+# or
zsc --help
-Zerops SetupControl CLI
+# or
+zsc -h
+```
-Usage:
- zsc [command]
+---
-Available Commands:
- action Perform specific predefined actions within the container
- backup-create creates a new backup of the specified stack
- backup-current Create a new backup of the current stack
- completion Generate the autocompletion script for the specified shell
- connectSharedStorage Connect shared storage to the container
- crontab Perform crontab actions defined in zerops.yml
- execOnce Execute a command once for the provided key
- fail-me Fail current container
- help Help about any command
- install Run install commands for the specified base
- noop Infinitely blocking command that does nothing
- scale Scale container CPU or memory instantly*
- setSecretEnv Set an secret environment variable in the current stack context
- test Run various tests
- version application version
+### completion
-Flags:
- -h, --help help for zsc
+Generate the autocompletion script for zsc for the specified shell.
-Use "zsc [command] --help" for more information about a command.
+```sh
+zsc completion [command]
```
-## Available Commands
+#### Available sub-commands
+- `bash`: Generate the autocompletion script for bash
+- `fish`: Generate the autocompletion script for fish
+- `powershell`: Generate the autocompletion script for powershell
+- `zsh`: Generate the autocompletion script for zsh
+
+#### Available flags
+- `-h, --help`: Help for the completion command
-### backup-create and backup-current
+---
+
+### backup-create
-The `backup-create` command lets you create a backup of any specified stack in your project, while `backup-current` command creates a backup of the stack you're currently working in.
+Creates a backup of any specified stack in your project.
```sh
-# Create backup of a specified stack
-zsc backup-create
+zsc backup-create
+```
+
+#### Required parameters
+- `stackName`: Name of the stack to backup
-# Create backup of the current stack you're working in
-zsc backup-current
+#### Available flags
+- `-h, --help`: Help for the backup-create command
+
+#### Example
+```sh
+zsc backup-create db
```
-:::info
-Backups include all the data and configurations of the stack at the time of backup creation. These can be used for recovery or creating duplicate environments.
+---
+
+### cdn
+
+Manages CDN (Content Delivery Network) operations for your Zerops services.
+
+```sh
+zsc cdn [command]
+```
+
+#### Available sub-commands
+- `purge`: Invalidates cached content from the CDN for a specific domain. The purge command allows you to ensure that the most up-to-date content is being served to visitors after making updates to your site.
+
+#### Available flags
+- `-h, --help`: Help for the cdn command
+
+#### Examples
+```sh
+# Purge all CDN cache for a specific domain
+zsc cdn purge example.com
+# Purge all content using wildcard pattern
+zsc cdn purge example.com "/*"
+# Purge CDN cache for a specific file (note the $ suffix)
+zsc cdn purge example.com "/path/to/my-file$"
+# Purge CDN cache for a specific directory
+zsc cdn purge example.com "/images/"
+```
+
+:::important
+- This command must be executed in any container within the project that has the CDN-enabled domain active
+- Currently, the purge command only works for the [Static Mode](/features/cdn#static-mode) CDN
:::
+---
+
+### shared-storage
+
+Manages shared storage volumes for persistent data storage.
+
+```sh
+zsc shared-storage [command]
+```
-### connectSharedStorage
+#### Available sub-commands
+- `mount`: Mounts the shared storage
+- `unmount`: Unmounts the shared storage
+- `wait`: Waits for readiness of the storage mount
-This command lets you connect a shared storage volume to your service for persistent data storage.
+#### Available flags
+- `-h, --help`: Help for the shared-storage command
+#### Examples
```sh
-zsc connectSharedStorage
+# View shared-storage help
+zsc shared-storage --help
+
+# Mount a shared storage volume
+zsc shared-storage mount
+
+# Unmount a shared storage volume
+zsc shared-storage unmount
+
+# Wait for a storage mount to be ready
+zsc shared-storage wait
```
+---
+
### crontab
-This command lets you manage scheduled tasks that are defined in your zerops.yml configuration.
+
+Manages scheduled tasks that are defined in your zerops.yaml configuration.
```sh
-zsc crontab
+zsc crontab [command]
```
+#### Available sub-commands
+- `list`: List all crontabs defined in zerops.yaml
+- `run`: Execute crontab command defined in zerops.yaml
+
+#### Available flags
+- `-h, --help`: Help for the crontab command
+
+---
+
### execOnce
-:::info
-This command is particularly useful in high-availability setups to ensure commands (like database migrations) run only once, even when starting multiple containers.
-:::
+Execute a command exactly once across all containers in a service, preventing duplicate execution in high-availability setups.
+
+```sh
+zsc execOnce [flags] -- [args...]
+```
-This command lets you execute a command exactly once across all containers in a service. Useful for database migrations in high-availability setups.
+#### Required parameters
+* ``: A unique identifier for the execution
+* `--`: Standard separator indicating the end of options and beginning of the command
+* ` [args...]`: The actual command to execute and its arguments
+#### Available flags
+- `-r, --retryUntilSuccessful`: Retry command until it succeeds
+- `-v, --verbose`: Verbose output
+- `-h, --help`: Help for the execOnce command
+
+#### Behavior
+- **On success**: All containers proceed with their tasks
+- **On failure**: All containers report the command as failed
+- **With --retryUntilSuccessful**: The command is retried on a different container until it succeeds
+
+#### Examples
```sh
-zsc execOnce "db-migration" "php artisan migrate"
+# Execute a command once for the entire service stack
+zsc execOnce someStaticKey -- /var/www/myBinary some initial command --flag="value" --flag2="value2"
+
+# Run migrations for each new app version deployed to Zerops
+zsc execOnce ${ZEROPS_appVersionId} -- php /var/bin/console migrations:continue
```
+:::info
+This command is ideal for database migrations, initialization scripts, and other operations that should only run once in clustered environments.
+:::
+
+---
+
### fail-me
-This command lets you deliberately fail the current container for testing purposes.
+
+Deliberately fails the current container for testing purposes.
```sh
zsc fail-me
```
+#### Available flags
+- `-h, --help`: Help for the fail-me command
+
+---
+
### install
-You can install additional base technologies in your runtime container that weren't specified in the initial configuration.
-:::info
-The `install` command allows you to add technologies that weren't specified in the initial base configuration.
-:::
+Run install commands for the specified base technology in your runtime container.
+
+```sh
+zsc install [flags]
+```
+
+#### Required parameters
+- `baseName`: The technology and version to install - see the full list of supported [base environments](/zerops-yaml/base-list).
+
+#### Available flags
+- `--buildBase `: Build base (default "php@8.4")
+- `--buildOs `: Build os (default "alpine")
+- `-m, --mode `: Mode (default "RUNTIME")
+- `--runBase `: Run base (default "php-nginx@8.4")
+- `--runOs `: Run os (default "alpine")
+- `-h, --help`: Help for the install command
+
+#### Examples
+```sh
+zsc install rust@1.78
+zsc install dotnet@8
+zsc install nginx@1.22
+```
-Example usage in `zerops.yml`:
+#### Example usage in `zerops.yaml`
```yaml
zerops:
- setup: nodejsapp
build:
os: ubuntu
- base:
+ base:
- nodejs@22
- - python@3.7
- run:
+ - python@3.11
+ run:
os: ubuntu
base: nodejs@22
prepareCommands:
- - zsc install python@3.7
+ - zsc install python@3.11
```
+---
+
### noop
-An infinitely blocking command that does nothing and keeps the container alive so that it doesn't end because of an error. The command runs indefinitely until it receives a SIGTERM signal.
+
+Keep a container alive indefinitely with a non-terminating process.
+
+```sh
+zsc noop [flags]
+```
+
+#### Available flags
+- `-s, --silent`: Disables output to StdOut
+- `-h, --help`: Help for the noop command
+
+#### Examples
+```sh
+zsc noop
+zsc noop --silent
+```
:::info
-The `noop` command is particularly useful for debugging build failures by keeping the container alive for investigation.
+The `noop` command is especially useful for:
+- Debugging build failures by keeping containers alive for investigation
+- Supporting applications that run as background daemons
+- Keeping service containers active when your app doesn't have a foreground process
+- As a start command in zerops.yaml for services that don't have a natural blocking command
:::
+#### Usage in zerops.yaml
+```yaml
+zerops:
+ - setup: myapp
+ run:
+ start: zsc noop
+ ports:
+ - port: 8080
+ http: true
+```
+
+---
+
+### resources
+
+Displays the current resource scaling configuration for the container.
+
```sh
-zsc noop [--silent]
+zsc resources
```
-The `--silent` flag suppresses any output from the command.
+#### Available flags
+- `-h, --help`: Help for the resources command
+
+#### Example output
+```json
+{
+ "cpuCoreCount": 1,
+ "memoryGBytes": 0.25,
+ "diskGBytes": 1
+}
+```
+
+#### Related commands
+- `zsc scale`: Dynamically adjust resource allocations
+
+---
### scale
-This command dynamically adjusts CPU or memory resources for the current container.
-:::caution
-If there aren't enough resources available on the current node, using `scale` may trigger a container move to another node. This will reset the scale duration.
-:::
+Dynamically adjust CPU or memory resources for the current container for a specified duration.
```sh
-# Scale CPU
-zsc scale cpu auto # Reset to automatic scaling
-zsc scale cpu 5 1h # Scale to 5 CPU cores for 1 hour
-zsc scale cpu +2 30m # Add 2 CPU cores for 30 minutes
+zsc scale {cpu|ram} { |auto}
+```
-# Scale Memory
-zsc scale memory auto # Reset to automatic scaling
-zsc scale memory 5GB 1h # Scale to 5GB RAM for 1 hour
-zsc scale memory +2.5GB 600s # Add 2.5GB RAM for 600 seconds
+#### Required parameters
+- `cpu|ram`: Resource type to scale (either CPU cores or RAM)
+- ` ` or `auto`: Scale value and duration, or "auto" to disable custom scaling
+
+#### Available flags
+- `-h, --help`: Help for the scale command
+
+#### Supported values
+- **For RAM**: Value must be suffixed by a unit (KiB, MiB, GiB); number may be a float.
+- **For CPU**: Value must not be suffixed; number must be an integer.
+- **"auto"**: Disables any custom scaling set via this command and must be used without the duration parameter.
+- **"min"** and **"max"**: Set the container to its CURRENT min and max values.
+- Numeric values can be prefixed with **"+"** for relative scaling, adding the requested value to currently used resources.
+- Duration must be suffixed by a unit (s = seconds, m = minutes, h = hours, d = days) and cannot be less than 10 minutes.
+
+#### Examples
+```sh
+zsc scale cpu auto
+zsc scale cpu 5 1h
+zsc scale cpu +2 30m
+zsc scale cpu min 10m
+zsc scale ram auto
+zsc scale ram 5GB 1h
+zsc scale ram +2.5GB 600s
+zsc scale ram max 10m
```
:::info
-- Scaling takes effect within ~10 seconds
-- Duration must be at least 10 minutes
-- Supported values: "auto", "min", "max", or numeric values
-- RAM values require units (KiB, MiB, GiB)
-- CPU values must be integers without units
-- Use "+" prefix for relative scaling
+- Resource adjustments take effect within approximately 10 seconds
+- The container cannot be scaled above or below its max/min resources set in the vertical autoscaling configuration
+- If you scale to a value that exceeds the maximum set limit (e.g., 10GB RAM when max is 5GB), the container will only receive the maximum allowed resources
+- If service limits are changed while custom scaling is active, the container will automatically adjust to the new boundaries
+- If the service auto-scaling configuration is updated, you must call the scale command again to apply custom scaling
:::
-### test tcp
-This command verifies TCP connectivity to a specified host and port.
+:::caution
+If there are insufficient resources on the current server, the container might be moved to another node with available resources, which will reset the scale duration.
+The container will scale down automatically if resources are not utilized, or if the scale command duration expires.
+:::
+
+---
+
+### test
+
+Run diagnostic tests to verify connectivity and service availability.
```sh
-zsc test tcp : [--timeout ] [--dialTimeout ] [-4] [-6]
+zsc test tcp : [flags]
```
-- **``**: Server address to connect to
-- **``**: Port number to connect to
-- **`--timeout `**: Maximum test duration (default: 30s)
-- **`--dialTimeout `**: Single attempt timeout (default: 2s)
-- **`-4`**: Force IPv4
-- **`-6`**: Force IPv6
+#### Required parameters
+- `:`: Host and port to test connectivity to
-Example:
+#### Available flags
+- `--timeout `: Maximum test duration (default: 30s)
+- `--dialTimeout `: Single attempt timeout (default: 2s)
+- `-4`: Force IPv4
+- `-6`: Force IPv6
+- `-h, --help`: Help for the test tcp command
+
+#### Example
```sh
+# Test TCP connection to a host
+zsc test tcp api.zerops:80
zsc test tcp database:5432 --timeout 1m
```
+---
+
### setSecretEnv
-This command sets a secret environment variable in the current stack context.
+
+Securely update environment variables containing sensitive information.
```sh
-zsc setSecretEnv [key] [content] [flags]
+zsc setSecretEnv
```
-Examples:
+#### Arguments
+- `key`: The name of the environment variable to set
+- `content`: The new value for the variable, or `-` to read from stdin
+
+#### Available flags
+- `-h, --help`: Help for the setSecretEnv command
+
+#### Examples
```sh
-# Direct value
+# Set a secret environment variable directly
zsc setSecretEnv SECRET_KEY "new_value"
-# From stdin
+# Set a secret environment variable from stdin (useful for multi-line values or piping)
echo "new_value" | zsc setSecretEnv SECRET_KEY -
+
+# Set a secret API key from a file
+cat api_key.txt | zsc setSecretEnv API_KEY -
```
+:::info
+Secret environment variables are encrypted at rest and securely distributed to your containers. Use this command for storing sensitive configuration like API keys, tokens, and passwords.
+:::
+
+---
+
### version
-This command displays the current version of Zsc CLI.
+
+Displays the current version of Zsc CLI.
```sh
zsc version
```
+#### Available flags
+- `-h, --help`: Help for the version command
\ No newline at end of file
diff --git a/apps/docs/content/rust/faq.mdx b/apps/docs/content/rust/faq.mdx
deleted file mode 100644
index e818e3718..000000000
--- a/apps/docs/content/rust/faq.mdx
+++ /dev/null
@@ -1,10 +0,0 @@
----
-title: Frequently Asked Questions
-description: Get quick answers to your related questions about Rust from frequently asked questions by people at Zerops.
----
-
-import { FAQ, FAQItem } from '/src/components/Faq';
-
-
- sample answer
-
diff --git a/apps/docs/content/rust/how-to/access.mdx b/apps/docs/content/rust/how-to/access.mdx
index 61b20b786..7f8ce98fb 100644
--- a/apps/docs/content/rust/how-to/access.mdx
+++ b/apps/docs/content/rust/how-to/access.mdx
@@ -55,7 +55,7 @@ Use the `ssh` command to connect to your service v
## Public access through zerops.io subdomain
-By default, your Rust service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zeropsapp-subdomain).
+By default, your Rust service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
## Public access through your domain
@@ -63,4 +63,4 @@ By default, your Rust service is not publicly accessible. When your application
## Public access from another Zerops project
-All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/rust/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zeropsapp-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/rust/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
diff --git a/apps/docs/content/rust/how-to/build-pipeline.mdx b/apps/docs/content/rust/how-to/build-pipeline.mdx
index a25369f88..809af3cb3 100644
--- a/apps/docs/content/rust/how-to/build-pipeline.mdx
+++ b/apps/docs/content/rust/how-to/build-pipeline.mdx
@@ -9,11 +9,11 @@ import UnorderedCodeList from 'docs/src/components/UnorderedCodeList';
Zerops provides a customizable build and runtime environment for your Rust application.
-## Add zerops.yml to your repository
+## Add zerops.yaml to your repository
-Start by adding `zerops.yml` file to the **root of your repository** and modify it to fit your application:
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
@@ -75,9 +75,9 @@ The top-level element is always `zerops`.
### Setup
The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
-Zerops supports the definition of multiple runtime services in a single `zerops.yml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yml`:
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
-```yml
+```yaml
zerops:
# definition for app service
- setup: app
@@ -102,7 +102,7 @@ Following options are available for Rust builds:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -119,12 +119,12 @@ zerops:
:::info
-You can change the base environment when you need to. Just simply modify the `zerops.yml` in your repository.
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
:::
If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -138,7 +138,7 @@ zerops:
...
```
-See the full list of supported [build base environments](/zerops-yml/base-list#runtime-services).
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
To customize your build environment use the [prepareCommands](/rust/how-to/build-pipeline#preparecommands) attribute.
@@ -183,7 +183,7 @@ The base build environment contains:
To install additional packages or tools add one or more prepare commands:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -223,7 +223,7 @@ You can configure your prepare commands to be run in a single shell instance or
_REQUIRED._ Defines build commands.
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -250,7 +250,7 @@ Before the build commands are triggered the build container contains:
Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it.
-```yml
+```yaml
buildCommands:
- |
cargo b --release
@@ -260,7 +260,7 @@ buildCommands:
When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command.
-```yml
+```yaml
buildCommands:
- cargo b --release
```
@@ -269,7 +269,7 @@ buildCommands:
If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/rust/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the --verbose option.
-```yml
+```yaml
buildCommands:
- cargo b --release
```
@@ -280,7 +280,7 @@ If the command ends successfully, it returns the exit code 0 and Zerops triggers
_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
-```yml
+```yaml
# REQUIRED. Select which files / folders to deploy after
# the build has successfully finished
deployFiles:
@@ -289,7 +289,7 @@ deployFiles:
Determines files or folders produced by your build, which should be deployed to your runtime service containers.
-The path starts from the **root directory** of your project (the location of `zerops.yml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
@@ -297,20 +297,20 @@ The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/
Deploys a folder, and a file from the project root directory:
-```yml
+```yaml
deployFiles:
- target/release/~app
```
Deploys the whole content of the build container:
-```yml
+```yaml
deployFiles: .
```
Deploys a folder, and a file in a defined path:
-```yml
+```yaml
deployFiles:
- ./path/to/file.txt
- ./path/to/dir/
@@ -322,19 +322,19 @@ Zerops supports the `~` character as a wildcard for one or more folders in the p
Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
-```yml
+```yaml
deployFiles: ./path/~/to/file.txt
```
Deploys all folders that are located in any path that begins with `/path/to/`
-```yml
+```yaml
deployFiles: ./path/to/~/
```
Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
-```yml
+```yaml
deployFiles: ./path/~/to/
```
:::note Example
@@ -353,7 +353,7 @@ For consistency, it's recommended to configure both your `.gitignore` and `.depl
Examples:
-```yml title="zerops.yml"
+```yaml title="zerops.yaml"
zerops:
- setup: app
build:
@@ -380,7 +380,7 @@ This example above ignores `file.txt` in ANY directory named `src`, such as:
_OPTIONAL._ Defines which files or folders will be cached for the next build.
-```yml
+```yaml
# OPTIONAL. Which files / folders you want to cache for the next build.
# Next builds will be faster when the cache is used.
cache: file.txt
@@ -398,7 +398,7 @@ _OPTIONAL._ Defines the environment variables for the build environment.
Enter one or more env variables in following format:
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
@@ -429,7 +429,7 @@ Following options are available for Rust builds:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -453,12 +453,12 @@ zerops:
:::info
-You can change the base environment when you need to. Just simply modify the zerops.yml in your repository.
+You can change the base environment when you need to. Just simply modify the zerops.yaml in your repository.
:::
If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -478,7 +478,7 @@ zerops:
...
```
-See the full list of supported [run base environments](/zerops-yml/base-list).
+See the full list of supported [run base environments](/zerops-yaml/base-list).
To customize your build environment use the `prepareCommands` attribute.
@@ -547,7 +547,7 @@ _OPTIONAL._ Customises the Rust runtime environment by installing additional dep
more prepare commands:
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -608,14 +608,14 @@ You can configure your prepare commands to be run in a single shell instance or
The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
# ==== how to build your application ====
build:
...
- addToRunPrepare: ./runtime-config.yml
+ addToRunPrepare: ./runtime-config.yaml
# ==== how to run your application ====
run:
@@ -627,13 +627,13 @@ zerops:
...
```
-In the example above Zerops will copy the `runtime-config.yml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
### initCommands
_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -673,7 +673,7 @@ _OPTIONAL._ Defines the environment variables for the runtime environment.
Enter one or more env variables in following format:
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
@@ -694,7 +694,7 @@ Read more about [environment variables](/rust/how-to/env-variables) in Zerops.
_REQUIRED._ Defines the start command for your Rust application.
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -728,7 +728,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -778,7 +778,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -807,7 +807,7 @@ _OPTIONAL._ Defines cron jobs.
Setup cron jobs in the following format:
-```yml
+```yaml
zerops:
# define hostname of your service
- setup: app
@@ -846,7 +846,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
@@ -896,7 +896,7 @@ Following attributes are available:
**Example:**
-```yml
+```yaml
zerops:
# hostname of your service
- setup: app
diff --git a/apps/docs/content/rust/how-to/build-process.mdx b/apps/docs/content/rust/how-to/build-process.mdx
index 4991cceb1..7183306fa 100644
--- a/apps/docs/content/rust/how-to/build-process.mdx
+++ b/apps/docs/content/rust/how-to/build-process.mdx
@@ -45,11 +45,11 @@ The build cancellation is available before the build pipeline is finished. When
The default Rust build environment contains:
- {data.alpine.default}
-- selected version of Rust defined in `zerops.yml` [build.base](/rust/how-to/build-pipeline#base) parameter
+- selected version of Rust defined in `zerops.yaml` [build.base](/rust/how-to/build-pipeline#base) parameter
- [zCLI](/references/cli), Zerops command line tool
- `npm`, `yarn`, `git` and `npx` tools
-If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/rust/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](/rust/how-to/build-pipeline#preparecommands) commands to your `zerops.yml`.
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/rust/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](/rust/how-to/build-pipeline#preparecommands) commands to your `zerops.yaml`.
:::info
The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
@@ -95,7 +95,7 @@ This will force Zerops to run the next build clean, including all prepare comman
If any [build command](/rust/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/rust/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `--verbose` option.
-```yml
+```yaml
buildCommands:
- cargo build --release -v
```
diff --git a/apps/docs/content/rust/how-to/create.mdx b/apps/docs/content/rust/how-to/create.mdx
index ee1887d86..98e17f9d0 100644
--- a/apps/docs/content/rust/how-to/create.mdx
+++ b/apps/docs/content/rust/how-to/create.mdx
@@ -7,6 +7,7 @@ import Image from '/src/components/Image';
import data from '@site/static/data.json';
import UnorderedList from '@site/src/components/UnorderedList';
import Video from '@site/src/components/Video';
+import ResourceTable from '/src/components/ResourceTable';
Zerops provides a Rust runtime service with extensive build support. Rust runtime is highly scalable and customisable to suit both development and production.
@@ -81,33 +82,7 @@ Choose the CPU mode when starting a new service or change it later. The CPU mode
Vertical auto scaling has following default configuration:
-
-
-
- Resources Type
- Minimum resource
- Maximum resource
-
-
-
-
- CPU cores
- 1
- 5
-
-
- RAM
- 0.25 GB
- 32 GB
-
-
- Disk
- 1 GB
- 100 GB
-
-
-
-
+
Rust service always starts with the minimal resources.
@@ -184,7 +159,7 @@ Zerops uses a yaml format to describe the project infrastructure.
#### Basic example:
-Create a directory `my-project`. Create an `description.yml` file inside the `my-project` directory with following content:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
```yaml
# basic project data
@@ -207,7 +182,7 @@ services:
S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
```
-The yaml file describes your future project infrastructure. The project will contain one Rust version 18 service with default [auto scaling](/rust/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yml](/rust/how-to/build-pipeline#ports). Following secret env variables will be configured:
+The yaml file describes your future project infrastructure. The project will contain one Rust version 18 service with default [auto scaling](/rust/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/rust/how-to/build-pipeline#ports). Following secret env variables will be configured:
```env
S3_ACCESS_KEY_ID="P8cX1vVVb"
@@ -216,7 +191,7 @@ S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
#### Full example:
-Create a directory my-project. Create an description.yml file inside the my-project directory with following content:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
```yaml
# basic project data
@@ -265,7 +240,7 @@ services:
The yaml file describes your future project infrastructure. The project will contain a Rust service and a [PostgreSQL](/postgresql/overview) service.
-Rust service with "app" hostname, the internal port(s) the service listens on will be defined later in the [zerops.yml](/rust/how-to/build-pipeline#ports). Rust service will run on version 18 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+Rust service with "app" hostname, the internal port(s) the service listens on will be defined later in the [zerops.yaml](/rust/how-to/build-pipeline#ports). Rust service will run on version 18 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
```env
S3_ACCESS_KEY_ID="P8cX1vVVb"
@@ -274,7 +249,7 @@ S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
-#### Description of description.yml parameters
+#### Description of description.yaml parameters
The `project:` section is required. Only one project can be defined.
@@ -306,7 +281,7 @@ The `project:` section is required. Only one project can be defined.
-At least one service in `services:` section is required. You can create a project with multiple services. The example above contains Rust and PostgreSQL services but you can create a `description.yml` with your own combination of [services](/features/infrastructure).
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains Rust and PostgreSQL services but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
@@ -336,7 +311,7 @@ At least one service in `services:` section is required. You can create a projec
Specifies the service type and version.
- See what [Rust service types](/references/importyml/type-list#runtime-services) are currently supported.
+ See what [Rust service types](/references/import-yaml/type-list#runtime-services) are currently supported.
@@ -418,9 +393,9 @@ At least one service in `services:` section is required. You can create a projec
-### Create a project based on the description.yml
+### Create a project based on the description.yaml
-When you have your `description.yml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
```sh
Usage:
@@ -433,11 +408,11 @@ Flags:
--workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
```
-Zerops will create a project and one or more services based on the `description.yml` content.
+Zerops will create a project and one or more services based on the `description.yaml` content.
-Maximum size of the `description.yml` file is 100 kB.
+Maximum size of the `description.yaml` file is 100 kB.
-You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yml`.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
@@ -453,7 +428,7 @@ If you have access to more than one client, you must specify the client ID for w
#### Example:
-Create a directory `my-project` if it doesn't exist. Create an `import.yml` file inside the `my-project` directory with following content:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
```yaml
# basic project data
@@ -483,9 +458,9 @@ S3_ACCESS_KEY_ID="P8cX1vVVb"
S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
```
-The content of the `services:` section of `import.yml` is identical to the project description file. The `import.yml` never contains the `project:` section because the project already exists.
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
-When you have your `import.yml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
```sh
Usage:
@@ -499,4 +474,4 @@ Flags:
zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
-Maximum size of the import.yml file is 100 kB.
+Maximum size of the import.yaml file is 100 kB.
diff --git a/apps/docs/content/rust/how-to/customize-runtime.mdx b/apps/docs/content/rust/how-to/customize-runtime.mdx
index 8bae3eb24..0e215d1f1 100644
--- a/apps/docs/content/rust/how-to/customize-runtime.mdx
+++ b/apps/docs/content/rust/how-to/customize-runtime.mdx
@@ -22,9 +22,9 @@ The default Rust runtime environment contains:
- Git
:::note
-To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yml/specification#os--1) attribute.
+To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yaml/specification#os--1) attribute.
-Additional packages and tools can be installed using [run.prepareCommands](/zerops-yml/specification#preparecommands--1).
+Additional packages and tools can be installed using [run.prepareCommands](/zerops-yaml/specification#preparecommands--1).
:::
### Runtime Flow
diff --git a/apps/docs/content/rust/how-to/deploy-process.mdx b/apps/docs/content/rust/how-to/deploy-process.mdx
index 70f33c87a..1578579a6 100644
--- a/apps/docs/content/rust/how-to/deploy-process.mdx
+++ b/apps/docs/content/rust/how-to/deploy-process.mdx
@@ -40,7 +40,7 @@ Zerops performs following actions for each new container:
Services with multiple containers are deployed in parallel.
:::info
-If your application needs to be initialized in each runtime container, add [init commands](/rust/how-to/build-pipeline#initcommands) to `zerops.yml`.
+If your application needs to be initialized in each runtime container, add [init commands](/rust/how-to/build-pipeline#initcommands) to `zerops.yaml`.
:::
:::caution
@@ -58,7 +58,7 @@ The old containers are then removed from the project balancer so they don't rece
## Readiness checks
-If your application isn't ready to handle requests right after it is started via the [start command](/rust/how-to/build-pipeline#start), configure a [readiness check](/rust/how-to/build-pipeline#readiness-check) in your `zerops.yml`.
+If your application isn't ready to handle requests right after it is started via the [start command](/rust/how-to/build-pipeline#start), configure a [readiness check](/rust/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
If the readiness check is defined, Zerops will:
@@ -94,7 +94,7 @@ The list of application versions is available in Zerops GUI. Go to the service d
The pipeline detail is accessible from the additional menu. The pipeline detail contains
-- The pipeline config (`zerops.yml`) that was used for the selected version
+- The pipeline config (`zerops.yaml`) that was used for the selected version
- The build log (if available)
- The prepare runtime log (if available)
diff --git a/apps/docs/content/rust/how-to/env-variables.mdx b/apps/docs/content/rust/how-to/env-variables.mdx
index 1e56dd03d..15392851f 100644
--- a/apps/docs/content/rust/how-to/env-variables.mdx
+++ b/apps/docs/content/rust/how-to/env-variables.mdx
@@ -23,12 +23,12 @@ There are 3 different sets of env variables in Zerops:
basic
build
- zerops.yml
+ zerops.yaml
basic
runtime
- zerops.yml
+ zerops.yaml
secret
@@ -40,13 +40,13 @@ There are 3 different sets of env variables in Zerops:
Use the [secret env variables](/rust/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
-The basic build and runtime env variables are listed in your [zerops.yml](/zerops-yml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yml and redeploy your application to Zerops.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
You can [reference](/rust/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/rust/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
## Set secret env variables in Zerops GUI
-Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yml.
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
-
-
- Resources Type
- Minimum resource
- Maximum resource
-
-
-
-
- CPU cores
- 1
- 5
-
-
- RAM
- 0.25 GB
- 32 GB
-
-
- Disk
- 1 GB
- 100 GB
-
-
-
-
+
Rust service always starts with the minimal resources.
@@ -207,7 +182,7 @@ The scale up of RAM or disk is immediate. The scale up of CPU is configured to b
The **minimum step** for the vertical scaling is
- 1 CPU core
-- 0.25 GB RAM
+- 0.125 GB RAM
- 0.5 GB disk
When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
diff --git a/apps/docs/content/rust/how-to/shared-storage.mdx b/apps/docs/content/rust/how-to/shared-storage.mdx
index 603ad21e6..3e18be163 100644
--- a/apps/docs/content/rust/how-to/shared-storage.mdx
+++ b/apps/docs/content/rust/how-to/shared-storage.mdx
@@ -37,15 +37,15 @@ zCLI is the Zerops command-line tool. To create a new Rust service via the comma
Zerops uses a yaml format to describe the project infrastructure.
-#### description.yml format
+#### description.yaml format
-[Read the basics](/rust/how-to/create#create-a-project-description-file) how to define the Rust service using the description.yml.
+[Read the basics](/rust/how-to/create#create-a-project-description-file) how to define the Rust service using the description.yaml.
#### Example with a shared storage
-Create a directory `my-project`. Create an `description.yml` file inside the `my-project` directory with following content:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
-```yml
+```yaml
# basic project data
project:
# project name
@@ -91,4 +91,4 @@ The mount attribute accepts an array of shared storage names you want to mount t
### Create a project with a Rust service and a shared storage
-Follow the article [How to create a project based on the description.yml](/rust/how-to/create#create-a-project-based-on-the-descriptionyml).
+Follow the article [How to create a project based on the description.yaml](/rust/how-to/create#create-a-project-based-on-the-descriptionyaml).
diff --git a/apps/docs/content/rust/how-to/trigger-pipeline.mdx b/apps/docs/content/rust/how-to/trigger-pipeline.mdx
index d145f9d85..b2c22aed6 100644
--- a/apps/docs/content/rust/how-to/trigger-pipeline.mdx
+++ b/apps/docs/content/rust/how-to/trigger-pipeline.mdx
@@ -20,7 +20,7 @@ Integrate Zerops to your GitHub or GitLab repository and configure the automatic
Follow these steps:
-1. Add [zerops.yml](/rust/how-to/build-pipeline#add-zeropsyml-to-your-repository) to your repository.
+1. Add [zerops.yaml](/rust/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
2. Connect your GitHub repository or connect your GitLab repository
Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
@@ -35,7 +35,7 @@ Then each time you create a new tag or push to a specific branch, depending on t
:::info
-You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yml` in your repository.
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
:::
### Skip the automatic pipeline once
@@ -61,13 +61,13 @@ To start a new build & deploy pipeline manually, use the Zerops CLI.
Follow these steps:
-1. Add `zerops.yml` to your repository.
+1. Add `zerops.yaml` to your repository.
2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
3. Run `zcli push` command.
The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
-The command triggers the [build pipeline](/rust/how-to/trigger-pipeline) defined in `zerops.yml`. `zerops.yml` must be in the working directory. The working directory is by default the current directory and can be changed using the `--workingDir` flag.
+The command triggers the [build pipeline](/rust/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the `--workingDir` flag.
zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
@@ -90,14 +90,14 @@ Flags:
command is to be executed.
--versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
--workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
- --zeropsYamlPath string Sets a custom path to the zerops.yml file relative to the working directory. By default zCLI
- looks for zerops.yml in the working directory.
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
```
zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
:::info
-You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yml` in your repository.
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
:::
## Manual deploy using Zerops CLI
@@ -106,7 +106,7 @@ To start only a deploy pipeline, use the Zerops CLI.
Follow these steps:
-1. Add [zerops.yml](/rust/how-to/build-pipeline#add-zeropsyml-to-your-repository) to your repository. Omit the build section.
+1. Add [zerops.yaml](/rust/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
3. Run `zcli service deploy` command.
@@ -121,8 +121,8 @@ Usage:
Flags:
--archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
to the working directory. By default, no archive is created.
- --deployGitFolder Sets a custom path to the zerops.yml file relative to the working directory. By default zCLI
- looks for zerops.yml in the working directory.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
-h, --help the service deploy command.
--projectId string If you have access to more than one project, you must specify the project ID for which the
command is to be executed.
@@ -130,14 +130,14 @@ Flags:
command is to be executed.
--versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
--workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
- --zeropsYamlPath string Sets a custom path to the zerops.yml file relative to the working directory. By default zCLI
- looks for zerops.yml in the working directory.
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
```
`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the `--workingDir` flag.
-`zerops.yml` must be placed in the working directory.
+`zerops.yaml` must be placed in the working directory.
:::info
-You can change the deploy pipeline when you need to. Just simply modify the `zerops.yml` in your working directory.
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
:::
diff --git a/apps/docs/content/rust/how-to/upgrade.mdx b/apps/docs/content/rust/how-to/upgrade.mdx
index 7b5097f33..072d014f5 100644
--- a/apps/docs/content/rust/how-to/upgrade.mdx
+++ b/apps/docs/content/rust/how-to/upgrade.mdx
@@ -3,6 +3,6 @@ title: How to upgrade the Rust version
description: Learn how to upgrade your rust service's version
---
-You can upgrade or downgrade your Rust service to a different major Rust version by setting the `run.base` parameter in your `zerops.yml`. When you [trigger a new pipeline](/rust/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Rust version. If you don't specify the `run.base` attribute in your `zerops.yml`, Zerops keeps the current Rust version for your runtime.
+You can upgrade or downgrade your Rust service to a different major Rust version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/rust/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Rust version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Rust version for your runtime.
-If you want to build your application with a different major Rust version, change the `build.base` parameter in your `zerops.yml`. The `build.base` is the required attribute.
+If you want to build your application with a different major Rust version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
diff --git a/apps/docs/content/rust/overview.mdx b/apps/docs/content/rust/overview.mdx
index 01c3696a2..213c34a49 100644
--- a/apps/docs/content/rust/overview.mdx
+++ b/apps/docs/content/rust/overview.mdx
@@ -23,9 +23,9 @@ As said, there is no need for coding yet, we have created a [Github repository
1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
-2. In the **Projects** box click on **Import a project** and paste in the following yml config ([source ↗](https://github.com/zeropsio/recipe-rust-hello-world/blob/main/import-project/description.yml)):
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-rust-hello-world/blob/main/import-project/description.yaml)):
-```yml
+```yaml
project:
name: my-first-project
services:
@@ -96,12 +96,12 @@ Do you have any questions? Check the step-by-step tutorial, browse the documenta
},
{
type: 'link',
- href: '/rust/how-to/build-pipeline#add-zeropsyml-to-your-repository',
- label: 'zerops.yml',
+ href: '/rust/how-to/build-pipeline#add-zeropsyaml-to-your-repository',
+ label: 'zerops.yaml',
customProps: {
icon: Icons['puzzle'],
description:
- 'See a full example of zerops.yml file to create your own app.',
+ 'See a full example of zerops.yaml file to create your own app.',
},
},
{
@@ -152,7 +152,7 @@ Have you build something that others might find useful? Don't hesitate to share
-
-
-
-:::note
-The content of this folder is shared among all containers of the connected runtime service.
-
-If you connect multiple runtimes, the content of the folder will be shared among all containers of these services.
-:::
-
-#### Example
-To make sure your file e.g. `config.txt` is persisted, connect your runtime service to shared storage and save the file anywhere in the `/mnt/[shared storage name]` folder, e.g. `/mnt/[shared storage name]/config/config.txt`.
diff --git a/apps/docs/content/shared-storage/how-to/backup.mdx b/apps/docs/content/shared-storage/how-to/backup.mdx
index d1d7f6cac..d32533adc 100644
--- a/apps/docs/content/shared-storage/how-to/backup.mdx
+++ b/apps/docs/content/shared-storage/how-to/backup.mdx
@@ -1,65 +1,17 @@
---
-title: Backup shared storage
-description: Learn how to nackup shared storage data on Zerops.
+title: Backup Shared Storage
+description: Learn how to backup and restore your Shared Storage data on Zerops.
---
-Backups of shared storage data are saved in `.tar.gz` format and contain the entire contents of the shared storage directory.
+Zerops provides built-in backup functionality for your Shared Storage service. For general information about configuring backups, viewing backup files, limits, and security, please refer to the [general backup documentation](/features/backup).
-To retrieve backups of your shared storage, go to the shared storage service detail and select **Backups List & Configuration**. All backups are listed under **List of backups**.
+Shared Storage backups on Zerops:
+- Are stored as tarballs containing the entire contents of the shared storage directory (`/mnt/`)
+- Can be managed through the Shared Storage service detail page under **Backups List & Configuration**
-
-
-
+### Storage Optimization
-### Configuration
-Backup of your shared storage data is set by default. To adjust, disable or create an instant one-time backup, go to the shared storage service detail and select **Backups List & Configuration**.
-
-
-
-
-
-
-Allowed values of the **Custom CRON** option:
-
-
-
-
- Field name
- Allowed values
-
-
-
-
- Minute
- 0-59
-
-
- Hour
- 0-23
-
-
- Day
- 1-31
-
-
- Month
- 1-12
-
-
- Week Day
- 0–7; both 0 and 7 represent Sunday
-
-
-
-
-{/* add link to backup page if exists, at least mention zcli backup command */}
\ No newline at end of file
+For large Shared Storage volumes:
+- Be mindful of the [project backup limits](/features/backup#limits) (25 GiB total backup volume per project)
+- Consider adjusting your backup frequency for optimal storage usage
+- Regularly clean up unnecessary files from your Shared Storage to reduce backup size
\ No newline at end of file
diff --git a/apps/docs/content/shared-storage/how-to/connect.mdx b/apps/docs/content/shared-storage/how-to/connect.mdx
index 390f47d3b..2c4480f2a 100644
--- a/apps/docs/content/shared-storage/how-to/connect.mdx
+++ b/apps/docs/content/shared-storage/how-to/connect.mdx
@@ -5,30 +5,39 @@ description: Learn how to connect shared storage to other services in Zerops.
import GroupCards from '@site/src/components/GroupCards';
-## Connect shared storage in Zerops GUI
+This page covers how to connect an existing shared storage to runtime services and how to disconnect services when needed.
-### New shared storage
+## In Zerops GUI
-Connect your runtime service directly when creating a new shared storage service. Just select your runtime service in the **Share with Services** block on the **Add new shared storage service** page.
+### Connect a new shared storage
+
+When creating a new shared storage service, you can directly select which runtime services it should be connected to. See [Create Shared Storage](/shared-storage/how-to/create) for details about the creation process.
+
+### Connect an existing shared storage
+
+For existing storage, go to the shared storage service detail page and select **Shared storage connections**. Toggle ON any runtime services you wish to connect to this storage.
-### Existing shared storage
-To connect the existing shared storage to a runtime service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
-
## Disconnect a shared storage in Zerops GUI
-Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+To disconnect storage, access the shared storage service detail page, select **Shared storage connections**, and toggle OFF the desired runtime service.
+
+{/*
+## Connect using zsc
+
+Connect shared storage from the command line with the `zsc connectSharedStorage` command. Specify one or more storage names as parameters:
-:::caution
-Your runtime service will be automatically restarted when a shared storage is disconnected.
-:::
+```sh
+zsc connectSharedStorage sharedstorage0
+zsc connectSharedStorage sharedDisk secondDisk
+```
-{/* ## Connect using zsc */}
+Run this command from within your runtime container via web terminal, SSH, or in your `zerops.yaml` file. For more details, see the [Zerops Setup Control documentation](/references/zsc).*/}
\ No newline at end of file
diff --git a/apps/docs/content/shared-storage/how-to/create.mdx b/apps/docs/content/shared-storage/how-to/create.mdx
index c05989072..a1130015b 100644
--- a/apps/docs/content/shared-storage/how-to/create.mdx
+++ b/apps/docs/content/shared-storage/how-to/create.mdx
@@ -1,36 +1,36 @@
---
-title: Create Shared storage service in Zerops
+title: Create Shared Storage service
description: Learn how to create shared storage which you can use with your other services on Zerops.
---
import GroupCards from '@site/src/components/GroupCards';
import Video from '@site/src/components/Video';
-Zerops provides a Shared storage service to share files between all containers of the same service or even among containers of different runtime services. Shared storage is a secure file system storage built on [SeaweedFS ↗](https://github.com/seaweedfs/seaweedfs) that suits both for development and production.
+Shared Storage provides persistent file storage that can be mounted as a POSIX-compatible filesystem to your runtime services. Built on [SeaweedFS ↗](https://github.com/seaweedfs/seaweedfs), it enables reliable data persistence and sharing across services in your infrastructure.
-## Create Shared storage service using Zerops GUI
+## Create Using Zerops GUI
-First, set up a project in Zerops GUI and add a runtime service. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new Shared storage service:
+First, set up a project in Zerops GUI and add a runtime service. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new Shared Storage service:
-### Set a hostname
+### Set a Hostname
-Enter a unique service identifier like "storage","shared" etc. Duplicate services with the same name in the same project are forbidden.
+Enter a unique service identifier like "storage", "files" etc. Duplicate services with the same name in the same project are forbidden.
-#### Limitations:
+#### Hostname Limitations:
-- maximum 25 characters
-- must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+- Maximum 25 characters
+- Must contain only lowercase ASCII letters (a-z) or numbers (0-9)
:::note
The hostname is fixed after the service is created. It can't be changed later.
:::
-### Connect to a service
+### Connect to Services
Select one or more project's runtime services in the Share with Services block:
@@ -43,58 +43,25 @@ Select one or more project's runtime services in the Share with Services block:
/>
-The new Shared storage will be connected to the selected runtimes.
+The new Shared Storage will be connected to the selected runtimes.
:::note
-Runtime services can be connected and disconnected at any time also after the shared storage is created.
+Runtime services can be connected and disconnected at any time even after the shared storage is created.
:::
-### Choose Shared storage service mode
+### Choose Deployment Mode
-Zerops provides Shared service in two modes: Highly available and Single container.
+Choose between **Highly Available** (recommended for production) or **Single Container** (suitable for development) deployment.
-
-
-
-
-#### Highly available
-
-Zerops will create a Shared storage cluster with 3 containers. This mode is suited for production.
-
-Zerops always keep the 3 Shared storage containers on different physical machines. All your data is stored redundantly in 3 identical copies. In case of a failure of a container or the underlying physical machine, Zerops automatically disconnects the failed container from the cluster, creates a new container and syncs all data from the remaining 2 copies. Finally the broken container is automatically deleted.
-
-#### Single container
+:::warning
+The Shared Storage deployment mode is fixed after the service is created. It can't be changed later.
-Zerops will create a Shared storage in a single container. Useful for non-essential data or dev environments.
-
-Your data is stored only in a single container. If the container or the underlying physical machine fails, your data since the last backup are lost. Zerops doesn't provide any automatic repairs of single node Shared storage services.
-
-:::note
-The Shared storage service mode is fixed after the service is created. It can't be changed later.
+See [Technical Details](/shared-storage/technical-details#deployment-modes) for more information about deployment modes.
:::
-### Set auto scaling configuration
-
-Zerops scales Shared storage services automatically by raising or lowering the hardware resources of each database container.
-
-Vertical auto scaling has following default configuration:
+### Set Auto Scaling Configuration
-| HW resource | Minimum | Maximum |
-| ------------- | ------- | ------- |
-| **CPU cores** | 1 | 5 |
-| **RAM** | 0.25 GB | 32 GB |
-| **Disk** | 1 GB | 100 GB |
-
-For most cases, the default parameters will work without issues. If you need to limit the cost of the Shared storage service, lower the maximal resources. Zerops will never scale above the selected maximums.
-
-When you are experiencing problems with insufficient Shared storage performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
-
-You can change the auto scaling parameters later.
+Configure vertical auto scaling parameters to control resource allocation and costs.
-[Learn more] about Shared storage auto scaling.
+:::note
+For detailed information about auto scaling capabilities and recommendations, see [Technical Details](/shared-storage/technical-details#auto-scaling-configuration).
+:::
-## Create Shared storage service using zCLI
+## Create Using zCLI
-zCLI is the Zerops command-line tool. To create a new Shared storage service via the command-line, follow these steps:
+zCLI is the Zerops command-line tool. To create a new Shared Storage service via the command-line, follow these steps:
1. [Install & setup zCLI](/references/cli)
2. Create a project description file
-3. Create a project with a runtime and a Shared storage service
+3. Create a project with a runtime and a Shared Storage service
-### Choose your runtime
+### Choose Your Runtime
@@ -126,4 +95,4 @@ export const languages = [
{ name: "Go", link: "/go/how-to/shared-storage#create-go-service-with-a-shared-storage-using-zcli" },
{ name: ".NET", link: "/dotnet/how-to/shared-storage#create-dotnet-service-with-a-shared-storage-using-zcli" },
{ name: "Rust", link: "/rust/how-to/shared-storage#create-rust-service-with-a-shared-storage-using-zcli" }
-]
+]
\ No newline at end of file
diff --git a/apps/docs/content/shared-storage/how-to/delete.mdx b/apps/docs/content/shared-storage/how-to/delete.mdx
deleted file mode 100644
index db41974c7..000000000
--- a/apps/docs/content/shared-storage/how-to/delete.mdx
+++ /dev/null
@@ -1,40 +0,0 @@
----
-title: Delete Shared storage service
-description: Learn how you can delete your shared storage service on Zerops.
----
-
-## Delete Shared storage service in Zerops GUI
-
-Go to the project dashboard and select the delete service menu item in the top right corner.
-
-{/* change image for shared storage */}
-
-
-
-
-## Delete Shared storage using zCLI
-
-zCLI is the Zerops command-line tool. To delete the Shared storage service via the command-line, follow these steps:
-
-1. [Install & setup zCLI](/references/cli)
-2. Run the `zcli service delete` command
-
-```sh
-Usage:
- zcli service delete [serviceIdOrName] [flags]
-
-Flags:
- --confirm If set, zCLI will not ask for confirmation of destructive operations.
- -h, --help the service delete command.
- --projectId string If you have access to more than one project, you must specify the project ID for which the
- command is to be executed.
- --serviceId string If you have access to more than one service, you must specify the service ID for which the
- command is to be executed.
-```
-
-zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
diff --git a/apps/docs/content/shared-storage/how-to/manage.mdx b/apps/docs/content/shared-storage/how-to/manage.mdx
new file mode 100644
index 000000000..7c0976c3b
--- /dev/null
+++ b/apps/docs/content/shared-storage/how-to/manage.mdx
@@ -0,0 +1,51 @@
+---
+title: Manage and Access Shared Storage
+description: Learn how to manage, monitor, and troubleshoot your Shared Storage on Zerops.
+---
+
+Zerops Shared Storage provides several web interfaces to manage, monitor, and troubleshoot your storage. These interfaces are accessible through the [Zerops VPN](/references/vpn) and offer different capabilities for managing your data and monitoring system performance.
+
+## Access Web Interfaces
+
+### Filer UI
+
+* `http://.zerops:8888`
+
+The Filer UI provides a web-based interface for managing files and directories in your Shared Storage:
+- Browse the directory structure and create new directories
+- Upload new files (up to 64MB) and download existing files
+- Rename and delete files and directories
+
+### Master UI
+* `http://node-stable-1.db..zerops:9333`
+
+The Master UI provides system status and monitoring information:
+
+- View cluster topology
+- Monitor volume servers
+- Check system status and health
+- View statistics and metrics
+
+### Volume UI
+
+* `http://node-stable-.db..zerops:8080/ui/index.html`
+
+The Volume UI allows you to monitor individual storage volumes:
+
+- View volume status
+- Check disk usage
+- Monitor I/O operations
+- View volume statistics
+
+## Monitoring
+
+Several options are available to help you monitor your Shared Storage:
+
+### Runtime Service Logs
+* Navigate to your runtime service detail page → **Runtime Logs** section → filter using the tag `zerops-mount-`
+
+### Shared Storage Logs
+* Access from the Shared Storage service detail page → **Runtime Logs** tab → browse or search for relevant information
+
+### System and Volume Status
+* Monitor replication status, disk usage, and performance metrics through the Master UI and Volume UI
diff --git a/apps/docs/content/shared-storage/how-to/use.mdx b/apps/docs/content/shared-storage/how-to/use.mdx
new file mode 100644
index 000000000..c906d6192
--- /dev/null
+++ b/apps/docs/content/shared-storage/how-to/use.mdx
@@ -0,0 +1,56 @@
+---
+title: Usage & Limitations of Shared Storage
+description: Learn how to use Shared Storage on Zerops and understand its use cases and limitations.
+---
+
+Once a Shared Storage is [connected](/shared-storage/how-to/connect) to a runtime service, Zerops will create a new folder `/mnt/[shared storage name]` in the runtime service's filesystem.
+
+For example, `/mnt/teststorage` for a `teststorage` Shared Storage:
+
+
+
+
+
+:::note
+The content of this folder is shared among all containers of the connected runtime service.
+
+If you connect multiple runtimes, the content of the folder will be shared among all containers of these services.
+:::
+
+## Mount Points and Multiple Volumes
+
+- Multiple storage volumes can be mounted to a single service (e.g., `/mnt/files1`, `/mnt/files2`, etc.)
+- Shared storage mount is only available in runtime containers, not during build and prepare runtime phases
+- All filesystem operations are automatically logged to runtime logs
+
+For technical details about mount behavior and filesystem capabilities, see the [Technical Details](/shared-storage/technical-details#mount-integration) page.
+
+## Use Cases
+
+Shared Storage is ideal for:
+
+- **Persistent filesystem-based databases**: SQLite, Prometheus DB, etc.
+- **Configuration sharing**: Deploy configurations once and share across multiple services
+ - Example: Deploy Apache Airflow configurations and DAG files once and share with all worker nodes
+- **Alternative to object storage**: For applications that require filesystem semantics rather than object storage
+- **Application data**: Store and serve images, documents, and other assets
+
+## Performance Considerations
+
+When using Shared Storage, keep in mind:
+
+- For write-heavy workloads, consider batching operations
+- Minimize operations with many small files for better performance
+
+For more detailed information about performance constraints and limitations, see the [Technical Details](/shared-storage/technical-details#performance-considerations) page.
+
+## Troubleshooting
+
+### Common Issues
+
+- The `df` command may show incorrect or misleading information when used with shared storage mounts. Please refer to the Zerops GUI for accurate storage metrics.
\ No newline at end of file
diff --git a/apps/docs/content/shared-storage/overview.mdx b/apps/docs/content/shared-storage/overview.mdx
index 76411e472..31cf5abe5 100644
--- a/apps/docs/content/shared-storage/overview.mdx
+++ b/apps/docs/content/shared-storage/overview.mdx
@@ -1,6 +1,6 @@
---
-title: Shared storage overview
-description: Learn about working with Shared storage with ease on Zerops.
+title: Shared Storage Overview
+description: Learn about working with Shared Storage with ease on Zerops.
---
import DocCardList from '@theme/DocCardList';
@@ -10,9 +10,12 @@ import LargeCard from '@site/src/components/LargeCard';
# Shared Storage
-Zerops provides a fully managed and scaled **shared storage** service (replicated volume) based on the [SeaweedFS ↗](https://github.com/seaweedfs/seaweedfs) technology, suitable for both development and production projects.
+Zerops provides a fully managed and scaled **Shared Storage** service, which can be mounted to your runtime services. It offers:
+- Persistent file sharing between containers of the same service or different services
+- Standard filesystem operations through a POSIX-compatible interface
+- Built-in high-availability configuration
-## Feature Highlights
+## Documentation Sections
-
-## When in doubt, reach out
-
-Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
-
-In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
-
-Have you build something that others might find useful? Don't hesitate to share your knowledge!
-
-
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
## Popular Guides
+/>
\ No newline at end of file
diff --git a/apps/docs/content/shared-storage/tech-details.mdx b/apps/docs/content/shared-storage/tech-details.mdx
new file mode 100644
index 000000000..0b4b07d4e
--- /dev/null
+++ b/apps/docs/content/shared-storage/tech-details.mdx
@@ -0,0 +1,109 @@
+---
+title: Shared Storage Technical Details
+description: Explore the technical architecture and deployment options of Zerops Shared Storage.
+---
+
+import ResourceTable from '/src/components/ResourceTable';
+
+Zerops Shared Storage is built on [SeaweedFS](https://github.com/seaweedfs/seaweedfs), a distributed filesystem optimized for high-volume storage with efficient retrieval.
+
+## Architecture
+
+Shared Storage consists of three main components:
+- **Master Server**: Manages metadata and coordinates volume servers
+- **Volume Servers**: Store the actual file data
+- **Filer**: Provides a POSIX-compatible interface for file operations
+
+An **automatic vacuum process** helps maintain optimal storage performance by reclaiming space from deleted files. This process is triggered when the size of deleted content exceeds 15% (reduced from the default 30%).
+
+### Mount Integration
+
+When connected to a runtime service:
+- Storage is mounted at `/mnt/`
+- Mount point is owned by the `zerops` user and group (no sudo required)
+- All filesystem operations are logged to runtime logs (tagged as `zerops-mount-`)
+- Mounting will overwrite any existing content in the mount directory
+- Shared storage mount is only available in runtime containers, not during build and prepare runtime phases
+
+## Deployment Modes
+
+Zerops provides Shared Storage in two deployment modes:
+
+### Highly Available
+
+Recommended for production environments where data reliability is critical.
+
+- **Architecture**: 2 volume servers with the master located on one of them
+- **Data Durability**: Data and filer metadata are replicated 1:1 across nodes
+- **Fault Tolerance**:
+ - If a node fails, an automatic repair process begins
+ - A new container replaces the failed one
+ - Data is automatically replicated to the new container (duration depends on data size)
+ - During master node failure, mounted directories become temporarily unavailable until the new master initializes (~30s)
+
+### Single Container
+
+Suitable for development environments or non-critical data storage.
+
+- **Architecture**: Master, volume, and filer server all located on a single container
+- **Data Durability**: All data is lost if the container fails
+- **Recommended For**: Development environments or temporary data storage
+
+:::warning
+The deployment mode is fixed after the service is created and cannot be changed later.
+:::
+
+## Filesystem Capabilities
+
+Shared Storage supports standard POSIX filesystem operations:
+
+- Create, read, update, and delete files and directories
+- Set permissions (with some limitations)
+- Standard file locking operations
+- Hard and symbolic links
+- Directory listing and traversal
+
+For a complete list of supported features, see the [SeaweedFS FUSE documentation](https://github.com/seaweedfs/seaweedfs/wiki/FUSE-Mount#supported-features).
+
+## Resource Constraints
+
+### Storage Limits
+
+- Maximum storage space: 60GB (can be increased via support request)
+- Maximum file size: Unlimited within the 60GB total storage constraint
+- Maximum upload size via Filer UI: 64MB
+
+### Memory Usage
+
+- Base memory consumption: ~60MB when idle
+- Peak memory usage: ~150MB under higher filesystem loads
+- Optimized for low RAM usage (may trade off some performance)
+
+### Performance Considerations
+
+- **Latency**: Higher latency compared to local storage due to network-based distributed architecture
+- **Write Performance**: For write-heavy workloads, consider batching operations
+- **Small Files**: Minimize operations with many small files for better performance
+
+## Auto Scaling Configuration
+
+Zerops scales Shared Storage services automatically by raising or lowering the hardware resources of each database container.
+
+Vertical auto scaling has the following default configuration:
+
+
+
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Shared Storage service, lower the maximal resources. Zerops will never scale above the selected maximums.
+
+When you are experiencing problems with insufficient Shared Storage performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+
+:::note
+You can change the auto scaling parameters later.
+:::
\ No newline at end of file
diff --git a/apps/docs/content/static/overview.mdx b/apps/docs/content/static/overview.mdx
index 47ef80a6d..0f533bd70 100644
--- a/apps/docs/content/static/overview.mdx
+++ b/apps/docs/content/static/overview.mdx
@@ -16,9 +16,9 @@ The Static service provides a streamlined way to serve static content through a
## Quick Start
-Add a Static service to your project by including this in your `zerops.yml`:
+Add a Static service to your project by including this in your `zerops.yaml`:
-```yaml title="zerops.yml"
+```yaml title="zerops.yaml"
zerops:
- setup: app
run:
@@ -43,9 +43,9 @@ The Static service allows you to configure URL routing and redirects through a s
### Basic Structure
-Configure routing in the `run.routing` section of your `zerops.yml`:
+Configure routing in the `run.routing` section of your `zerops.yaml`:
-```yaml title="zerops.yml"
+```yaml title="zerops.yaml"
run:
routing:
redirects:
@@ -60,7 +60,7 @@ run:
Use relative redirects to route paths within your application. When both `from` and `to` are relative paths, you can omit the `status` code to create a masked redirect that shows the content of the target page while preserving the original URL:
-```yaml title="zerops.yml"
+```yaml title="zerops.yaml"
routing:
redirects:
# Masked redirect - URL stays the same but shows content from index.html
@@ -94,7 +94,7 @@ When using `preservePath` with wildcards, ensure the `to` path ends with a `/` t
For redirecting between domains or to external URLs, use absolute redirects by including `http://` or `https://`. When using absolute URLs in either `from` or `to`, you must specify a `status` code:
-```yaml title="zerops.yml"
+```yaml title="zerops.yaml"
routing:
redirects:
# Redirect an old domain to a new one
@@ -120,7 +120,7 @@ Use `*` as a wildcard in your paths:
Example of complex domain management:
-```yaml title="zerops.yml"
+```yaml title="zerops.yaml"
run:
routing:
redirects:
@@ -145,7 +145,7 @@ When multiple redirects are configured, they follow Nginx's matching priority sy
For example:
-```yaml title="zerops.yml"
+```yaml title="zerops.yaml"
routing:
redirects:
# Exact match for homepage - standard redirect
@@ -185,7 +185,7 @@ The Static service includes built-in support for Prerender.io, making it easy to
### Custom Prerender Host
-If you're using a custom Prerender host, add it to environment variables in `zerops.yml`:
+If you're using a custom Prerender host, add it to environment variables in `zerops.yaml`:
```yaml
run:
@@ -216,7 +216,7 @@ This allows you to graduate to a more customizable setup while maintaining your
## Best Practices
1. **SPA Configuration**
- ```yaml title="zerops.yml"
+ ```yaml title="zerops.yaml"
routing:
redirects:
- from: /*
@@ -226,7 +226,7 @@ This allows you to graduate to a more customizable setup while maintaining your
Use this configuration for Single Page Applications to ensure all routes are handled by your application.
2. **Domain Migration**
- ```yaml title="zerops.yml"
+ ```yaml title="zerops.yaml"
routing:
redirects:
- from: https://old-domain.com/*
@@ -237,7 +237,7 @@ This allows you to graduate to a more customizable setup while maintaining your
3. **Complex Redirects**
Order your redirects from most specific to most general to ensure proper routing:
- ```yaml title="zerops.yml"
+ ```yaml title="zerops.yaml"
routing:
redirects:
- from: /specific-path/*
@@ -256,7 +256,7 @@ The Static service seamlessly integrates with modern frontend frameworks. It can
Here's a simple configuration for deploying an [Analog application](https://github.com/zeropsio/recipe-analog-static):
-```yaml title="zerops.yml"
+```yaml title="zerops.yaml"
zerops:
- setup: app
build:
@@ -284,7 +284,7 @@ You can enhance this basic setup by adding:
## Common Configurations
### Multiple Domain Management
-```yaml title="zerops.yml"
+```yaml title="zerops.yaml"
run:
routing:
redirects:
@@ -305,7 +305,7 @@ run:
```
### Development Setup
-```yaml title="zerops.yml"
+```yaml title="zerops.yaml"
run:
routing:
redirects:
diff --git a/apps/docs/content/typesense/overview.mdx b/apps/docs/content/typesense/overview.mdx
index dda104a45..8bae342ab 100644
--- a/apps/docs/content/typesense/overview.mdx
+++ b/apps/docs/content/typesense/overview.mdx
@@ -28,6 +28,14 @@ num-collections-parallel-load: 8
These defaults are optimized for most common use cases and managed by the platform. If you need to adjust these settings, please contact us through our [support channels](#support).
+### Data Persistence
+
+Typesense data is automatically persisted to disk at `/var/lib/typesense`.
+
+This ensures that data remains intact during service restarts (Typesense automatically reloads the persisted data into memory upon startup).
+
+This persistence mechanism works in both HA and non-HA deployment modes, though with different reliability guarantees as detailed below.
+
### Deployment Modes
:::warning
@@ -148,5 +156,5 @@ const searchResults = await client.collections('companies')
## Support
For advanced configurations or custom requirements:
-- Join our [Discord community](https://discord.gg/zerops)
+- Join our [Discord community](https://discord.gg/zeropsio)
- Contact support via [email](mailto:support@zerops.io)
\ No newline at end of file
diff --git a/apps/docs/content/valkey/overview.mdx b/apps/docs/content/valkey/overview.mdx
new file mode 100644
index 000000000..46410503d
--- /dev/null
+++ b/apps/docs/content/valkey/overview.mdx
@@ -0,0 +1,67 @@
+---
+title: Valkey
+desc: Production-ready Valkey on Zerops platform with managed infrastructure and automatic security configuration. Deploy and run your in-memory data store with zero operational overhead.
+---
+
+import UnorderedList from '@site/src/components/UnorderedList';
+import UnorderedCodeList from '@site/src/components/UnorderedCodeList';
+import data from '@site/static/data.json';
+
+Valkey is a powerful, open-source alternative to Redis, offering full compatibility with Redis clients while providing an independent development path focused on community-driven innovation. Deploy and manage Valkey on Zerops' fully managed infrastructure to get instant access to high-performance in-memory data storage.
+
+:::tip
+Valkey is our recommended Redis alternative as KeyDB's development has slowed significantly in recent times.
+:::
+
+## Supported Versions
+
+Currently supported Valkey versions:
+
+
+Import configuration version:
+
+
+## Service Configuration
+
+Zerops offers Valkey in two deployment configurations to meet different availability requirements.
+
+## Deployment Options
+
+### Non-HA Setup
+- Single node deployment on port `6379` (non-TLS) and `6380` (TLS)
+- No backup mechanism beyond Zerops infrastructure reliability
+- Data persists unless the hardware node fails
+- Suitable for development or non-critical workloads
+
+### HA (High Availability) Setup
+
+Our HA implementation uses a unique approach to ensure high availability while maintaining compatibility with all Redis clients:
+
+- 3-node configuration (1 master + 2 replicas)
+- Access ports:
+ - `6379` - read/write operations (non-TLS, routed to master)
+ - `6380` - read/write operations over TLS (routed to master)
+ - `7000` - read-only operations (non-TLS)
+ - `7001` - read-only operations over TLS
+- Implementation details:
+ - All nodes are configured identically and listen on standard ports
+ - First node in the cluster is designated as the master
+ - On replica nodes, ports `6379`/`6380` traffic is forwarded to the master
+ - Ports `7000`/`7001` are mapped locally to each node for direct replica access
+ - When a master fails, a replica is promoted and routing is updated automatically
+ - DNS entries are updated for seamless client connection
+ - This implementation provides traffic forwarding to master (not natively supported by Valkey)
+
+:::note
+Be aware that replica data may lag slightly behind the master due to asynchronous replication.
+:::
+
+## Learn More
+
+- [Official Valkey Documentation](https://valkey.io/docs) - Comprehensive guide to Valkey features
+
+## Support
+
+For advanced configurations or custom requirements:
+- Join our [Discord community](https://discord.gg/zeropsio)
+- Contact support via [email](mailto:support@zerops.io)
\ No newline at end of file
diff --git a/apps/docs/content/zerops-yml/base-list.mdx b/apps/docs/content/zerops-yaml/base-list.mdx
similarity index 96%
rename from apps/docs/content/zerops-yml/base-list.mdx
rename to apps/docs/content/zerops-yaml/base-list.mdx
index 03d0d948e..a35fd0af6 100644
--- a/apps/docs/content/zerops-yml/base-list.mdx
+++ b/apps/docs/content/zerops-yaml/base-list.mdx
@@ -7,7 +7,7 @@ import data from '@site/static/data.json';
import UnorderedCodeList from 'docs/src/components/UnorderedCodeList';
-This is a list of all currently supported versions of technologies that can be used for build.base
and run.base
sections in `zerops.yml`.
+This is a list of all currently supported versions of technologies that can be used for build.base
and run.base
sections in `zerops.yaml`.
:::note
Versions listed on the same line are aliases of the same underlying version.
diff --git a/apps/docs/content/zerops-yml/cron.mdx b/apps/docs/content/zerops-yaml/cron.mdx
similarity index 97%
rename from apps/docs/content/zerops-yml/cron.mdx
rename to apps/docs/content/zerops-yaml/cron.mdx
index 2dfcc7517..de5301509 100644
--- a/apps/docs/content/zerops-yml/cron.mdx
+++ b/apps/docs/content/zerops-yaml/cron.mdx
@@ -5,7 +5,7 @@ description: Learn how to set up automated tasks and scheduled jobs in Zerops
Cron jobs are scheduled commands that execute automatically inside a service's containers based on defined timing rules.
-In Zerops, these jobs are configured in the `run` section of `zerops.yml` file under the `crontab` key.
+In Zerops, these jobs are configured in the `run` section of `zerops.yaml` file under the `crontab` key.
## Parameters
@@ -41,7 +41,7 @@ The schedule for when the task should run, specified in standard cron format usi
Specifies the directory where the command will be executed. If not set, it defaults to `/var/www`.
## Example Configurations
-Here’s a basic example of how to set up a cron job in your service's `zerops.yml`:
+Here’s a basic example of how to set up a cron job in your service's `zerops.yaml`:
```yaml
run:
diff --git a/apps/docs/content/zerops-yml/specification.mdx b/apps/docs/content/zerops-yaml/specification.mdx
similarity index 81%
rename from apps/docs/content/zerops-yml/specification.mdx
rename to apps/docs/content/zerops-yaml/specification.mdx
index fd3c0bd02..9bb7d386f 100644
--- a/apps/docs/content/zerops-yml/specification.mdx
+++ b/apps/docs/content/zerops-yaml/specification.mdx
@@ -1,6 +1,6 @@
---
title: Zerops YAML Configuration
-description: Learn how you can configure your zerops yaml and use the available parameters.
+description: Learn how you can configure your Zerops.yaml and use the available parameters.
---
import data from '@site/static/data.json';
@@ -19,8 +19,8 @@ export const languages = [
{ name: "Nginx", link: "/nginx/how-to/build-pipeline" }
]
-The `zerops.yml` file is crucial for defining how Zerops should [build and deploy](/features/pipeline) your application.
-Add the `zerops.yml` file to the **root of your repository** and customize it to suit your application's needs.
+The `zerops.yaml` file is crucial for defining how Zerops should [build and deploy](/features/pipeline) your application.
+Add the `zerops.yaml` file to the **root of your repository** and customize it to suit your application's needs.
---
@@ -28,7 +28,7 @@ Add the `zerops.yml` file to the **root of your repository** and customize it to
## Basic Structure
-```yml title="zerops.yml"
+```yaml title="zerops.yaml"
zerops:
- setup:
build: ...
@@ -37,9 +37,9 @@ zerops:
- The top-level element is always `zerops`.
- `setup` contains the **hostname** of your service (must exist in Zerops).
-- Multiple services can be defined in a single `zerops.yml` (useful for monorepos):
+- Multiple services can be defined in a single `zerops.yaml` (useful for monorepos):
-```yml
+```yaml
zerops:
- setup: app
build: ...
@@ -52,20 +52,63 @@ zerops:
Each service configuration requires `build` and `run` sections. An optional `deploy` section can be added for readiness checks.
+## Service Inheritance
+
+### extends
+
+The `extends` key allows you to inherit configuration from another service defined in the same `zerops.yaml` file. This is useful for creating environment-specific configurations while maintaining a common base.
+
+```yaml
+zerops:
+ - setup: base
+ build:
+ buildCommands:
+ - echo "hello"
+ deployFiles: ./
+ run:
+ start: server run
+
+ - setup: prod
+ extends: base
+ run:
+ crontab:
+ - command: xyz
+ allContainers: false
+ timing: "* * * * *"
+
+ - setup: dev
+ extends: base
+ run:
+ crontab:
+ - command: different command
+ allContainers: false
+ timing: "* * * * *"
+```
+
+When using `extends`:
+- The `extends` value must refer to another service's `setup` value in the same file
+- The child service inherits all configuration from the base service
+- Configuration is merged at the section level (`build`, `run`, `deploy`)
+- You can override specific sections by redefining them
+
+:::tip
+Create a base service with common configuration and extend it for environment-specific services to keep your `zerops.yaml` file DRY (Don't Repeat Yourself).
+:::
+
## Build Configuration
### base
-Sets the base technology for the build environment. [See available options](/zerops-yml/base-list).
+Sets the base technology for the build environment. [See available options](/zerops-yaml/base-list).
-```yml
+```yaml
build:
base: nodejs@latest
```
You can specify multiple technologies:
-```yml
+```yaml
build:
base:
- nodejs@latest
@@ -85,7 +128,7 @@ Current versions:
- {data.alpine.default}
- {data.ubuntu.default}
-```yml
+```yaml
build:
os: ubuntu
```
@@ -94,7 +137,7 @@ build:
Customizes the build environment by installing additional dependencies or tools.
-```yml
+```yaml
build:
prepareCommands:
- apt-get update
@@ -105,7 +148,7 @@ build:
Defines the commands to build your application.
-```yml
+```yaml
build:
buildCommands:
- npm install
@@ -114,7 +157,7 @@ build:
#### Running commands in a single shell instance:
-```yml
+```yaml
buildCommands:
- |
npm install
@@ -125,7 +168,7 @@ buildCommands:
Specifies which files or folders to deploy after a successful build.
-```yml
+```yaml
build:
deployFiles:
- dist
@@ -141,7 +184,7 @@ Zerops supports the `~` character as a wildcard for one or more folders in the p
Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`.
-```yml
+```yaml
deployFiles: ./path/~/to/file.txt
```
@@ -159,7 +202,7 @@ For consistency, it's recommended to configure both your `.gitignore` and `.depl
Examples:
-```yml title="zerops.yml"
+```yaml title="zerops.yaml"
zerops:
- setup: app
build:
@@ -186,7 +229,7 @@ This example above ignores `file.txt` in ANY directory named `src`, such as:
Defines which files or folders to cache for subsequent builds.
-```yml
+```yaml
build:
cache: node_modules
```
@@ -197,7 +240,7 @@ For more information, see our detailed [guide on build cache](/features/build-ca
Sets environment variables for the build environment.
-```yml
+```yaml
build:
envVariables:
DB_NAME: db
@@ -207,7 +250,7 @@ build:
```
:::info
-The `yamlPreprocessor` option in your project & service import YAML allows you to generate random secret values, passwords, and public/private key pairs. For more information, see the [yamlPreprocessor](/references/importyml/pre-processor) page.
+The `yamlPreprocessor` option in your project & service import YAML allows you to generate random secret values, passwords, and public/private key pairs. For more information, see the [yamlPreprocessor](/references/import-yaml/pre-processor) page.
:::
## Runtime Configuration
@@ -216,7 +259,7 @@ The `yamlPreprocessor` option in your project & service import YAML allows you t
Sets the base technology for the runtime environment. If not specified, the current version is maintained.
-```yml
+```yaml
run:
base: nodejs@latest
```
@@ -229,7 +272,7 @@ Sets the operating system for the runtime environment. Options and versions are
Specifies the internal ports on which your application will listen.
-```yml
+```yaml
run:
ports:
- port: 8080
@@ -266,7 +309,7 @@ Defines files or folders to be copied from the build container to the prepare ru
Defines commands to run each time a new runtime container starts or restarts.
-```yml
+```yaml
run:
initCommands:
- rm -rf ./cache
@@ -276,7 +319,7 @@ run:
Defines the start command for your application.
-```yml
+```yaml
run:
start: npm start
```
@@ -287,7 +330,7 @@ Defines start commands
Unlike `start`, you can define multiple commands that starts their own processes.
-```yml
+```yaml
run:
startCommands:
# start the application
@@ -295,11 +338,11 @@ run:
name: server
# start the replication
- - command: litestream replicate -config=litestream.yml
+ - 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.yml $DB_NAME
+ - litestream restore -if-replica-exists -if-db-not-exists -config=litestream.yaml $DB_NAME
```
See [start-commands-example](https://github.com/zeropsio/start-commands-example)
@@ -316,7 +359,7 @@ Sets the custom webserver configuration (available only for webserver runtimes).
Defines environment variables for the runtime environment.
-```yml
+```yaml
run:
base: nodejs@20
envVariables:
@@ -330,7 +373,7 @@ Defines environment variables for the runtime environment.
Defines a health check for your application.
-```yml
+```yaml
run:
healthCheck:
httpGet:
@@ -342,7 +385,7 @@ run:
Defines scheduled commands to run as cron jobs within a service.
- ```yml
+ ```yaml
run:
crontab:
- command: "date >> /var/log/cron.log"
@@ -357,7 +400,7 @@ Setup cron jobs. See [examples](/references/cron).
Defines a readiness check for your application. (See [readiness checks](/features/pipeline#readiness-checks))
-```yml
+```yaml
deploy:
readinessCheck:
httpGet:
diff --git a/apps/docs/docusaurus.config.js b/apps/docs/docusaurus.config.js
index 9362be653..856a891ce 100644
--- a/apps/docs/docusaurus.config.js
+++ b/apps/docs/docusaurus.config.js
@@ -158,6 +158,10 @@ const config = {
copyright: `Docs theme & components by the amazing medusajs.com © ${new Date().getFullYear()} Zerops s.r.o..`,
},
socialLinks: [
+ {
+ type: "model",
+ href: "https://docs.zerops.io/llms.txt",
+ },
{
type: "discord",
href: "https://docs.zerops.io/discord",
diff --git a/apps/docs/package.json b/apps/docs/package.json
index 8d069a6f4..8b88c13d5 100644
--- a/apps/docs/package.json
+++ b/apps/docs/package.json
@@ -68,6 +68,7 @@
},
"devDependencies": {
"@babel/plugin-proposal-decorators": "^7.22.15",
+ "@docusaurus/eslint-plugin": "latest",
"@docusaurus/module-type-aliases": "latest",
"@docusaurus/tsconfig": "latest",
"@docusaurus/types": "latest",
@@ -80,4 +81,4 @@
"engines": {
"node": ">=18.0"
}
-}
+}
\ No newline at end of file
diff --git a/apps/docs/sidebars.js b/apps/docs/sidebars.js
index 148135cb2..4b090629a 100644
--- a/apps/docs/sidebars.js
+++ b/apps/docs/sidebars.js
@@ -96,13 +96,26 @@ module.exports = {
className: 'homepage-sidebar-item',
},
{
- type: 'doc',
- id: 'features/access',
+ type: 'category',
+ link: {
+ type: 'doc',
+ id: 'features/access',
+ },
label: 'Custom Domains & IP Access',
customProps: {
sidebar_icon: 'globe-europe',
},
className: 'homepage-sidebar-item',
+ items: [
+ {
+ type: 'doc',
+ id: 'features/dns',
+ label: 'DNS & Proxy Setup',
+ customProps: {
+ exclude_from_doc_list: false,
+ },
+ },
+ ],
},
{
type: 'doc',
@@ -115,19 +128,19 @@ module.exports = {
},
{
type: 'doc',
- id: 'features/pricing',
- label: 'Pricing Plans & Usage',
+ id: 'features/backup',
+ label: 'Backup',
customProps: {
- sidebar_icon: 'currency-dollar',
+ sidebar_icon: 'archive-box',
},
className: 'homepage-sidebar-item',
},
{
type: 'doc',
- id: 'features/backup',
- label: 'Backup',
+ id: 'features/cdn',
+ label: 'CDN',
customProps: {
- sidebar_icon: 'archive-box',
+ sidebar_icon: 'cdn',
},
className: 'homepage-sidebar-item',
},
@@ -350,13 +363,13 @@ module.exports = {
className: 'homepage-sidebar-item service-sidebar-item',
},
{
- type: 'ref',
- id: 'keydb/overview',
- label: 'KeyDB (Redis)',
+ type: "ref",
+ id: "valkey/overview",
+ label: "Valkey (Redis)",
customProps: {
- sidebar_icon: 'keydb',
+ sidebar_icon: "valkey",
},
- className: 'homepage-sidebar-item service-sidebar-item',
+ className: "homepage-sidebar-item service-sidebar-item",
},
{
type: "ref",
@@ -385,33 +398,33 @@ module.exports = {
},
className: "homepage-sidebar-item service-sidebar-item",
},
-// {
-// type: "ref",
-// id: "meilisearch/overview",
-// label: "Meilisearch",
-// customProps: {
-// sidebar_icon: "meilisearch",
-// },
-// className: "homepage-sidebar-item service-sidebar-item",
-// },
-// {
-// type: "ref",
-// id: "qdrant/overview",
-// label: "Qdrant",
-// customProps: {
-// sidebar_icon: "qdrant",
-// },
-// className: "homepage-sidebar-item service-sidebar-item",
-// },
-// {
-// type: "ref",
-// id: "valkey/overview",
-// label: "Valkey",
-// customProps: {
-// sidebar_icon: "valkey",
-// },
-// className: "homepage-sidebar-item service-sidebar-item",
-// },
+ {
+ type: "ref",
+ id: "qdrant/overview",
+ label: "Qdrant",
+ customProps: {
+ sidebar_icon: "qdrant",
+ },
+ className: "homepage-sidebar-item service-sidebar-item",
+ },
+ {
+ type: "ref",
+ id: "nats/overview",
+ label: "NATS",
+ customProps: {
+ sidebar_icon: "nats",
+ },
+ className: "homepage-sidebar-item service-sidebar-item",
+ },
+ {
+ type: 'ref',
+ id: 'keydb/overview',
+ label: 'KeyDB',
+ customProps: {
+ sidebar_icon: 'keydb',
+ },
+ className: 'homepage-sidebar-item service-sidebar-item',
+ },
// {
// type: "ref",
// id: "kafka/overview",
@@ -420,15 +433,6 @@ module.exports = {
// sidebar_icon: "kafka",
// },
// className: "homepage-sidebar-item service-sidebar-item",
-// },
-// {
-// type: "ref",
-// id: "nats/overview",
-// label: "NATS",
-// customProps: {
-// sidebar_icon: "nats",
-// },
-// className: "homepage-sidebar-item service-sidebar-item",
// },
],
},
@@ -470,7 +474,7 @@ module.exports = {
},
{
type: 'doc',
- id: 'zerops-yml/specification',
+ id: 'zerops-yaml/specification',
label: 'Specification',
customProps: {
sidebar_icon: 'document-text',
@@ -479,7 +483,7 @@ module.exports = {
},
{
type: 'doc',
- id: 'zerops-yml/base-list',
+ id: 'zerops-yaml/base-list',
label: 'Base List',
customProps: {
sidebar_icon: 'swatch',
@@ -488,7 +492,7 @@ module.exports = {
},
{
type: 'doc',
- id: 'zerops-yml/cron',
+ id: 'zerops-yaml/cron',
label: 'Cron',
customProps: {
sidebar_icon: 'arrow-path',
@@ -517,16 +521,16 @@ module.exports = {
items: [
{
type: 'doc',
- id: 'references/cli/commands',
- label: 'Available Commands',
+ id: 'references/cli/configuration',
+ label: 'Configuration',
customProps: {
exclude_from_doc_list: false,
},
},
{
type: 'doc',
- id: 'references/cli/access-logs',
- label: 'Access Logs',
+ id: 'references/cli/commands',
+ label: 'Commands',
customProps: {
exclude_from_doc_list: false,
},
@@ -587,7 +591,7 @@ module.exports = {
items: [
{
type: 'doc',
- id: 'references/importyml/pre-processor',
+ id: 'references/import-yaml/pre-processor',
label: 'Yaml Preprocessing',
customProps: {
exclude_from_doc_list: false,
@@ -595,7 +599,7 @@ module.exports = {
},
{
type: 'doc',
- id: 'references/importyml/type-list',
+ id: 'references/import-yaml/type-list',
label: 'Service Types',
customProps: {
exclude_from_doc_list: false,
@@ -639,6 +643,15 @@ module.exports = {
},
className: 'homepage-sidebar-item',
},
+ {
+ type: 'doc',
+ id: 'references/api',
+ label: 'API',
+ customProps: {
+ sidebar_icon: 'curly-braces',
+ },
+ className: 'homepage-sidebar-item',
+ },
{
type: 'html',
value: 'Help',
@@ -665,51 +678,63 @@ module.exports = {
},
className: 'homepage-sidebar-item',
},
+ {
+ type: 'html',
+ value: 'Company',
+ customProps: {
+ sidebar_is_group_divider: true,
+ },
+ className: 'homepage-sidebar-item',
+ },
{
type: 'doc',
- id: 'help/branding',
- label: 'Branding',
+ id: 'company/about',
+ label: 'About',
customProps: {
- sidebar_icon: 'document-text',
+ sidebar_icon: 'information-circle',
},
className: 'homepage-sidebar-item',
},
{
- type: 'html',
- value: 'Additional resources',
+ type: 'doc',
+ id: 'company/developer-first',
+ label: 'Dev-First Experience',
customProps: {
- sidebar_is_group_divider: true,
- sidebar_is_soon: true,
+ sidebar_icon: 'heart',
+ },
+ className: 'homepage-sidebar-item',
+ },
+ {
+ type: 'category',
+ link: {
+ type: 'doc',
+ id: 'company/pricing',
+ },
+ label: 'Pricing',
+ customProps: {
+ sidebar_icon: 'currency-dollar',
+ },
+ className: 'homepage-sidebar-item',
+ items: [
+ {
+ type: 'doc',
+ id: 'company/payment',
+ label: 'Top-up & Billing',
+ customProps: {
+ exclude_from_doc_list: false,
+ },
+ },
+ ],
+ },
+ {
+ type: 'doc',
+ id: 'company/branding',
+ label: 'Branding',
+ customProps: {
+ sidebar_icon: 'tag',
},
className: 'homepage-sidebar-item',
},
- // {
- // type: "doc",
- // id: "additional-resources/utility-recipes",
- // label: "Utility recipes",
- // customProps: {
- // sidebar_icon: "swatch",
- // },
- // className: "homepage-sidebar-item",
- // },
- // {
- // type: "doc",
- // id: "additional-resources/glossary",
- // label: "Glossary",
- // customProps: {
- // sidebar_icon: "list-bullet",
- // },
- // className: "homepage-sidebar-item",
- // },
- // {
- // type: "doc",
- // id: "additional-resources/roadmap",
- // label: "Roadmap",
- // customProps: {
- // sidebar_icon: "map",
- // },
- // className: "homepage-sidebar-item",
- // },
],
nodejs: [
{
@@ -732,11 +757,10 @@ module.exports = {
},
{
type: 'category',
- label: 'How-to',
+ label: 'Management',
collapsible: false,
customProps: {
sidebar_is_group_headline: true,
- sidebar_icon: 'academic-cap-solid',
},
items: [
{
@@ -744,6 +768,31 @@ module.exports = {
id: 'nodejs/how-to/create',
label: 'Create Node.js service',
},
+ {
+ type: 'doc',
+ id: 'nodejs/how-to/upgrade',
+ label: 'Upgrade Node.js service',
+ },
+ {
+ type: 'doc',
+ id: 'nodejs/how-to/delete',
+ label: 'Delete Node.js service',
+ },
+ {
+ type: 'doc',
+ id: 'nodejs/how-to/controls',
+ label: 'Stop & start Node.js runtime service',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Configuration & Environment',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
+ },
+ items: [
{
type: 'doc',
id: 'nodejs/how-to/env-variables',
@@ -751,9 +800,19 @@ module.exports = {
},
{
type: 'doc',
- id: 'nodejs/how-to/upgrade',
- label: 'Upgrade Node.js service',
+ id: 'nodejs/how-to/customize-runtime',
+ label: 'Customize NodeJS runtime',
},
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Build & Deployment',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
+ },
+ items: [
{
type: 'doc',
id: 'nodejs/how-to/build-pipeline',
@@ -774,11 +833,16 @@ module.exports = {
id: 'nodejs/how-to/deploy-process',
label: 'Deploy process',
},
- {
- type: 'doc',
- id: 'nodejs/how-to/customize-runtime',
- label: 'Customize NodeJS runtime',
- },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Maintenance & Monitoring',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
+ },
+ items: [
{
type: 'doc',
id: 'nodejs/how-to/logs',
@@ -799,32 +863,13 @@ module.exports = {
id: 'nodejs/how-to/scaling',
label: 'Scale Node.js runtime service',
},
- {
- type: 'doc',
- id: 'nodejs/how-to/controls',
- label: 'Stop & start Node.js runtime service',
- },
{
type: 'doc',
id: 'nodejs/how-to/shared-storage',
label: 'Connect / disconnect shared storage',
},
- {
- type: 'doc',
- id: 'nodejs/how-to/delete',
- label: 'Delete Node.js service',
- },
],
},
- // {
- // type: 'doc',
- // id: 'nodejs/faq',
- // label: 'FAQ',
- // customProps: {
- // sidebar_is_title: true,
- // sidebar_icon: 'chat-bubble-left-right',
- // },
- // },
],
php: [
{
@@ -847,7 +892,7 @@ module.exports = {
},
{
type: 'category',
- label: 'How-to',
+ label: 'Management',
collapsible: false,
customProps: {
sidebar_is_group_headline: true,
@@ -858,11 +903,6 @@ module.exports = {
id: 'php/how-to/create',
label: 'Create PHP service',
},
- {
- type: 'doc',
- id: 'php/how-to/env-variables',
- label: 'Manage environment variables',
- },
{
type: 'doc',
id: 'php/how-to/upgrade',
@@ -870,23 +910,28 @@ module.exports = {
},
{
type: 'doc',
- id: 'php/how-to/build-pipeline',
- label: 'Configure build & deploy pipeline',
- },
- {
- type: 'doc',
- id: 'php/how-to/trigger-pipeline',
- label: 'Trigger build pipeline',
+ id: 'php/how-to/delete',
+ label: 'Delete PHP service',
},
{
type: 'doc',
- id: 'php/how-to/build-process',
- label: 'Build process',
+ id: 'php/how-to/controls',
+ label: 'Stop & start PHP runtime service',
},
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Configuration & Environment',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
+ },
+ items: [
{
type: 'doc',
- id: 'php/how-to/deploy-process',
- label: 'Deploy process',
+ id: 'php/how-to/env-variables',
+ label: 'Manage environment variables',
},
{
type: 'doc',
@@ -898,75 +943,41 @@ module.exports = {
id: 'php/how-to/customize-web-server',
label: 'Customize web server',
},
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Build & Deployment',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
+ },
+ items: [
{
type: 'doc',
- id: 'php/how-to/logs',
- label: 'Setup & access logs',
+ id: 'php/how-to/build-pipeline',
+ label: 'Configure build & deploy pipeline',
},
{
type: 'doc',
- id: 'php/how-to/filebrowser',
- label: 'Browse container files',
+ id: 'php/how-to/trigger-pipeline',
+ label: 'Trigger build pipeline',
},
{
type: 'doc',
- id: 'php/how-to/access',
- label: 'Access PHP runtime service',
+ id: 'php/how-to/build-process',
+ label: 'Build process',
},
{
type: 'doc',
- id: 'php/how-to/scaling',
- label: 'Scale PHP runtime service',
- },
- {
- type: 'doc',
- id: 'php/how-to/controls',
- label: 'Stop & start PHP runtime service',
- },
- {
- type: 'doc',
- id: 'php/how-to/shared-storage',
- label: 'Connect / disconnect shared storage',
- },
- {
- type: 'doc',
- id: 'php/how-to/delete',
- label: 'Delete PHP service',
+ id: 'php/how-to/deploy-process',
+ label: 'Deploy process',
},
],
},
- // {
- // type: 'doc',
- // id: 'php/faq',
- // label: 'FAQ',
- // customProps: {
- // sidebar_is_title: true,
- // sidebar_icon: 'chat-bubble-left-right',
- // },
- // },
- ],
- python: [
- {
- type: 'ref',
- id: 'homepage',
- label: 'Back to home',
- customProps: {
- sidebar_is_back_link: true,
- sidebar_icon: 'back-arrow',
- },
- },
- {
- type: 'doc',
- id: 'python/overview',
- label: 'Python',
- customProps: {
- sidebar_is_title: true,
- sidebar_icon: 'python',
- },
- },
{
type: 'category',
- label: 'How-to',
+ label: 'Maintenance & Monitoring',
collapsible: false,
customProps: {
sidebar_is_group_headline: true,
@@ -974,92 +985,33 @@ module.exports = {
items: [
{
type: 'doc',
- id: 'python/how-to/create',
- label: 'Create Python service',
- },
- {
- type: 'doc',
- id: 'python/how-to/env-variables',
- label: 'Manage environment variables',
- },
- {
- type: 'doc',
- id: 'python/how-to/upgrade',
- label: 'Upgrade Python service',
- },
- {
- type: 'doc',
- id: 'python/how-to/build-pipeline',
- label: 'Configure build & deploy pipeline',
- },
- {
- type: 'doc',
- id: 'python/how-to/trigger-pipeline',
- label: 'Trigger build pipeline',
- },
- {
- type: 'doc',
- id: 'python/how-to/build-process',
- label: 'Build process',
- },
- {
- type: 'doc',
- id: 'python/how-to/deploy-process',
- label: 'Deploy process',
- },
- {
- type: 'doc',
- id: 'python/how-to/customize-runtime',
- label: 'Customize Python runtime',
- },
- {
- type: 'doc',
- id: 'python/how-to/logs',
+ id: 'php/how-to/logs',
label: 'Setup & access logs',
},
{
type: 'doc',
- id: 'python/how-to/filebrowser',
+ id: 'php/how-to/filebrowser',
label: 'Browse container files',
},
{
type: 'doc',
- id: 'python/how-to/access',
- label: 'Access Python runtime service',
- },
- {
- type: 'doc',
- id: 'python/how-to/scaling',
- label: 'Scale Python runtime service',
+ id: 'php/how-to/access',
+ label: 'Access PHP runtime service',
},
{
type: 'doc',
- id: 'python/how-to/controls',
- label: 'Stop & start Python runtime service',
+ id: 'php/how-to/scaling',
+ label: 'Scale PHP runtime service',
},
{
type: 'doc',
- id: 'python/how-to/shared-storage',
+ id: 'php/how-to/shared-storage',
label: 'Connect / disconnect shared storage',
},
- {
- type: 'doc',
- id: 'python/how-to/delete',
- label: 'Delete Python service',
- },
],
},
- // {
- // type: 'doc',
- // id: 'python/faq',
- // label: 'FAQ',
- // customProps: {
- // sidebar_is_title: true,
- // sidebar_icon: 'chat-bubble-left-right',
- // },
- // },
],
- go: [
+ python: [
{
type: 'ref',
id: 'homepage',
@@ -1071,16 +1023,16 @@ module.exports = {
},
{
type: 'doc',
- id: 'go/overview',
- label: 'Go',
+ id: 'python/overview',
+ label: 'Python',
customProps: {
sidebar_is_title: true,
- sidebar_icon: 'go',
+ sidebar_icon: 'python',
},
},
{
type: 'category',
- label: 'How-to',
+ label: 'Management',
collapsible: false,
customProps: {
sidebar_is_group_headline: true,
@@ -1088,113 +1040,29 @@ module.exports = {
items: [
{
type: 'doc',
- id: 'go/how-to/create',
- label: 'Create Go service',
- },
- {
- type: 'doc',
- id: 'go/how-to/env-variables',
- label: 'Manage environment variables',
- },
- {
- type: 'doc',
- id: 'go/how-to/upgrade',
- label: 'Upgrade Go service',
- },
- {
- type: 'doc',
- id: 'go/how-to/build-pipeline',
- label: 'Configure build & deploy pipeline',
- },
- {
- type: 'doc',
- id: 'go/how-to/trigger-pipeline',
- label: 'Trigger build pipeline',
- },
- {
- type: 'doc',
- id: 'go/how-to/build-process',
- label: 'Build process',
- },
- {
- type: 'doc',
- id: 'go/how-to/deploy-process',
- label: 'Deploy process',
- },
- {
- type: 'doc',
- id: 'go/how-to/customize-runtime',
- label: 'Customize Go runtime',
- },
- {
- type: 'doc',
- id: 'go/how-to/logs',
- label: 'Setup & access logs',
- },
- {
- type: 'doc',
- id: 'go/how-to/filebrowser',
- label: 'Browse container files',
- },
- {
- type: 'doc',
- id: 'go/how-to/access',
- label: 'Access Go runtime service',
- },
- {
- type: 'doc',
- id: 'go/how-to/scaling',
- label: 'Scale Go runtime service',
+ id: 'python/how-to/create',
+ label: 'Create Python service',
},
{
type: 'doc',
- id: 'go/how-to/controls',
- label: 'Stop & start Go runtime service',
+ id: 'python/how-to/upgrade',
+ label: 'Upgrade Python service',
},
{
type: 'doc',
- id: 'go/how-to/shared-storage',
- label: 'Connect / disconnect shared storage',
+ id: 'python/how-to/delete',
+ label: 'Delete Python service',
},
{
type: 'doc',
- id: 'go/how-to/delete',
- label: 'Delete Go service',
+ id: 'python/how-to/controls',
+ label: 'Stop & start Python runtime service',
},
],
},
- // {
- // type: 'doc',
- // id: 'go/faq',
- // label: 'FAQ',
- // customProps: {
- // sidebar_is_title: true,
- // sidebar_icon: 'chat-bubble-left-right',
- // },
- // },
- ],
- rust: [
- {
- type: 'ref',
- id: 'homepage',
- label: 'Back to home',
- customProps: {
- sidebar_is_back_link: true,
- sidebar_icon: 'back-arrow',
- },
- },
- {
- type: 'doc',
- id: 'rust/overview',
- label: 'Rust',
- customProps: {
- sidebar_is_title: true,
- sidebar_icon: 'rust',
- },
- },
{
type: 'category',
- label: 'How-to',
+ label: 'Configuration & Environment',
collapsible: false,
customProps: {
sidebar_is_group_headline: true,
@@ -1202,973 +1070,798 @@ module.exports = {
items: [
{
type: 'doc',
- id: 'rust/how-to/create',
- label: 'Create Rust service',
- },
- {
- type: 'doc',
- id: 'rust/how-to/env-variables',
+ id: 'python/how-to/env-variables',
label: 'Manage environment variables',
},
{
type: 'doc',
- id: 'rust/how-to/upgrade',
- label: 'Upgrade Rust service',
+ id: 'python/how-to/customize-runtime',
+ label: 'Customize Python runtime',
},
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Build & Deployment',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
+ },
+ items: [
{
type: 'doc',
- id: 'rust/how-to/build-pipeline',
+ id: 'python/how-to/build-pipeline',
label: 'Configure build & deploy pipeline',
},
{
type: 'doc',
- id: 'rust/how-to/trigger-pipeline',
+ id: 'python/how-to/trigger-pipeline',
label: 'Trigger build pipeline',
},
{
type: 'doc',
- id: 'rust/how-to/build-process',
+ id: 'python/how-to/build-process',
label: 'Build process',
},
{
type: 'doc',
- id: 'rust/how-to/deploy-process',
+ id: 'python/how-to/deploy-process',
label: 'Deploy process',
},
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Maintenance & Monitoring',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
+ },
+ items: [
{
type: 'doc',
- id: 'rust/how-to/customize-runtime',
- label: 'Customize Rust runtime',
- },
- {
- type: 'doc',
- id: 'rust/how-to/logs',
+ id: 'python/how-to/logs',
label: 'Setup & access logs',
},
{
type: 'doc',
- id: 'rust/how-to/filebrowser',
+ id: 'python/how-to/filebrowser',
label: 'Browse container files',
},
{
type: 'doc',
- id: 'rust/how-to/access',
- label: 'Access Rust runtime service',
- },
- {
- type: 'doc',
- id: 'rust/how-to/scaling',
- label: 'Scale Rust runtime service',
+ id: 'python/how-to/access',
+ label: 'Access Python runtime service',
},
{
type: 'doc',
- id: 'rust/how-to/controls',
- label: 'Stop & start Rust runtime service',
+ id: 'python/how-to/scaling',
+ label: 'Scale Python runtime service',
},
{
type: 'doc',
- id: 'rust/how-to/shared-storage',
+ id: 'python/how-to/shared-storage',
label: 'Connect / disconnect shared storage',
},
- {
- type: 'doc',
- id: 'rust/how-to/delete',
- label: 'Delete Rust service',
- },
],
},
- // {
- // type: 'doc',
- // id: 'rust/faq',
- // label: 'FAQ',
- // customProps: {
- // sidebar_is_title: true,
- // sidebar_icon: 'chat-bubble-left-right',
- // },
- // },
],
- dotnet: [
- {
- type: 'ref',
- id: 'homepage',
- label: 'Back to home',
- customProps: {
- sidebar_is_back_link: true,
- sidebar_icon: 'back-arrow',
- },
- },
- {
- type: 'doc',
- id: 'dotnet/overview',
- label: '.NET',
- customProps: {
- sidebar_is_title: true,
- sidebar_icon: 'dotnet',
+ go: [
+ {
+ type: 'ref',
+ id: 'homepage',
+ label: 'Back to home',
+ customProps: {
+ sidebar_is_back_link: true,
+ sidebar_icon: 'back-arrow',
+ },
},
- },
- {
- type: 'category',
- label: 'How-to',
- collapsible: false,
- customProps: {
- sidebar_is_group_headline: true,
+ {
+ type: 'doc',
+ id: 'go/overview',
+ label: 'Go',
+ customProps: {
+ sidebar_is_title: true,
+ sidebar_icon: 'go',
+ },
},
- items: [
- {
- type: 'doc',
- id: 'dotnet/how-to/create',
- label: 'Create .NET service',
+ {
+ type: 'category',
+ label: 'Management',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
},
- {
- type: 'doc',
- id: 'dotnet/how-to/env-variables',
- label: 'Manage environment variables',
+ items: [
+ {
+ type: 'doc',
+ id: 'go/how-to/create',
+ label: 'Create Go service',
+ },
+ {
+ type: 'doc',
+ id: 'go/how-to/upgrade',
+ label: 'Upgrade Go service',
+ },
+ {
+ type: 'doc',
+ id: 'go/how-to/delete',
+ label: 'Delete Go service',
+ },
+ {
+ type: 'doc',
+ id: 'go/how-to/controls',
+ label: 'Stop & start Go runtime service',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Configuration & Environment',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
},
- {
- type: 'doc',
- id: 'dotnet/how-to/upgrade',
- label: 'Upgrade .NET service',
+ items: [
+ {
+ type: 'doc',
+ id: 'go/how-to/env-variables',
+ label: 'Manage environment variables',
+ },
+ {
+ type: 'doc',
+ id: 'go/how-to/customize-runtime',
+ label: 'Customize Go runtime',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Build & Deployment',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
},
- {
- type: 'doc',
- id: 'dotnet/how-to/build-pipeline',
- label: 'Configure build & deploy pipeline',
+ items: [
+ {
+ type: 'doc',
+ id: 'go/how-to/build-pipeline',
+ label: 'Configure build & deploy pipeline',
+ },
+ {
+ type: 'doc',
+ id: 'go/how-to/trigger-pipeline',
+ label: 'Trigger build pipeline',
+ },
+ {
+ type: 'doc',
+ id: 'go/how-to/build-process',
+ label: 'Build process',
+ },
+ {
+ type: 'doc',
+ id: 'go/how-to/deploy-process',
+ label: 'Deploy process',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Maintenance & Monitoring',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
},
- {
- type: 'doc',
- id: 'dotnet/how-to/trigger-pipeline',
- label: 'Trigger build pipeline',
+ items: [
+ {
+ type: 'doc',
+ id: 'go/how-to/logs',
+ label: 'Setup & access logs',
+ },
+ {
+ type: 'doc',
+ id: 'go/how-to/filebrowser',
+ label: 'Browse container files',
+ },
+ {
+ type: 'doc',
+ id: 'go/how-to/access',
+ label: 'Access Go runtime service',
+ },
+ {
+ type: 'doc',
+ id: 'go/how-to/scaling',
+ label: 'Scale Go runtime service',
+ },
+ {
+ type: 'doc',
+ id: 'go/how-to/shared-storage',
+ label: 'Connect / disconnect shared storage',
+ },
+ ],
+ },
+ ],
+ rust: [
+ {
+ type: 'ref',
+ id: 'homepage',
+ label: 'Back to home',
+ customProps: {
+ sidebar_is_back_link: true,
+ sidebar_icon: 'back-arrow',
},
- {
- type: 'doc',
- id: 'dotnet/how-to/build-process',
- label: 'Build process',
+ },
+ {
+ type: 'doc',
+ id: 'rust/overview',
+ label: 'Rust',
+ customProps: {
+ sidebar_is_title: true,
+ sidebar_icon: 'rust',
},
- {
- type: 'doc',
- id: 'dotnet/how-to/deploy-process',
- label: 'Deploy process',
+ },
+ {
+ type: 'category',
+ label: 'Management',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
},
- {
- type: 'doc',
- id: 'dotnet/how-to/customize-runtime',
- label: 'Customize .NET runtime',
+ items: [
+ {
+ type: 'doc',
+ id: 'rust/how-to/create',
+ label: 'Create Rust service',
+ },
+ {
+ type: 'doc',
+ id: 'rust/how-to/upgrade',
+ label: 'Upgrade Rust service',
+ },
+ {
+ type: 'doc',
+ id: 'rust/how-to/delete',
+ label: 'Delete Rust service',
+ },
+ {
+ type: 'doc',
+ id: 'rust/how-to/controls',
+ label: 'Stop & start Rust runtime service',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Configuration & Environment',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
},
- {
- type: 'doc',
- id: 'dotnet/how-to/logs',
- label: 'Setup & access logs',
+ items: [
+ {
+ type: 'doc',
+ id: 'rust/how-to/env-variables',
+ label: 'Manage environment variables',
+ },
+ {
+ type: 'doc',
+ id: 'rust/how-to/customize-runtime',
+ label: 'Customize Rust runtime',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Build & Deployment',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
},
- {
- type: 'doc',
- id: 'dotnet/how-to/filebrowser',
- label: 'Browse container files',
+ items: [
+ {
+ type: 'doc',
+ id: 'rust/how-to/build-pipeline',
+ label: 'Configure build & deploy pipeline',
+ },
+ {
+ type: 'doc',
+ id: 'rust/how-to/trigger-pipeline',
+ label: 'Trigger build pipeline',
+ },
+ {
+ type: 'doc',
+ id: 'rust/how-to/build-process',
+ label: 'Build process',
+ },
+ {
+ type: 'doc',
+ id: 'rust/how-to/deploy-process',
+ label: 'Deploy process',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Maintenance & Monitoring',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
},
- {
- type: 'doc',
- id: 'dotnet/how-to/access',
- label: 'Access .NET runtime service',
+ items: [
+ {
+ type: 'doc',
+ id: 'rust/how-to/logs',
+ label: 'Setup & access logs',
+ },
+ {
+ type: 'doc',
+ id: 'rust/how-to/filebrowser',
+ label: 'Browse container files',
+ },
+ {
+ type: 'doc',
+ id: 'rust/how-to/access',
+ label: 'Access Rust runtime service',
+ },
+ {
+ type: 'doc',
+ id: 'rust/how-to/scaling',
+ label: 'Scale Rust runtime service',
+ },
+ {
+ type: 'doc',
+ id: 'rust/how-to/shared-storage',
+ label: 'Connect / disconnect shared storage',
+ },
+ ],
+ },
+ ],
+ dotnet: [
+ {
+ type: 'ref',
+ id: 'homepage',
+ label: 'Back to home',
+ customProps: {
+ sidebar_is_back_link: true,
+ sidebar_icon: 'back-arrow',
},
- {
- type: 'doc',
- id: 'dotnet/how-to/scaling',
- label: 'Scale .NET runtime service',
+ },
+ {
+ type: 'doc',
+ id: 'dotnet/overview',
+ label: '.NET',
+ customProps: {
+ sidebar_is_title: true,
+ sidebar_icon: 'dotnet',
},
- {
- type: 'doc',
- id: 'dotnet/how-to/controls',
- label: 'Stop & start .NET runtime service',
+ },
+ {
+ type: 'category',
+ label: 'Management',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
},
- {
- type: 'doc',
- id: 'dotnet/how-to/shared-storage',
- label: 'Connect / disconnect shared storage',
+ items: [
+ {
+ type: 'doc',
+ id: 'dotnet/how-to/create',
+ label: 'Create .NET service',
+ },
+ {
+ type: 'doc',
+ id: 'dotnet/how-to/upgrade',
+ label: 'Upgrade .NET service',
+ },
+ {
+ type: 'doc',
+ id: 'dotnet/how-to/delete',
+ label: 'Delete .NET service',
+ },
+ {
+ type: 'doc',
+ id: 'dotnet/how-to/controls',
+ label: 'Stop & start .NET runtime service',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Configuration & Environment',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
},
- {
- type: 'doc',
- id: 'dotnet/how-to/delete',
- label: 'Delete .NET service',
+ items: [
+ {
+ type: 'doc',
+ id: 'dotnet/how-to/env-variables',
+ label: 'Manage environment variables',
+ },
+ {
+ type: 'doc',
+ id: 'dotnet/how-to/customize-runtime',
+ label: 'Customize .NET runtime',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Build & Deployment',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
},
- ],
- },
- // {
- // type: 'doc',
- // id: 'dotnet/faq',
- // label: 'FAQ',
- // customProps: {
- // sidebar_is_title: true,
- // sidebar_icon: 'chat-bubble-left-right',
- // },
- // },
- ],
- java: [
- {
- type: 'ref',
- id: 'homepage',
- label: 'Back to home',
- customProps: {
- sidebar_is_back_link: true,
- sidebar_icon: 'back-arrow',
+ items: [
+ {
+ type: 'doc',
+ id: 'dotnet/how-to/build-pipeline',
+ label: 'Configure build & deploy pipeline',
+ },
+ {
+ type: 'doc',
+ id: 'dotnet/how-to/trigger-pipeline',
+ label: 'Trigger build pipeline',
+ },
+ {
+ type: 'doc',
+ id: 'dotnet/how-to/build-process',
+ label: 'Build process',
+ },
+ {
+ type: 'doc',
+ id: 'dotnet/how-to/deploy-process',
+ label: 'Deploy process',
+ },
+ ],
},
- },
- {
- type: 'doc',
- id: 'java/overview',
- label: 'Java',
- customProps: {
- sidebar_is_title: true,
- sidebar_icon: 'java',
+ {
+ type: 'category',
+ label: 'Maintenance & Monitoring',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
+ },
+ items: [
+ {
+ type: 'doc',
+ id: 'dotnet/how-to/logs',
+ label: 'Setup & access logs',
+ },
+ {
+ type: 'doc',
+ id: 'dotnet/how-to/filebrowser',
+ label: 'Browse container files',
+ },
+ {
+ type: 'doc',
+ id: 'dotnet/how-to/access',
+ label: 'Access .NET runtime service',
+ },
+ {
+ type: 'doc',
+ id: 'dotnet/how-to/scaling',
+ label: 'Scale .NET runtime service',
+ },
+ {
+ type: 'doc',
+ id: 'dotnet/how-to/shared-storage',
+ label: 'Connect / disconnect shared storage',
+ },
+ ],
},
- },
- {
- type: 'category',
- label: 'How-to',
- collapsible: false,
- customProps: {
- sidebar_is_group_headline: true,
+ ],
+ java: [
+ {
+ type: 'ref',
+ id: 'homepage',
+ label: 'Back to home',
+ customProps: {
+ sidebar_is_back_link: true,
+ sidebar_icon: 'back-arrow',
+ },
},
- items: [
- {
- type: 'doc',
- id: 'java/how-to/create',
- label: 'Create Java service',
+ {
+ type: 'doc',
+ id: 'java/overview',
+ label: 'Java',
+ customProps: {
+ sidebar_is_title: true,
+ sidebar_icon: 'java',
},
- {
- type: 'doc',
- id: 'java/how-to/env-variables',
- label: 'Manage environment variables',
+ },
+ {
+ type: 'category',
+ label: 'Management',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
},
- {
- type: 'doc',
- id: 'java/how-to/upgrade',
- label: 'Upgrade Java service',
+ items: [
+ {
+ type: 'doc',
+ id: 'java/how-to/create',
+ label: 'Create Java service',
+ },
+ {
+ type: 'doc',
+ id: 'java/how-to/upgrade',
+ label: 'Upgrade Java service',
+ },
+ {
+ type: 'doc',
+ id: 'java/how-to/delete',
+ label: 'Delete Java service',
+ },
+ {
+ type: 'doc',
+ id: 'java/how-to/controls',
+ label: 'Stop & start Java runtime service',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Configuration & Environment',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
},
- {
- type: 'doc',
- id: 'java/how-to/build-pipeline',
- label: 'Configure build & deploy pipeline',
+ items: [
+ {
+ type: 'doc',
+ id: 'java/how-to/env-variables',
+ label: 'Manage environment variables',
+ },
+ {
+ type: 'doc',
+ id: 'java/how-to/customize-runtime',
+ label: 'Customize Java runtime',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Build & Deployment',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
},
- {
- type: 'doc',
- id: 'java/how-to/trigger-pipeline',
- label: 'Trigger build pipeline',
+ items: [
+ {
+ type: 'doc',
+ id: 'java/how-to/build-pipeline',
+ label: 'Configure build & deploy pipeline',
+ },
+ {
+ type: 'doc',
+ id: 'java/how-to/trigger-pipeline',
+ label: 'Trigger build pipeline',
+ },
+ {
+ type: 'doc',
+ id: 'java/how-to/build-process',
+ label: 'Build process',
+ },
+ {
+ type: 'doc',
+ id: 'java/how-to/deploy-process',
+ label: 'Deploy process',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Maintenance & Monitoring',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
},
- {
- type: 'doc',
- id: 'java/how-to/build-process',
- label: 'Build process',
+ items: [
+ {
+ type: 'doc',
+ id: 'java/how-to/logs',
+ label: 'Setup & access logs',
+ },
+ {
+ type: 'doc',
+ id: 'java/how-to/filebrowser',
+ label: 'Browse container files',
+ },
+ {
+ type: 'doc',
+ id: 'java/how-to/access',
+ label: 'Access Java runtime service',
+ },
+ {
+ type: 'doc',
+ id: 'java/how-to/scaling',
+ label: 'Scale Java runtime service',
+ },
+ {
+ type: 'doc',
+ id: 'java/how-to/shared-storage',
+ label: 'Connect / disconnect shared storage',
+ },
+ ],
+ },
+ ],
+ nginx: [
+ {
+ type: 'ref',
+ id: 'homepage',
+ label: 'Back to home',
+ customProps: {
+ sidebar_is_back_link: true,
+ sidebar_icon: 'back-arrow',
},
- {
- type: 'doc',
- id: 'java/how-to/deploy-process',
- label: 'Deploy process',
+ },
+ {
+ type: 'doc',
+ id: 'nginx/overview',
+ label: 'Nginx Static',
+ customProps: {
+ sidebar_is_title: true,
+ sidebar_icon: 'nginx',
},
- {
+ },
+ {
+ type: 'category',
+ label: 'Dive-in',
+ collapsible: false,
+ link: {
type: 'doc',
- id: 'java/how-to/customize-runtime',
- label: 'Customize Java runtime',
+ id: 'nginx/getting-started',
},
- {
- type: 'doc',
- id: 'java/how-to/logs',
- label: 'Setup & access logs',
+ customProps: {
+ sidebar_icon: 'rocket-launch',
},
- {
- type: 'doc',
- id: 'java/how-to/filebrowser',
- label: 'Browse container files',
- },
- {
- type: 'doc',
- id: 'java/how-to/access',
- label: 'Access Java runtime service',
- },
- {
- type: 'doc',
- id: 'java/how-to/scaling',
- label: 'Scale Java runtime service',
- },
- {
- type: 'doc',
- id: 'java/how-to/controls',
- label: 'Stop & start Java runtime service',
- },
- {
- type: 'doc',
- id: 'java/how-to/shared-storage',
- label: 'Connect / disconnect shared storage',
- },
- {
- type: 'doc',
- id: 'java/how-to/delete',
- label: 'Delete Java service',
- },
- ],
- },
- // {
- // type: 'doc',
- // id: 'java/faq',
- // label: 'FAQ',
- // customProps: {
- // sidebar_is_title: true,
- // sidebar_icon: 'chat-bubble-left-right',
- // },
- // },
- ],
- nginx: [
- {
- type: 'ref',
- id: 'homepage',
- label: 'Back to home',
- customProps: {
- sidebar_is_back_link: true,
- sidebar_icon: 'back-arrow',
- },
- },
- {
- type: 'doc',
- id: 'nginx/overview',
- label: 'Nginx Static',
- customProps: {
- sidebar_is_title: true,
- sidebar_icon: 'nginx',
- },
- },
- {
- type: 'category',
- label: 'Dive-in',
- collapsible: false,
- link: {
- type: 'doc',
- id: 'nginx/getting-started',
- },
- customProps: {
- sidebar_icon: 'rocket-launch',
- },
- className: 'homepage-sidebar-item',
- items: [
- {
- type: 'doc',
- id: 'nginx/tutorial/quickstart',
- label: 'Quickstart',
- customProps: {
- exclude_from_doc_list: false,
+ className: 'homepage-sidebar-item',
+ items: [
+ {
+ type: 'doc',
+ id: 'nginx/tutorial/quickstart',
+ label: 'Quickstart',
+ customProps: {
+ exclude_from_doc_list: false,
+ },
},
- },
- {
- type: 'doc',
- id: 'nginx/tutorial/step-by-step',
- label: 'Step-by-step tutorial',
- customProps: {
- exclude_from_doc_list: false,
+ {
+ type: 'doc',
+ id: 'nginx/tutorial/step-by-step',
+ label: 'Step-by-step tutorial',
+ customProps: {
+ exclude_from_doc_list: false,
+ },
},
- },
- ],
- },
- {
- type: 'category',
- label: 'How-to',
- collapsible: false,
- customProps: {
- sidebar_is_group_headline: true,
+ ],
},
- items: [
- {
- type: 'doc',
- id: 'nginx/how-to/create',
- label: 'Create Nginx static service',
- },
- {
- type: 'doc',
- id: 'nginx/how-to/env-variables',
- label: 'Manage environment variables',
- },
- {
- type: 'doc',
- id: 'nginx/how-to/upgrade',
- label: 'Upgrade Nginx service',
- },
- {
- type: 'doc',
- id: 'nginx/how-to/build-pipeline',
- label: 'Configure build & deploy pipeline',
- },
- {
- type: 'doc',
- id: 'nginx/how-to/trigger-pipeline',
- label: 'Trigger build pipeline',
- },
- {
- type: 'doc',
- id: 'nginx/how-to/deploy-process',
- label: 'Deploy process',
- },
- {
- type: 'doc',
- id: 'nginx/how-to/customize-runtime',
- label: 'Customize Nginx static runtime',
- },
- {
- type: 'doc',
- id: 'nginx/how-to/customize-web-server',
- label: 'Customize web server',
- },
- {
- type: 'doc',
- id: 'nginx/how-to/logs',
- label: 'Setup & access logs',
- },
- {
- type: 'doc',
- id: 'nginx/how-to/filebrowser',
- label: 'Browse container files',
- },
- {
- type: 'doc',
- id: 'nginx/how-to/access',
- label: 'Access Nginx runtime service',
- },
- {
- type: 'doc',
- id: 'nginx/how-to/scaling',
- label: 'Scale Nginx static service',
- },
- {
- type: 'doc',
- id: 'nginx/how-to/controls',
- label: 'Stop & start Nginx static service',
- },
- {
- type: 'doc',
- id: 'nginx/how-to/shared-storage',
- label: 'Connect / disconnect shared storage',
- },
- {
- type: 'doc',
- id: 'nginx/how-to/delete',
- label: 'Delete Nginx static service',
+ {
+ type: 'category',
+ label: 'Management',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
},
- ],
- },
- {
- type: 'doc',
- id: 'nginx/faq',
- label: 'FAQ',
- customProps: {
- sidebar_is_title: true,
- sidebar_icon: 'chat-bubble-left-right',
- },
- },
- ],
- static: [
- {
- type: 'ref',
- id: 'homepage',
- label: 'Back to home',
- customProps: {
- sidebar_is_back_link: true,
- sidebar_icon: 'back-arrow',
- },
- },
- {
- type: 'doc',
- id: 'static/overview',
- label: 'Static Service',
- customProps: {
- sidebar_is_title: true,
- sidebar_icon: 'computer-desktop',
- },
- },
- ],
- docker: [
- {
- type: 'ref',
- id: 'homepage',
- label: 'Back to home',
- customProps: {
- sidebar_is_back_link: true,
- sidebar_icon: 'back-arrow',
- },
- },
- {
- type: 'doc',
- id: 'docker/overview',
- label: 'Docker Service',
- customProps: {
- sidebar_is_title: true,
- sidebar_icon: 'docker',
- },
- },
- ],
- mariadb: [
- {
- type: 'ref',
- id: 'homepage',
- label: 'Back to home',
- customProps: {
- sidebar_is_back_link: true,
- sidebar_icon: 'back-arrow',
- },
- },
- {
- type: 'doc',
- id: 'mariadb/overview',
- label: 'Zerops MariaDB Service',
- customProps: {
- sidebar_is_title: true,
- sidebar_icon: 'mariadb',
- },
- },
- {
- type: 'category',
- label: 'How-to',
- collapsible: false,
- customProps: {
- sidebar_is_group_headline: true,
+ items: [
+ {
+ type: 'doc',
+ id: 'nginx/how-to/create',
+ label: 'Create Nginx static service',
+ },
+ {
+ type: 'doc',
+ id: 'nginx/how-to/upgrade',
+ label: 'Upgrade Nginx service',
+ },
+ {
+ type: 'doc',
+ id: 'nginx/how-to/delete',
+ label: 'Delete Nginx static service',
+ },
+ {
+ type: 'doc',
+ id: 'nginx/how-to/controls',
+ label: 'Stop & start Nginx static service',
+ },
+ ],
},
- items: [
- {
- type: 'doc',
- id: 'mariadb/how-to/create',
- label: 'Create MariaDB service',
- },
- {
- type: 'doc',
- id: 'mariadb/how-to/connect',
- label: 'Connect to MariaDB',
- },
- {
- type: 'doc',
- id: 'mariadb/how-to/manage',
- label: 'Manage users and databases',
- },
- {
- type: 'doc',
- id: 'mariadb/how-to/export-import-data',
- label: 'Export and import data',
+ {
+ type: 'category',
+ label: 'Configuration & Environment',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
},
- {
- type: 'doc',
- id: 'mariadb/how-to/backup',
- label: 'Backup data',
+ items: [
+ {
+ type: 'doc',
+ id: 'nginx/how-to/env-variables',
+ label: 'Manage environment variables',
+ },
+ {
+ type: 'doc',
+ id: 'nginx/how-to/customize-runtime',
+ label: 'Customize Nginx static runtime',
+ },
+ {
+ type: 'doc',
+ id: 'nginx/how-to/customize-web-server',
+ label: 'Customize web server',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Build & Deployment',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
},
- {
- type: 'doc',
- id: 'mariadb/how-to/scale',
- label: 'Scale MariaDB service',
+ items: [
+ {
+ type: 'doc',
+ id: 'nginx/how-to/build-pipeline',
+ label: 'Configure build & deploy pipeline',
+ },
+ {
+ type: 'doc',
+ id: 'nginx/how-to/trigger-pipeline',
+ label: 'Trigger build pipeline',
+ },
+ {
+ type: 'doc',
+ id: 'nginx/how-to/deploy-process',
+ label: 'Deploy process',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Maintenance & Monitoring',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
},
- {
- type: 'doc',
- id: 'mariadb/how-to/control',
- label: 'Stop and start MariaDB service',
- },
- {
- type: 'doc',
- id: 'mariadb/how-to/delete',
- label: 'Delete MariaDB service',
- },
- ],
- },
- {
- type: 'category',
- label: 'Technical details',
- collapsible: false,
- customProps: {
- sidebar_is_group_headline: true,
- },
- items: [
- {
- type: 'doc',
- id: 'mariadb/tech-details/cluster',
- label: 'MariaDB cluster asynchronous behaviour',
- },
- {
- type: 'doc',
- id: 'mariadb/tech-details/limitations',
- label: 'Technical limitations of MariaDB cluster',
- },
- ],
- },
- // {
- // type: 'doc',
- // id: 'mariadb/faq',
- // label: 'FAQ',
- // customProps: {
- // sidebar_is_title: true,
- // sidebar_icon: 'chat-bubble-left-right',
- // },
- // },
- ],
- postgresql: [
- {
- type: 'ref',
- id: 'homepage',
- label: 'Back to home',
- customProps: {
- sidebar_is_back_link: true,
- sidebar_icon: 'back-arrow',
- },
- },
- {
- type: 'doc',
- id: 'postgresql/overview',
- label: 'Zerops PostgreSQL Service',
- customProps: {
- sidebar_is_title: true,
- sidebar_icon: 'postgresql',
- },
- },
- {
- type: 'category',
- label: 'How-to',
- collapsible: false,
- customProps: {
- sidebar_is_group_headline: true,
- },
- items: [
- {
- type: 'doc',
- id: 'postgresql/how-to/create',
- label: 'Create PostgreSQL service',
- },
- {
- type: 'doc',
- id: 'postgresql/how-to/connect',
- label: 'Connect to PostgreSQL',
- },
- {
- type: 'doc',
- id: 'postgresql/how-to/manage',
- label: 'Manage users and databases',
- },
- {
- type: 'doc',
- id: 'postgresql/how-to/export-import-data',
- label: 'Export and import data',
- },
- {
- type: 'doc',
- id: 'postgresql/how-to/scale',
- label: 'Scale PostgreSQL service',
- },
- {
- type: 'doc',
- id: 'postgresql/how-to/control',
- label: 'Stop and start PostgreSQL service',
- },
- {
- type: 'doc',
- id: 'postgresql/how-to/delete',
- label: 'Delete PostgreSQL service',
- },
- ],
- },
- // {
- // type: "category",
- // label: "Technical details",
- // collapsible: false,
- // customProps: {
- // sidebar_is_group_headline: true,
- // },
- // items: [
- // {
- // type: "doc",
- // id: "postgresql/tech-details/cluster",
- // label: "PostgreSQL cluster asynchronous behaviour",
- // },
- // {
- // type: "doc",
- // id: "postgresql/tech-details/limitations",
- // label: "Technical limitations of PostgreSQL cluster",
- // },
- // ],
- // },
- {
- type: 'doc',
- id: 'postgresql/faq',
- label: 'FAQ',
- customProps: {
- sidebar_is_title: true,
- sidebar_icon: 'chat-bubble-left-right',
- },
- },
- ],
-// mongodb: [
-// {
-// type: 'ref',
-// id: 'homepage',
-// label: 'Back to home',
-// customProps: {
-// sidebar_is_back_link: true,
-// sidebar_icon: 'back-arrow',
-// },
-// },
- // {
- // type: 'doc',
- // id: 'mongodb/overview',
- // label: 'Zerops MongoDB Service',
- // customProps: {
- // sidebar_is_title: true,
- // sidebar_icon: 'mongodb',
- // },
- // },
-// ],
- elasticsearch: [
- {
- type: 'ref',
- id: 'homepage',
- label: 'Back to home',
- customProps: {
- sidebar_is_back_link: true,
- sidebar_icon: 'back-arrow',
- },
- },
- {
- type: 'doc',
- id: 'elasticsearch/overview',
- label: 'Zerops Elasticsearch Service',
- customProps: {
- sidebar_is_title: true,
- sidebar_icon: 'elasticsearch',
- },
- },
- ],
- keydb: [
- {
- type: 'ref',
- id: 'homepage',
- label: 'Back to home',
- customProps: {
- sidebar_is_back_link: true,
- sidebar_icon: 'back-arrow',
- },
- },
- {
- type: 'doc',
- id: 'keydb/overview',
- label: 'Zerops KeyDB Service',
- customProps: {
- sidebar_is_title: true,
- sidebar_icon: 'keydb',
- },
- },
- {
- type: 'category',
- label: 'How-to',
- collapsible: false,
- customProps: {
- sidebar_is_group_headline: true,
- },
- items: [
- {
- type: 'doc',
- id: 'keydb/how-to/create',
- label: 'Create KeyDB service',
- },
- {
- type: 'doc',
- id: 'keydb/how-to/connect',
- label: 'Connect to KeyDB',
- },
- {
- type: 'doc',
- id: 'keydb/how-to/manage',
- label: 'Manage users and databases',
- },
- {
- type: 'doc',
- id: 'keydb/how-to/export-import-data',
- label: 'Export and import data',
- },
- {
- type: 'doc',
- id: 'keydb/how-to/scale',
- label: 'Scale KeyDB service',
- },
- {
- type: 'doc',
- id: 'keydb/how-to/control',
- label: 'Stop and start KeyDB service',
- },
- {
- type: 'doc',
- id: 'keydb/how-to/delete',
- label: 'Delete KeyDB service',
- },
- ],
- },
- // {
- // type: 'doc',
- // id: 'keydb/faq',
- // label: 'FAQ',
- // customProps: {
- // sidebar_is_title: true,
- // sidebar_icon: 'chat-bubble-left-right',
- // },
- // },
- ],
- typesense: [
- {
- type: 'ref',
- id: 'homepage',
- label: 'Back to home',
- customProps: {
- sidebar_is_back_link: true,
- sidebar_icon: 'back-arrow',
- },
- },
- {
- type: 'doc',
- id: 'typesense/overview',
- label: 'Zerops Typesense Service',
- customProps: {
- sidebar_is_title: true,
- sidebar_icon: 'typesense',
- },
- },
- ],
- meilisearch: [
- {
- type: 'ref',
- id: 'homepage',
- label: 'Back to home',
- customProps: {
- sidebar_is_back_link: true,
- sidebar_icon: 'back-arrow',
- },
- },
- {
- type: 'doc',
- id: 'meilisearch/overview',
- label: 'Zerops Meilisearch Service',
- customProps: {
- sidebar_is_title: true,
- sidebar_icon: 'meilisearch',
- },
- },
- ],
- // rabbitmq: [
- // {
- // type: "ref",
- // id: "homepage",
- // label: "Back to home",
- // customProps: {
- // sidebar_is_back_link: true,
- // sidebar_icon: "back-arrow",
- // },
- // },
- // {
- // type: "doc",
- // id: "rabbitmq/overview",
- // label: "Zerops RabbitMQ Service",
- // customProps: {
- // sidebar_is_title: true,
- // sidebar_icon: "rabbitmq",
- // },
- // },
- // {
- // type: "category",
- // label: "How-to",
- // collapsible: false,
- // customProps: {
- // sidebar_is_group_headline: true,
- // },
- // items: [
- // {
- // type: "doc",
- // id: "rabbitmq/how-to/create",
- // label: "Create RabbitMQ service",
- // },
- // {
- // type: "doc",
- // id: "rabbitmq/how-to/connect",
- // label: "Connect to RabbitMQ",
- // },
- // {
- // type: "doc",
- // id: "rabbitmq/how-to/manage",
- // label: "Manage users and databases",
- // },
- // {
- // type: "doc",
- // id: "rabbitmq/how-to/export-import-data",
- // label: "Export and import data",
- // },
- // {
- // type: "doc",
- // id: "rabbitmq/how-to/scale",
- // label: "Scale RabbitMQ service",
- // },
- // {
- // type: "doc",
- // id: "rabbitmq/how-to/control",
- // label: "Stop and start RabbitMQ service",
- // },
- // {
- // type: "doc",
- // id: "rabbitmq/how-to/delete",
- // label: "Delete RabbitMQ service",
- // },
- // ],
- // },
- // ],
- sharedstorage: [
- {
- type: 'ref',
- id: 'homepage',
- label: 'Back to home',
- customProps: {
- sidebar_is_back_link: true,
- sidebar_icon: 'back-arrow',
- },
- },
- {
- type: 'doc',
- id: 'shared-storage/overview',
- label: 'Shared storage overview',
- customProps: {
- sidebar_is_title: true,
- sidebar_icon: 'server',
- },
- },
- {
- type: 'category',
- label: 'How-to',
- collapsible: false,
- customProps: {
- sidebar_is_group_headline: true,
- sidebar_icon: 'academic-cap-solid',
- },
- items: [
- {
- type: 'doc',
- id: 'shared-storage/how-to/create',
- label: 'Create shared storage',
- },
- {
- type: 'doc',
- id: 'shared-storage/how-to/connect',
- label: 'Connect shared storage',
- },
- {
- type: 'doc',
- id: 'shared-storage/how-to/access',
- label: 'Use shared storage',
- },
- {
- type: 'doc',
- id: 'shared-storage/how-to/backup',
- label: 'Backup shared storage',
- },
- {
- type: 'doc',
- id: 'shared-storage/how-to/delete',
- label: 'Delete shared storage service',
+ items: [
+ {
+ type: 'doc',
+ id: 'nginx/how-to/logs',
+ label: 'Setup & access logs',
+ },
+ {
+ type: 'doc',
+ id: 'nginx/how-to/filebrowser',
+ label: 'Browse container files',
+ },
+ {
+ type: 'doc',
+ id: 'nginx/how-to/access',
+ label: 'Access Nginx runtime service',
+ },
+ {
+ type: 'doc',
+ id: 'nginx/how-to/scaling',
+ label: 'Scale Nginx static service',
+ },
+ {
+ type: 'doc',
+ id: 'nginx/how-to/shared-storage',
+ label: 'Connect / disconnect shared storage',
+ },
+ ],
+ },
+ {
+ type: 'doc',
+ id: 'nginx/faq',
+ label: 'FAQ',
+ customProps: {
+ sidebar_is_title: true,
+ sidebar_icon: 'chat-bubble-left-right',
},
- ],
- },
- ],
- objectstorage: [
+ },
+ ],
+ static: [
{
type: 'ref',
id: 'homepage',
@@ -2180,51 +1873,35 @@ module.exports = {
},
{
type: 'doc',
- id: 'object-storage/overview',
- label: 'Object Storage Overview',
+ id: 'static/overview',
+ label: 'Static Service',
customProps: {
sidebar_is_title: true,
- sidebar_icon: 'server',
+ sidebar_icon: 'computer-desktop',
},
},
+ ],
+ docker: [
{
- type: 'category',
- label: 'How-to',
- collapsible: false,
+ type: 'ref',
+ id: 'homepage',
+ label: 'Back to home',
customProps: {
- sidebar_is_group_headline: true,
- sidebar_icon: 'academic-cap-solid',
+ sidebar_is_back_link: true,
+ sidebar_icon: 'back-arrow',
+ },
+ },
+ {
+ type: 'doc',
+ id: 'docker/overview',
+ label: 'Docker Service',
+ customProps: {
+ sidebar_is_title: true,
+ sidebar_icon: 'docker',
},
- items: [
- {
- type: 'doc',
- id: 'object-storage/how-to/create',
- label: 'Create object storage service',
- },
- {
- type: 'doc',
- id: 'object-storage/how-to/update-bucket',
- label: 'Change bucket size or access policy',
- },
- {
- type: 'doc',
- id: 'object-storage/how-to/access',
- label: 'Access object storage service',
- },
- {
- type: 'doc',
- id: 'object-storage/how-to/delete',
- label: 'Delete object storage service',
- },
- {
- type: 'doc',
- id: 'object-storage/how-to/curl-file',
- label: 'Download file from a private bucket',
- },
- ],
},
],
- deno: [
+ mariadb: [
{
type: 'ref',
id: 'homepage',
@@ -2236,11 +1913,11 @@ module.exports = {
},
{
type: 'doc',
- id: 'deno/overview',
- label: 'Getting Started',
+ id: 'mariadb/overview',
+ label: 'Zerops MariaDB Service',
customProps: {
sidebar_is_title: true,
- sidebar_icon: 'deno',
+ sidebar_icon: 'mariadb',
},
},
{
@@ -2249,89 +1926,73 @@ module.exports = {
collapsible: false,
customProps: {
sidebar_is_group_headline: true,
- sidebar_icon: 'academic-cap-solid',
},
items: [
{
type: 'doc',
- id: 'deno/how-to/create',
- label: 'Create Deno service',
- },
- {
- type: 'doc',
- id: 'deno/how-to/env-variables',
- label: 'Manage environment variables',
- },
- {
- type: 'doc',
- id: 'deno/how-to/upgrade',
- label: 'Upgrade Deno service',
- },
- {
- type: 'doc',
- id: 'deno/how-to/build-pipeline',
- label: 'Configure build & deploy pipeline',
- },
- {
- type: 'doc',
- id: 'deno/how-to/trigger-pipeline',
- label: 'Trigger build pipeline',
- },
- {
- type: 'doc',
- id: 'deno/how-to/build-process',
- label: 'Build process',
+ id: 'mariadb/how-to/create',
+ label: 'Create MariaDB service',
},
{
type: 'doc',
- id: 'deno/how-to/deploy-process',
- label: 'Deploy process',
+ id: 'mariadb/how-to/connect',
+ label: 'Connect to MariaDB',
},
{
type: 'doc',
- id: 'deno/how-to/customize-runtime',
- label: 'Customize Deno runtime',
+ id: 'mariadb/how-to/manage',
+ label: 'Manage users and databases',
},
{
type: 'doc',
- id: 'deno/how-to/logs',
- label: 'Setup & access logs',
+ id: 'mariadb/how-to/export-import-data',
+ label: 'Export and import data',
},
{
type: 'doc',
- id: 'deno/how-to/filebrowser',
- label: 'Browse container files',
+ id: 'mariadb/how-to/backup',
+ label: 'Backup data',
},
{
type: 'doc',
- id: 'deno/how-to/access',
- label: 'Access Bun runtime service',
+ id: 'mariadb/how-to/scale',
+ label: 'Scale MariaDB service',
},
{
type: 'doc',
- id: 'deno/how-to/scaling',
- label: 'Scale Deno runtime service',
+ id: 'mariadb/how-to/control',
+ label: 'Stop and start MariaDB service',
},
{
type: 'doc',
- id: 'deno/how-to/controls',
- label: 'Stop & start Deno runtime service',
+ id: 'mariadb/how-to/delete',
+ label: 'Delete MariaDB service',
},
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Technical details',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
+ },
+ items: [
{
type: 'doc',
- id: 'deno/how-to/shared-storage',
- label: 'Connect / disconnect shared storage',
+ id: 'mariadb/tech-details/cluster',
+ label: 'MariaDB cluster asynchronous behaviour',
},
{
type: 'doc',
- id: 'deno/how-to/delete',
- label: 'Delete Deno service',
+ id: 'mariadb/tech-details/limitations',
+ label: 'Technical limitations of MariaDB cluster',
},
],
},
// {
// type: 'doc',
- // id: 'deno/faq',
+ // id: 'mariadb/faq',
// label: 'FAQ',
// customProps: {
// sidebar_is_title: true,
@@ -2339,7 +2000,7 @@ module.exports = {
// },
// },
],
- bun: [
+ postgresql: [
{
type: 'ref',
id: 'homepage',
@@ -2351,11 +2012,11 @@ module.exports = {
},
{
type: 'doc',
- id: 'bun/overview',
- label: 'Getting Started',
+ id: 'postgresql/overview',
+ label: 'Zerops PostgreSQL Service',
customProps: {
sidebar_is_title: true,
- sidebar_icon: 'bun',
+ sidebar_icon: 'postgresql',
},
},
{
@@ -2368,84 +2029,173 @@ module.exports = {
items: [
{
type: 'doc',
- id: 'bun/how-to/create',
- label: 'Create Bun service',
- },
- {
- type: 'doc',
- id: 'bun/how-to/env-variables',
- label: 'Manage environment variables',
- },
- {
- type: 'doc',
- id: 'bun/how-to/upgrade',
- label: 'Upgrade Bun service',
+ id: 'postgresql/how-to/create',
+ label: 'Create PostgreSQL service',
},
{
type: 'doc',
- id: 'bun/how-to/build-pipeline',
- label: 'Configure build & deploy pipeline',
+ id: 'postgresql/how-to/connect',
+ label: 'Connect to PostgreSQL',
},
{
type: 'doc',
- id: 'bun/how-to/trigger-pipeline',
- label: 'Trigger build pipeline',
+ id: 'postgresql/how-to/manage',
+ label: 'Manage users, databases & plugins',
},
{
type: 'doc',
- id: 'bun/how-to/build-process',
- label: 'Build process',
+ id: 'postgresql/how-to/export-import-data',
+ label: 'Export and import data',
},
{
type: 'doc',
- id: 'bun/how-to/deploy-process',
- label: 'Deploy process',
+ id: 'postgresql/how-to/scale',
+ label: 'Scale PostgreSQL service',
},
{
type: 'doc',
- id: 'bun/how-to/customize-runtime',
- label: 'Customize Bun runtime',
+ id: 'postgresql/how-to/control',
+ label: 'Stop and start PostgreSQL service',
},
{
type: 'doc',
- id: 'bun/how-to/logs',
- label: 'Setup & access logs',
+ id: 'postgresql/how-to/delete',
+ label: 'Delete PostgreSQL service',
},
+ ],
+ },
+ // {
+ // type: "category",
+ // label: "Technical details",
+ // collapsible: false,
+ // customProps: {
+ // sidebar_is_group_headline: true,
+ // },
+ // items: [
+ // {
+ // type: "doc",
+ // id: "postgresql/tech-details/cluster",
+ // label: "PostgreSQL cluster asynchronous behaviour",
+ // },
+ // {
+ // type: "doc",
+ // id: "postgresql/tech-details/limitations",
+ // label: "Technical limitations of PostgreSQL cluster",
+ // },
+ // ],
+ // },
+ {
+ type: 'doc',
+ id: 'postgresql/faq',
+ label: 'FAQ',
+ customProps: {
+ sidebar_is_title: true,
+ sidebar_icon: 'chat-bubble-left-right',
+ },
+ },
+ ],
+// mongodb: [
+// {
+// type: 'ref',
+// id: 'homepage',
+// label: 'Back to home',
+// customProps: {
+// sidebar_is_back_link: true,
+// sidebar_icon: 'back-arrow',
+// },
+// },
+ // {
+ // type: 'doc',
+ // id: 'mongodb/overview',
+ // label: 'Zerops MongoDB Service',
+ // customProps: {
+ // sidebar_is_title: true,
+ // sidebar_icon: 'mongodb',
+ // },
+ // },
+// ],
+ elasticsearch: [
+ {
+ type: 'ref',
+ id: 'homepage',
+ label: 'Back to home',
+ customProps: {
+ sidebar_is_back_link: true,
+ sidebar_icon: 'back-arrow',
+ },
+ },
+ {
+ type: 'doc',
+ id: 'elasticsearch/overview',
+ label: 'Zerops Elasticsearch Service',
+ customProps: {
+ sidebar_is_title: true,
+ sidebar_icon: 'elasticsearch',
+ },
+ },
+ ],
+ keydb: [
+ {
+ type: 'ref',
+ id: 'homepage',
+ label: 'Back to home',
+ customProps: {
+ sidebar_is_back_link: true,
+ sidebar_icon: 'back-arrow',
+ },
+ },
+ {
+ type: 'doc',
+ id: 'keydb/overview',
+ label: 'Zerops KeyDB Service',
+ customProps: {
+ sidebar_is_title: true,
+ sidebar_icon: 'keydb',
+ },
+ },
+ {
+ type: 'category',
+ label: 'How-to',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
+ },
+ items: [
{
type: 'doc',
- id: 'bun/how-to/filebrowser',
- label: 'Browse container files',
+ id: 'keydb/how-to/create',
+ label: 'Create KeyDB service',
},
{
type: 'doc',
- id: 'bun/how-to/access',
- label: 'Access Bun runtime service',
+ id: 'keydb/how-to/connect',
+ label: 'Connect to KeyDB',
},
{
type: 'doc',
- id: 'bun/how-to/scaling',
- label: 'Scale Bun runtime service',
+ id: 'keydb/how-to/manage',
+ label: 'Manage users and databases',
},
{
type: 'doc',
- id: 'bun/how-to/controls',
- label: 'Stop & start Bun runtime service',
+ id: 'keydb/how-to/scale',
+ label: 'Scale KeyDB service',
},
{
type: 'doc',
- id: 'bun/how-to/shared-storage',
- label: 'Connect / disconnect shared storage',
+ id: 'keydb/how-to/control',
+ label: 'Stop and start KeyDB service',
},
{
type: 'doc',
- id: 'bun/how-to/delete',
- label: 'Delete Bun service',
+ id: 'keydb/how-to/delete',
+ label: 'Delete KeyDB service',
},
],
},
// {
// type: 'doc',
- // id: 'bun/faq',
+ // id: 'keydb/faq',
// label: 'FAQ',
// customProps: {
// sidebar_is_title: true,
@@ -2453,7 +2203,172 @@ module.exports = {
// },
// },
],
- gleam: [
+ typesense: [
+ {
+ type: 'ref',
+ id: 'homepage',
+ label: 'Back to home',
+ customProps: {
+ sidebar_is_back_link: true,
+ sidebar_icon: 'back-arrow',
+ },
+ },
+ {
+ type: 'doc',
+ id: 'typesense/overview',
+ label: 'Zerops Typesense Service',
+ customProps: {
+ sidebar_is_title: true,
+ sidebar_icon: 'typesense',
+ },
+ },
+ ],
+ meilisearch: [
+ {
+ type: 'ref',
+ id: 'homepage',
+ label: 'Back to home',
+ customProps: {
+ sidebar_is_back_link: true,
+ sidebar_icon: 'back-arrow',
+ },
+ },
+ {
+ type: 'doc',
+ id: 'meilisearch/overview',
+ label: 'Zerops Meilisearch Service',
+ customProps: {
+ sidebar_is_title: true,
+ sidebar_icon: 'meilisearch',
+ },
+ },
+ ],
+ valkey: [
+ {
+ type: 'ref',
+ id: 'homepage',
+ label: 'Back to home',
+ customProps: {
+ sidebar_is_back_link: true,
+ sidebar_icon: 'back-arrow',
+ },
+ },
+ {
+ type: 'doc',
+ id: 'valkey/overview',
+ label: 'Zerops Valkey Service',
+ customProps: {
+ sidebar_is_title: true,
+ sidebar_icon: 'valkey',
+ },
+ },
+ ],
+ qdrant: [
+ {
+ type: 'ref',
+ id: 'homepage',
+ label: 'Back to home',
+ customProps: {
+ sidebar_is_back_link: true,
+ sidebar_icon: 'back-arrow',
+ },
+ },
+ {
+ type: 'doc',
+ id: 'qdrant/overview',
+ label: 'Zerops Qdrant Service',
+ customProps: {
+ sidebar_is_title: true,
+ sidebar_icon: 'qdrant',
+ },
+ },
+ ],
+ nats: [
+ {
+ type: 'ref',
+ id: 'homepage',
+ label: 'Back to home',
+ customProps: {
+ sidebar_is_back_link: true,
+ sidebar_icon: 'back-arrow',
+ },
+ },
+ {
+ type: 'doc',
+ id: 'nats/overview',
+ label: 'Zerops NATS Service',
+ customProps: {
+ sidebar_is_title: true,
+ sidebar_icon: 'nats',
+ },
+ },
+ ],
+ // rabbitmq: [
+ // {
+ // type: "ref",
+ // id: "homepage",
+ // label: "Back to home",
+ // customProps: {
+ // sidebar_is_back_link: true,
+ // sidebar_icon: "back-arrow",
+ // },
+ // },
+ // {
+ // type: "doc",
+ // id: "rabbitmq/overview",
+ // label: "Zerops RabbitMQ Service",
+ // customProps: {
+ // sidebar_is_title: true,
+ // sidebar_icon: "rabbitmq",
+ // },
+ // },
+ // {
+ // type: "category",
+ // label: "How-to",
+ // collapsible: false,
+ // customProps: {
+ // sidebar_is_group_headline: true,
+ // },
+ // items: [
+ // {
+ // type: "doc",
+ // id: "rabbitmq/how-to/create",
+ // label: "Create RabbitMQ service",
+ // },
+ // {
+ // type: "doc",
+ // id: "rabbitmq/how-to/connect",
+ // label: "Connect to RabbitMQ",
+ // },
+ // {
+ // type: "doc",
+ // id: "rabbitmq/how-to/manage",
+ // label: "Manage users and databases",
+ // },
+ // {
+ // type: "doc",
+ // id: "rabbitmq/how-to/export-import-data",
+ // label: "Export and import data",
+ // },
+ // {
+ // type: "doc",
+ // id: "rabbitmq/how-to/scale",
+ // label: "Scale RabbitMQ service",
+ // },
+ // {
+ // type: "doc",
+ // id: "rabbitmq/how-to/control",
+ // label: "Stop and start RabbitMQ service",
+ // },
+ // {
+ // type: "doc",
+ // id: "rabbitmq/how-to/delete",
+ // label: "Delete RabbitMQ service",
+ // },
+ // ],
+ // },
+ // ],
+ sharedstorage: [
{
type: 'ref',
id: 'homepage',
@@ -2465,11 +2380,11 @@ module.exports = {
},
{
type: 'doc',
- id: 'gleam/overview',
- label: 'Getting Started',
+ id: 'shared-storage/overview',
+ label: 'Shared storage overview',
customProps: {
sidebar_is_title: true,
- sidebar_icon: 'gleam',
+ sidebar_icon: 'server',
},
},
{
@@ -2478,96 +2393,47 @@ module.exports = {
collapsible: false,
customProps: {
sidebar_is_group_headline: true,
+ sidebar_icon: 'academic-cap-solid',
},
items: [
{
type: 'doc',
- id: 'gleam/how-to/create',
- label: 'Create Gleam service',
- },
- {
- type: 'doc',
- id: 'gleam/how-to/env-variables',
- label: 'Manage environment variables',
- },
- {
- type: 'doc',
- id: 'gleam/how-to/upgrade',
- label: 'Upgrade Gleam service',
- },
- {
- type: 'doc',
- id: 'gleam/how-to/build-pipeline',
- label: 'Configure build & deploy pipeline',
- },
- {
- type: 'doc',
- id: 'gleam/how-to/trigger-pipeline',
- label: 'Trigger build pipeline',
- },
- {
- type: 'doc',
- id: 'gleam/how-to/build-process',
- label: 'Build process',
- },
- {
- type: 'doc',
- id: 'gleam/how-to/deploy-process',
- label: 'Deploy process',
- },
- {
- type: 'doc',
- id: 'gleam/how-to/customize-runtime',
- label: 'Customize Gleam runtime',
- },
- {
- type: 'doc',
- id: 'gleam/how-to/logs',
- label: 'Setup & access logs',
- },
- {
- type: 'doc',
- id: 'gleam/how-to/filebrowser',
- label: 'Browse container files',
- },
- {
- type: 'doc',
- id: 'gleam/how-to/access',
- label: 'Access Gleam runtime service',
+ id: 'shared-storage/how-to/create',
+ label: 'Create shared storage',
},
{
type: 'doc',
- id: 'gleam/how-to/scaling',
- label: 'Scale Gleam runtime service',
+ id: 'shared-storage/how-to/connect',
+ label: 'Connect shared storage',
},
{
type: 'doc',
- id: 'gleam/how-to/controls',
- label: 'Stop & start Gleam runtime service',
+ id: 'shared-storage/how-to/use',
+ label: 'Usage & Limitations',
},
{
type: 'doc',
- id: 'gleam/how-to/shared-storage',
- label: 'Connect / disconnect shared storage',
+ id: 'shared-storage/how-to/manage',
+ label: 'Manage & Access shared storage',
},
{
type: 'doc',
- id: 'gleam/how-to/delete',
- label: 'Delete Gleam service',
+ id: 'shared-storage/how-to/backup',
+ label: 'Backup shared storage',
},
],
},
- // {
- // type: 'doc',
- // id: 'gleam/faq',
- // label: 'FAQ',
- // customProps: {
- // sidebar_is_title: true,
- // sidebar_icon: 'chat-bubble-left-right',
- // },
- // },
+ {
+ type: 'doc',
+ id: 'shared-storage/tech-details',
+ label: 'Technical details',
+ customProps: {
+ sidebar_is_title: true,
+ sidebar_icon: 'document-text',
+ },
+ },
],
- elixir: [
+ objectstorage: [
{
type: 'ref',
id: 'homepage',
@@ -2579,11 +2445,11 @@ module.exports = {
},
{
type: 'doc',
- id: 'elixir/overview',
- label: 'Getting Started',
+ id: 'object-storage/overview',
+ label: 'Object Storage Overview',
customProps: {
sidebar_is_title: true,
- sidebar_icon: 'elixir',
+ sidebar_icon: 'server',
},
},
{
@@ -2592,95 +2458,577 @@ module.exports = {
collapsible: false,
customProps: {
sidebar_is_group_headline: true,
+ sidebar_icon: 'academic-cap-solid',
},
- items: [
- {
- type: 'doc',
- id: 'elixir/how-to/create',
- label: 'Create Gleam service',
- },
- {
- type: 'doc',
- id: 'elixir/how-to/env-variables',
- label: 'Manage environment variables',
- },
- {
- type: 'doc',
- id: 'elixir/how-to/upgrade',
- label: 'Upgrade Gleam service',
- },
- {
- type: 'doc',
- id: 'elixir/how-to/build-pipeline',
- label: 'Configure build & deploy pipeline',
- },
- {
- type: 'doc',
- id: 'elixir/how-to/trigger-pipeline',
- label: 'Trigger build pipeline',
- },
+ items: [
{
type: 'doc',
- id: 'elixir/how-to/build-process',
- label: 'Build process',
+ id: 'object-storage/how-to/create',
+ label: 'Create object storage service',
},
{
type: 'doc',
- id: 'elixir/how-to/deploy-process',
- label: 'Deploy process',
+ id: 'object-storage/how-to/update-bucket',
+ label: 'Change bucket size or access policy',
},
{
type: 'doc',
- id: 'elixir/how-to/customize-runtime',
- label: 'Customize Gleam runtime',
+ id: 'object-storage/how-to/access',
+ label: 'Access object storage service',
},
{
type: 'doc',
- id: 'elixir/how-to/logs',
- label: 'Setup & access logs',
+ id: 'object-storage/how-to/delete',
+ label: 'Delete object storage service',
},
{
type: 'doc',
- id: 'elixir/how-to/filebrowser',
- label: 'Browse container files',
+ id: 'object-storage/how-to/curl-file',
+ label: 'Download file from a private bucket',
},
- {
- type: 'doc',
- id: 'elixir/how-to/access',
- label: 'Access Gleam runtime service',
+ ],
+ },
+ ],
+ deno: [
+ {
+ type: 'ref',
+ id: 'homepage',
+ label: 'Back to home',
+ customProps: {
+ sidebar_is_back_link: true,
+ sidebar_icon: 'back-arrow',
},
- {
- type: 'doc',
- id: 'elixir/how-to/scaling',
- label: 'Scale Gleam runtime service',
+ },
+ {
+ type: 'doc',
+ id: 'deno/overview',
+ label: 'Getting Started',
+ customProps: {
+ sidebar_is_title: true,
+ sidebar_icon: 'deno',
},
- {
- type: 'doc',
- id: 'elixir/how-to/controls',
- label: 'Stop & start Gleam runtime service',
+ },
+ {
+ type: 'category',
+ label: 'Management',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
},
- {
- type: 'doc',
- id: 'elixir/how-to/shared-storage',
- label: 'Connect / disconnect shared storage',
+ items: [
+ {
+ type: 'doc',
+ id: 'deno/how-to/create',
+ label: 'Create Deno service',
+ },
+ {
+ type: 'doc',
+ id: 'deno/how-to/upgrade',
+ label: 'Upgrade Deno service',
+ },
+ {
+ type: 'doc',
+ id: 'deno/how-to/delete',
+ label: 'Delete Deno service',
+ },
+ {
+ type: 'doc',
+ id: 'deno/how-to/controls',
+ label: 'Stop & start Deno runtime service',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Configuration & Environment',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
},
- {
- type: 'doc',
- id: 'elixir/how-to/delete',
- label: 'Delete Gleam service',
+ items: [
+ {
+ type: 'doc',
+ id: 'deno/how-to/env-variables',
+ label: 'Manage environment variables',
+ },
+ {
+ type: 'doc',
+ id: 'deno/how-to/customize-runtime',
+ label: 'Customize Deno runtime',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Build & Deployment',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
},
- ],
- },
- // {
- // type: 'doc',
- // id: 'elixir/faq',
- // label: 'FAQ',
- // customProps: {
- // sidebar_is_title: true,
- // sidebar_icon: 'chat-bubble-left-right',
- // },
- // },
- ],
+ items: [
+ {
+ type: 'doc',
+ id: 'deno/how-to/build-pipeline',
+ label: 'Configure build & deploy pipeline',
+ },
+ {
+ type: 'doc',
+ id: 'deno/how-to/trigger-pipeline',
+ label: 'Trigger build pipeline',
+ },
+ {
+ type: 'doc',
+ id: 'deno/how-to/build-process',
+ label: 'Build process',
+ },
+ {
+ type: 'doc',
+ id: 'deno/how-to/deploy-process',
+ label: 'Deploy process',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Maintenance & Monitoring',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
+ },
+ items: [
+ {
+ type: 'doc',
+ id: 'deno/how-to/logs',
+ label: 'Setup & access logs',
+ },
+ {
+ type: 'doc',
+ id: 'deno/how-to/filebrowser',
+ label: 'Browse container files',
+ },
+ {
+ type: 'doc',
+ id: 'deno/how-to/access',
+ label: 'Access Bun runtime service',
+ },
+ {
+ type: 'doc',
+ id: 'deno/how-to/scaling',
+ label: 'Scale Deno runtime service',
+ },
+ {
+ type: 'doc',
+ id: 'deno/how-to/shared-storage',
+ label: 'Connect / disconnect shared storage',
+ },
+ ],
+ },
+ ],
+ bun: [
+ {
+ type: 'ref',
+ id: 'homepage',
+ label: 'Back to home',
+ customProps: {
+ sidebar_is_back_link: true,
+ sidebar_icon: 'back-arrow',
+ },
+ },
+ {
+ type: 'doc',
+ id: 'bun/overview',
+ label: 'Getting Started',
+ customProps: {
+ sidebar_is_title: true,
+ sidebar_icon: 'bun',
+ },
+ },
+ {
+ type: 'category',
+ label: 'Management',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
+ },
+ items: [
+ {
+ type: 'doc',
+ id: 'bun/how-to/create',
+ label: 'Create Bun service',
+ },
+ {
+ type: 'doc',
+ id: 'bun/how-to/upgrade',
+ label: 'Upgrade Bun service',
+ },
+ {
+ type: 'doc',
+ id: 'bun/how-to/delete',
+ label: 'Delete Bun service',
+ },
+ {
+ type: 'doc',
+ id: 'bun/how-to/controls',
+ label: 'Stop & start Bun runtime service',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Configuration & Environment',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
+ },
+ items: [
+ {
+ type: 'doc',
+ id: 'bun/how-to/env-variables',
+ label: 'Manage environment variables',
+ },
+ {
+ type: 'doc',
+ id: 'bun/how-to/customize-runtime',
+ label: 'Customize Bun runtime',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Build & Deployment',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
+ },
+ items: [
+ {
+ type: 'doc',
+ id: 'bun/how-to/build-pipeline',
+ label: 'Configure build & deploy pipeline',
+ },
+ {
+ type: 'doc',
+ id: 'bun/how-to/trigger-pipeline',
+ label: 'Trigger build pipeline',
+ },
+ {
+ type: 'doc',
+ id: 'bun/how-to/build-process',
+ label: 'Build process',
+ },
+ {
+ type: 'doc',
+ id: 'bun/how-to/deploy-process',
+ label: 'Deploy process',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Maintenance & Monitoring',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
+ },
+ items: [
+ {
+ type: 'doc',
+ id: 'bun/how-to/logs',
+ label: 'Setup & access logs',
+ },
+ {
+ type: 'doc',
+ id: 'bun/how-to/filebrowser',
+ label: 'Browse container files',
+ },
+ {
+ type: 'doc',
+ id: 'bun/how-to/access',
+ label: 'Access Bun runtime service',
+ },
+ {
+ type: 'doc',
+ id: 'bun/how-to/scaling',
+ label: 'Scale Bun runtime service',
+ },
+ {
+ type: 'doc',
+ id: 'bun/how-to/shared-storage',
+ label: 'Connect / disconnect shared storage',
+ },
+ ],
+ },
+ ],
+ gleam: [
+ {
+ type: 'ref',
+ id: 'homepage',
+ label: 'Back to home',
+ customProps: {
+ sidebar_is_back_link: true,
+ sidebar_icon: 'back-arrow',
+ },
+ },
+ {
+ type: 'doc',
+ id: 'gleam/overview',
+ label: 'Getting Started',
+ customProps: {
+ sidebar_is_title: true,
+ sidebar_icon: 'gleam',
+ },
+ },
+ {
+ type: 'category',
+ label: 'Management',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
+ },
+ items: [
+ {
+ type: 'doc',
+ id: 'gleam/how-to/create',
+ label: 'Create Gleam service',
+ },
+ {
+ type: 'doc',
+ id: 'gleam/how-to/upgrade',
+ label: 'Upgrade Gleam service',
+ },
+ {
+ type: 'doc',
+ id: 'gleam/how-to/delete',
+ label: 'Delete Gleam service',
+ },
+ {
+ type: 'doc',
+ id: 'gleam/how-to/controls',
+ label: 'Stop & start Gleam runtime service',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Configuration & Environment',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
+ },
+ items: [
+ {
+ type: 'doc',
+ id: 'gleam/how-to/env-variables',
+ label: 'Manage environment variables',
+ },
+ {
+ type: 'doc',
+ id: 'gleam/how-to/customize-runtime',
+ label: 'Customize Gleam runtime',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Build & Deployment',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
+ },
+ items: [
+ {
+ type: 'doc',
+ id: 'gleam/how-to/build-pipeline',
+ label: 'Configure build & deploy pipeline',
+ },
+ {
+ type: 'doc',
+ id: 'gleam/how-to/trigger-pipeline',
+ label: 'Trigger build pipeline',
+ },
+ {
+ type: 'doc',
+ id: 'gleam/how-to/build-process',
+ label: 'Build process',
+ },
+ {
+ type: 'doc',
+ id: 'gleam/how-to/deploy-process',
+ label: 'Deploy process',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Maintenance & Monitoring',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
+ },
+ items: [
+ {
+ type: 'doc',
+ id: 'gleam/how-to/logs',
+ label: 'Setup & access logs',
+ },
+ {
+ type: 'doc',
+ id: 'gleam/how-to/filebrowser',
+ label: 'Browse container files',
+ },
+ {
+ type: 'doc',
+ id: 'gleam/how-to/access',
+ label: 'Access Gleam runtime service',
+ },
+ {
+ type: 'doc',
+ id: 'gleam/how-to/scaling',
+ label: 'Scale Gleam runtime service',
+ },
+ {
+ type: 'doc',
+ id: 'gleam/how-to/shared-storage',
+ label: 'Connect / disconnect shared storage',
+ },
+ ],
+ },
+ ],
+ elixir: [
+ {
+ type: 'ref',
+ id: 'homepage',
+ label: 'Back to home',
+ customProps: {
+ sidebar_is_back_link: true,
+ sidebar_icon: 'back-arrow',
+ },
+ },
+ {
+ type: 'doc',
+ id: 'elixir/overview',
+ label: 'Getting Started',
+ customProps: {
+ sidebar_is_title: true,
+ sidebar_icon: 'elixir',
+ },
+ },
+ {
+ type: 'category',
+ label: 'Management',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
+ },
+ items: [
+ {
+ type: 'doc',
+ id: 'elixir/how-to/create',
+ label: 'Create Elixir service',
+ },
+ {
+ type: 'doc',
+ id: 'elixir/how-to/upgrade',
+ label: 'Upgrade Elixir service',
+ },
+ {
+ type: 'doc',
+ id: 'elixir/how-to/delete',
+ label: 'Delete Elixir service',
+ },
+ {
+ type: 'doc',
+ id: 'elixir/how-to/controls',
+ label: 'Stop & start Elixir runtime service',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Configuration & Environment',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
+ },
+ items: [
+ {
+ type: 'doc',
+ id: 'elixir/how-to/env-variables',
+ label: 'Manage environment variables',
+ },
+ {
+ type: 'doc',
+ id: 'elixir/how-to/customize-runtime',
+ label: 'Customize Elixir runtime',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Build & Deployment',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
+ },
+ items: [
+ {
+ type: 'doc',
+ id: 'elixir/how-to/build-pipeline',
+ label: 'Configure build & deploy pipeline',
+ },
+ {
+ type: 'doc',
+ id: 'elixir/how-to/trigger-pipeline',
+ label: 'Trigger build pipeline',
+ },
+ {
+ type: 'doc',
+ id: 'elixir/how-to/build-process',
+ label: 'Build process',
+ },
+ {
+ type: 'doc',
+ id: 'elixir/how-to/deploy-process',
+ label: 'Deploy process',
+ },
+ ],
+ },
+ {
+ type: 'category',
+ label: 'Maintenance & Monitoring',
+ collapsible: false,
+ customProps: {
+ sidebar_is_group_headline: true,
+ },
+ items: [
+ {
+ type: 'doc',
+ id: 'elixir/how-to/logs',
+ label: 'Setup & access logs',
+ },
+ {
+ type: 'doc',
+ id: 'elixir/how-to/filebrowser',
+ label: 'Browse container files',
+ },
+ {
+ type: 'doc',
+ id: 'elixir/how-to/access',
+ label: 'Access Elixir runtime service',
+ },
+ {
+ type: 'doc',
+ id: 'elixir/how-to/scaling',
+ label: 'Scale Elixir runtime service',
+ },
+ {
+ type: 'doc',
+ id: 'elixir/how-to/shared-storage',
+ label: 'Connect / disconnect shared storage',
+ },
+ ],
+ },
+ ],
laravel: [
{
type: 'ref',
@@ -2872,206 +3220,3 @@ module.exports = {
},
],
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// {
-// type: "category",
-// label: "Nest.js",
-// link: {
-// type: "doc",
-// id: "frameworks/nestjs/index",
-// },
-// customProps: {
-// sidebar_icon: "nestjs",
-// },
-// className: "homepage-sidebar-item",
-// items: [
-// {
-// type: "doc",
-// id: "frameworks/nestjs/index",
-// label: "Overview & quickstart",
-// },
-// {
-// type: "doc",
-// id: "frameworks/nestjs/log",
-// label: "Setup & access logs",
-// },
-// {
-// type: "doc",
-// id: "frameworks/nestjs/template",
-// label: "Create templates with import & seed",
-// },
-// {
-// type: "doc",
-// id: "frameworks/nestjs/env-variables",
-// label: "Utilize environment variables",
-// },
-// {
-// type: "doc",
-// id: "frameworks/nestjs/migration",
-// label: "Migration & upgrades",
-// },
-// {
-// type: "doc",
-// id: "frameworks/nestjs/backups",
-// label: "Backups",
-// },
-// {
-// type: "doc",
-// id: "frameworks/nestjs/scaling",
-// label: "Optimize scaling",
-// },
-// {
-// type: "doc",
-// id: "frameworks/nestjs/scaling",
-// label: "High availability, when, how, why",
-// },
-// {
-// type: "doc",
-// id: "frameworks/nestjs/cron",
-// label: "CRON / Scheduled jobs",
-// },
-// {
-// type: "doc",
-// id: "frameworks/nestjs/mails",
-// label: "SMTP & sending emails",
-// },
-// {
-// type: "doc",
-// id: "frameworks/nestjs/routing",
-// label: "Public access from domain, IP, subdomain",
-// },
-// ],
-// },
-// {
-// type: "category",
-// label: "Laravel",
-// link: {
-// type: "doc",
-// id: "frameworks/laravel/index",
-// },
-// customProps: {
-// sidebar_icon: "laravel",
-// },
-// className: "homepage-sidebar-item",
-// items: [
-// {
-// type: "doc",
-// id: "frameworks/laravel/examples",
-// label: "Examples",
-// customProps: {
-// exclude_from_doc_list: false,
-// },
-// },
-// ],
-// },
-// {
-// type: "category",
-// label: "Gingonic",
-// link: {
-// type: "doc",
-// id: "frameworks/gingonic/index",
-// },
-// customProps: {
-// sidebar_icon: "gingonic",
-// },
-// className: "homepage-sidebar-item",
-// items: [
-// {
-// type: "doc",
-// id: "frameworks/gingonic/examples",
-// label: "Examples",
-// customProps: {
-// exclude_from_doc_list: false,
-// },
-// },
-// ],
-// },
-// {
-// type: "category",
-// label: "Nette",
-// link: {
-// type: "doc",
-// id: "frameworks/nette/index",
-// },
-// customProps: {
-// sidebar_icon: "nette",
-// },
-// className: "homepage-sidebar-item",
-// items: [
-// {
-// type: "doc",
-// id: "frameworks/nette/examples",
-// label: "Examples",
-// customProps: {
-// exclude_from_doc_list: false,
-// },
-// },
-// ],
-// },
-// {
-// type: "category",
-// label: "Strapi",
-// link: {
-// type: "doc",
-// id: "frameworks/strapi/index",
-// },
-// customProps: {
-// sidebar_icon: "strapi",
-// },
-// className: "homepage-sidebar-item",
-// items: [
-// {
-// type: "doc",
-// id: "frameworks/strapi/examples",
-// label: "Examples",
-// customProps: {
-// exclude_from_doc_list: false,
-// },
-// },
-// ],
-// },
-// {
-// type: "category",
-// label: "Medusa",
-// link: {
-// type: "doc",
-// id: "frameworks/medusa/index",
-// },
-// customProps: {
-// sidebar_icon: "medusa",
-// },
-// className: "homepage-sidebar-item",
-// items: [
-// {
-// type: "doc",
-// id: "frameworks/medusa/examples",
-// label: "Examples",
-// customProps: {
-// exclude_from_doc_list: false,
-// },
-// },
-// ],
-// },
diff --git a/apps/docs/src/components/Footer/SocialLinks/index.tsx b/apps/docs/src/components/Footer/SocialLinks/index.tsx
index 8c9d659f4..c660b1936 100644
--- a/apps/docs/src/components/Footer/SocialLinks/index.tsx
+++ b/apps/docs/src/components/Footer/SocialLinks/index.tsx
@@ -3,6 +3,7 @@ import IconTwitter from '@site/src/theme/Icon/Twitter';
import IconGitHub from '@site/src/theme/Icon/GitHub';
import IconDiscord from '@site/src/theme/Icon/Discord';
import IconLinkedIn from '@site/src/theme/Icon/LinkedIn';
+import IconModel from '@site/src/theme/Icon/Model';
import { SocialLink } from '@medusajs/docs';
import Link from '@docusaurus/Link';
@@ -12,6 +13,9 @@ type SocialLinksProps = {
const SocialLinks: React.FC = ({ links = [] }) => {
const socialIcons = {
+ model: (
+
+ ),
twitter: (
),
@@ -37,6 +41,7 @@ const SocialLinks: React.FC = ({ links = [] }) => {
{socialIcons[link.type]}
))}
+
);
};
diff --git a/apps/docs/src/components/PricingCalculator/index.tsx b/apps/docs/src/components/PricingCalculator/index.tsx
index cdef267bc..9cd1d0979 100644
--- a/apps/docs/src/components/PricingCalculator/index.tsx
+++ b/apps/docs/src/components/PricingCalculator/index.tsx
@@ -31,7 +31,7 @@ function PricingCalculatorContent() {
const [resources, setResources] = React.useState({
cpu: 1,
cpuType: 'shared',
- ram: 0.25,
+ ram: 0.125,
disk: 1,
storage: 0,
ipv4_addr: 0,
@@ -46,11 +46,11 @@ function PricingCalculatorContent() {
try {
const savedServices = localStorage.getItem('zerops-calculator-services');
const savedResources = localStorage.getItem('zerops-calculator-resources');
-
+
if (savedServices) {
setServices(JSON.parse(savedServices));
}
-
+
if (savedResources) {
setResources(JSON.parse(savedResources));
}
@@ -81,7 +81,7 @@ function PricingCalculatorContent() {
setResources({
cpu: 1,
cpuType: 'shared',
- ram: 0.25,
+ ram: 0.125,
disk: 1,
storage: 0,
ipv4_addr: 0,
@@ -100,7 +100,7 @@ function PricingCalculatorContent() {
ipv4_addr: 3,
backup: 0.1,
buildTime: 0.033,
- egress: 0.1,
+ egress: 0.02,
core: resources.core === 'lightweight' ? 0.0 : 10.0,
};
@@ -129,13 +129,13 @@ function PricingCalculatorContent() {
};
const handleServiceAdjust = (serviceId: string, field: keyof Service, amount: number) => {
- setServices(prevServices =>
+ setServices(prevServices =>
prevServices.map(service => {
if (service.id === serviceId) {
- const minValue = field === 'nodes' ? 1 :
- field === 'ram' ? 0.25 :
+ const minValue = field === 'nodes' ? 1 :
+ field === 'ram' ? 0.125 :
field === 'disk' ? 1 : 1;
- const step = field === 'ram' ? 0.25 :
+ const step = field === 'ram' ? 0.125 :
field === 'disk' ? 0.5 : 1;
const newValue = Math.max(minValue, service[field] as number + amount * step);
return { ...service, [field]: newValue };
@@ -172,7 +172,7 @@ function PricingCalculatorContent() {
nodes: 1,
cpu: 1,
cpuType: 'shared',
- ram: 0.25,
+ ram: 0.125,
disk: 1,
};
setServices([...services, newService]);
@@ -196,7 +196,7 @@ function PricingCalculatorContent() {
const calculateTotal = () => {
const servicesCost = services.reduce((total, service) => total + calculateServiceCost(service), 0);
- const additionalCost =
+ const additionalCost =
resources.storage * price.storage +
resources.ipv4_addr * price.ipv4_addr +
resources.backup * price.backup +
@@ -214,11 +214,11 @@ function PricingCalculatorContent() {
setServices(prevServices =>
prevServices.map(service => {
if (service.id === serviceId) {
- const minValue = field === 'nodes' ? 1 :
- field === 'ram' ? 0.25 :
+ const minValue = field === 'nodes' ? 1 :
+ field === 'ram' ? 0.125 :
field === 'disk' ? 1 : 1;
-
- const formattedValue = field === 'ram' || field === 'disk'
+
+ const formattedValue = field === 'ram' || field === 'disk'
? Math.max(minValue, Math.round(numValue * 4) / 4)
: Math.max(minValue, Math.round(numValue));
@@ -229,207 +229,282 @@ function PricingCalculatorContent() {
);
};
- const exportToPDF = () => {
- const doc = new jsPDF();
- const margin = 20;
- let y = margin;
- const lineHeight = 7;
- const sectionSpacing = 20;
- const indent = 10;
- const pageWidth = doc.internal.pageSize.width;
- const contentWidth = pageWidth - (margin * 2);
-
- const colors = {
- primary: [46, 164, 149], // #2EA495
- success: [46, 164, 149], // #2EA495
- gray: [46, 164, 149], // #2EA495
- darkText: [46, 164, 149], // #2EA495
- lightGray: [236, 239, 243], // #ECEFF3
- white: [236, 239, 243], // #ECEFF3
- lightBlue: [236, 239, 243], // #ECEFF3
- footerBg: [236, 239, 243] // #ECEFF3
- };
-
- const setColor = (colorArray: number[]) => {
- doc.setFillColor(colorArray[0], colorArray[1], colorArray[2]);
- doc.setTextColor(colorArray[0], colorArray[1], colorArray[2]);
+const exportToPDF = () => {
+ // Calculate individual resource costs
+ const calculateResourceCosts = (service) => {
+ const cpuPrice = service.cpuType === 'shared' ? 0.6 : 6;
+ return {
+ cpu: service.nodes * service.cpu * cpuPrice,
+ ram: service.nodes * service.ram * price.ram,
+ disk: service.nodes * service.disk * price.disk
};
+ };
- const addText = (text: string, x: number, y: number, options: {
- fontSize?: number;
- isBold?: boolean;
- isGray?: boolean;
- align?: 'left' | 'right';
- color?: number[];
- } = {}) => {
- const { fontSize = 12, isBold = false, isGray = false, align = 'left', color } = options;
- doc.setFontSize(fontSize);
- doc.setFont('helvetica', isBold ? 'bold' : 'normal');
-
- if (color) {
- setColor(color);
- } else if (isGray) {
- setColor(colors.gray);
- } else {
- setColor(colors.darkText);
- }
-
- if (align === 'right') {
- const textWidth = doc.getTextWidth(text);
- doc.text(text, pageWidth - margin - textWidth, y);
- } else {
- doc.text(text, x, y);
- }
- };
+ // Create new PDF document
+ const doc = new jsPDF({
+ orientation: 'portrait',
+ unit: 'mm',
+ format: 'a4'
+ });
- const addLine = (yPos: number) => {
- doc.setDrawColor(colors.lightGray[0], colors.lightGray[1], colors.lightGray[2]);
- doc.line(margin, yPos, pageWidth - margin, yPos);
+ // Document dimensions
+ const pageWidth = doc.internal.pageSize.getWidth();
+ const margin = 8;
+ const contentWidth = pageWidth - (margin * 2);
+
+ // Set up fonts - using standard fonts for compatibility
+ doc.setFont("helvetica");
+
+ // Color settings
+ const primaryColor = [104, 186, 178]; // #68BAB2 in RGB
+ const grayBg = [236, 239, 243]; // #ECEFF3 in RGB
+ const textColor = [51, 51, 51]; // #333333 in RGB
+ const secondaryTextColor = [85, 85, 85]; // #555555 in RGB
+
+ // Helper function for text
+ const addText = (text, x, y, options = {}) => {
+ const defaultOptions = {
+ align: 'left',
+ size: 10,
+ style: 'normal',
+ color: textColor
};
+ const opts = { ...defaultOptions, ...options };
- const addSectionBackground = (yStart: number, height: number) => {
- doc.setFillColor(colors.lightBlue[0], colors.lightBlue[1], colors.lightBlue[2]);
- doc.rect(margin - 5, yStart - 5, contentWidth + 10, height, 'F');
- };
+ doc.setTextColor(...opts.color);
+ doc.setFontSize(opts.size);
- addSectionBackground(y - 5, 30);
- addText('Zerops Cost Calculator', margin, y, { fontSize: 24, isBold: true, color: colors.primary });
- y += lineHeight * 2;
- addText(`Selected Package: ${resources.core === 'lightweight' ? 'Lightweight' : 'Serious'} Core`, margin, y, { fontSize: 14, color: colors.success });
- y += lineHeight * 2;
- addLine(y - 3);
- y += lineHeight;
-
- if (services.length > 0) {
- addText('Services', margin, y, { fontSize: 16, isBold: true, color: colors.primary });
- y += lineHeight * 1.5;
-
- services.forEach((service, index) => {
- addSectionBackground(y - 5, 45);
- addText(service.name, margin, y, { fontSize: 14, isBold: true, color: colors.darkText });
- y += lineHeight;
-
- const details = [
- { label: 'Nodes', value: service.nodes },
- { label: 'CPU', value: `${service.cpu} (${service.cpuType})` },
- { label: 'RAM', value: `${service.ram}GB` },
- { label: 'Disk', value: `${service.disk}GB` }
- ];
-
- details.forEach(detail => {
- addText(`${detail.label}:`, margin + indent, y, { color: colors.gray });
- addText(detail.value.toString(), margin + 80, y, { color: colors.darkText });
- y += lineHeight;
- });
-
- const serviceCost = calculateServiceCost(service);
- addText('Monthly Cost:', margin + indent, y, { color: colors.gray });
- addText(`$${formatNumber(serviceCost)}`, margin + 80, y, { isBold: true, color: colors.primary });
- y += lineHeight;
-
- if (index < services.length - 1) {
- y += lineHeight;
- addLine(y - 3);
- y += lineHeight;
- }
- });
- y += sectionSpacing;
- addLine(y - 10);
+ if (opts.style === 'bold') {
+ doc.setFont("helvetica", "bold");
+ } else {
+ doc.setFont("helvetica", "normal");
}
- if (resources.ipv4_addr > 0 || resources.storage > 0) {
- y += lineHeight;
- addText('Additional Features', margin, y, { fontSize: 16, isBold: true, color: colors.primary });
- y += lineHeight * 1.5;
+ doc.text(text, x, y, { align: opts.align });
+ };
- addSectionBackground(y - 5, resources.ipv4_addr > 0 && resources.storage > 0 ? 30 : 15);
+ // Helper function for colored rectangles
+ const addRect = (x, y, width, height, color) => {
+ doc.setFillColor(...color);
+ doc.rect(x, y, width, height, 'F');
+ };
- if (resources.ipv4_addr > 0) {
- addText('IPv4 Addresses:', margin, y, { color: colors.gray });
- addText(`${resources.ipv4_addr} × $${price.ipv4_addr.toFixed(2)}/month`, pageWidth - margin - 80, y, { align: 'right', color: colors.darkText });
- y += lineHeight;
- }
+ // Helper for drawing lines
+ const addLine = (x1, y1, x2, y2, color = [221, 221, 221]) => {
+ doc.setDrawColor(...color);
+ doc.setLineWidth(0.1);
+ doc.line(x1, y1, x2, y2);
+ };
- if (resources.storage > 0) {
- addText('Object Storage:', margin, y, { color: colors.gray });
- addText(`${resources.storage}GB × $${price.storage.toFixed(2)}/GB/month`, pageWidth - margin - 80, y, { align: 'right', color: colors.darkText });
- y += lineHeight;
- }
- y += sectionSpacing - lineHeight;
- addLine(y - 10);
- }
+ // Current position tracker
+ let y = 20;
- if (resources.backup > 0 || resources.buildTime > 0 || resources.egress > 0) {
- y += lineHeight;
- addText('Additional Costs', margin, y, { fontSize: 16, isBold: true, color: colors.primary });
- y += lineHeight * 1.5;
+ // Header
+ addRect(0, 0, pageWidth, 28, primaryColor);
+ addText('Zerops Cost Estimate', margin, 12, {
+ size: 16,
+ style: 'bold',
+ color: [255, 255, 255]
+ });
+ addText(`Generated on ${new Date().toLocaleDateString('en-GB', {
+ day: '2-digit',
+ month: '2-digit',
+ year: 'numeric'
+ })}`, margin, 20, {
+ size: 8,
+ color: [255, 255, 255]
+ });
- const costsHeight = (
- (resources.backup > 0 ? 1 : 0) +
- (resources.buildTime > 0 ? 1 : 0) +
- (resources.egress > 0 ? 1 : 0)
- ) * lineHeight + 10;
+ y = 32;
- addSectionBackground(y - 5, costsHeight);
+ // Project Configuration Section
+ y += 4;
+ addText('Project Configuration', margin, y, {
+ size: 12,
+ style: 'bold'
+ });
+ y += 8;
+ addText(`Selected Plan: ${resources.core === 'lightweight' ? 'Lightweight' : 'Serious'}`,
+ margin + 5, y);
+ addText(`$${price.core.toFixed(2)}`, pageWidth - margin - 5, y, {
+ align: 'right',
+ style: 'bold'
+ });
- if (resources.backup > 0) {
- addText('Backup Space:', margin, y, { color: colors.gray });
- addText(`${resources.backup}GB ($0.50 per 5GB)`, pageWidth - margin - 80, y, { align: 'right', color: colors.darkText });
- y += lineHeight;
- }
+ y += 12;
- if (resources.buildTime > 0) {
- addText('Build Time:', margin, y, { color: colors.gray });
- addText(`${resources.buildTime} hours ($0.50 per 15 hours)`, pageWidth - margin - 80, y, { align: 'right', color: colors.darkText });
- y += lineHeight;
- }
+ addText('Services', margin, y, {
+ size: 12,
+ style: 'bold'
+ });
+ y += 8;
- if (resources.egress > 0) {
- addText('Egress Traffic:', margin, y, { color: colors.gray });
- addText(`${resources.egress}GB ($0.10 per 1GB)`, pageWidth - margin - 80, y, { align: 'right', color: colors.darkText });
- y += lineHeight;
- }
- y += sectionSpacing - lineHeight;
- addLine(y - 10);
+ // Services Section
+ services.forEach((service, index) => {
+ const resourceCosts = calculateResourceCosts(service);
+
+ // Add a page break if necessary
+ if (y > 250) {
+ doc.addPage();
+ y = 20;
}
- y += lineHeight;
- addSectionBackground(y - 5, 35);
- const packageName = resources.core === 'lightweight' ? 'Lightweight Core' : 'Serious Core';
- const packageCost = resources.core === 'lightweight' ? '0.00' : '10.00';
- addText(packageName + ':', margin, y, { color: colors.gray });
- addText(`$${packageCost}/month`, pageWidth - margin - 80, y, { align: 'right', color: colors.darkText });
- y += lineHeight * 2;
-
- addText('Total Monthly Cost:', margin, y, { fontSize: 16, isBold: true, color: colors.gray });
- addText(`$${calculateTotal()}`, pageWidth - margin - 80, y, {
- fontSize: 16,
- isBold: true,
+ // Service header
+ addText(service.name, margin, y, {
+ size: 12,
+ style: 'bold',
+ color: primaryColor
+ });
+
+ y += 6;
+
+ // CPU
+ addText('CPU', margin + 5, y, { color: secondaryTextColor, size: 9 });
+ addText(`(${service.cpu} ${service.cpuType}, ${service.nodes} nodes) @ $${service.cpuType === 'shared' ? '0.60' : '6.00'}/CPU = $${formatNumber(resourceCosts.cpu)}`,
+ pageWidth - margin - 5, y, {
+ align: 'right',
+ color: secondaryTextColor,
+ size: 9
+ });
+
+ y += 6;
+
+ // RAM
+ addText('RAM', margin + 5, y, { color: secondaryTextColor, size: 9 });
+ addText(`(${service.ram}GB × ${service.nodes} nodes) @ $3.00/GB = $${formatNumber(resourceCosts.ram)}`,
+ pageWidth - margin - 5, y, {
+ align: 'right',
+ color: secondaryTextColor,
+ size: 9
+ });
+
+ y += 6;
+
+ // Disk
+ addText('Disk', margin + 5, y, { color: secondaryTextColor, size: 9 });
+ addText(`(${service.disk}GB × ${service.nodes} nodes) @ $0.05/GB = $${formatNumber(resourceCosts.disk)}`,
+ pageWidth - margin - 5, y, {
+ align: 'right',
+ color: secondaryTextColor,
+ size: 9
+ });
+
+ y += 6;
+
+ addText('Total', margin + 5, y, {
+ color: secondaryTextColor,
+ size: 9,
+ style: 'bold'
+ });
+ addText(`$${formatNumber(calculateServiceCost(service))}`, pageWidth - margin - 5, y, {
align: 'right',
- color: colors.primary
+ size: 9,
+ style: 'bold'
});
- const addFooter = () => {
- const footerY = doc.internal.pageSize.height - 20;
-
- doc.setFillColor(colors.footerBg[0], colors.footerBg[1], colors.footerBg[2]);
- doc.rect(0, footerY - 10, pageWidth, 30, 'F');
-
- doc.setFontSize(10);
- doc.setTextColor(colors.gray[0], colors.gray[1], colors.gray[2]);
- doc.text('Generated from docs.zerops.io', margin, footerY + 5);
- };
+ addLine(margin, y + 5, pageWidth - margin - 5, y + 5);
- addFooter();
+ y += 12;
+ });
- doc.save('zerops-cost-calculator.pdf');
- };
+ y += 4
+
+ // Additional Features Section
+ if (resources.ipv4_addr > 0 || resources.storage > 0 || resources.backup > 0 ||
+ resources.buildTime > 0 || resources.egress > 0) {
+
+ // Add a page break if necessary
+ if (y > 200) {
+ doc.addPage();
+ y = 20;
+ }
+
+ // Section background
+ // Section title
+ addText('Additional Features', margin, y, {
+ size: 12,
+ style: 'bold'
+ });
+
+ y += 8;
+
+ if (resources.ipv4_addr > 0) {
+ addText(`Dedicated IPv4 (${resources.ipv4_addr})`, margin + 5, y);
+ addText(`$${formatNumber(resources.ipv4_addr * price.ipv4_addr)}`,
+ pageWidth - margin - 5, y, { align: 'right' });
+ y += 8;
+ }
+
+ if (resources.storage > 0) {
+ addText(`Object Storage (${resources.storage} GB)`, margin + 5, y);
+ addText(`$${formatNumber(resources.storage * price.storage)}`,
+ pageWidth - margin - 5, y, { align: 'right' });
+ y += 8;
+ }
+
+ if (resources.backup > 0) {
+ addText(`Extra Backup Space (${resources.backup} GB)`, margin + 5, y);
+ addText(`$${formatNumber(resources.backup * price.backup)}`,
+ pageWidth - margin - 5, y, { align: 'right' });
+ y += 8;
+ }
+
+ if (resources.buildTime > 0) {
+ addText(`Extra Build Time (${resources.buildTime} hours)`, margin + 5, y);
+ addText(`$${formatNumber(resources.buildTime * price.buildTime)}`,
+ pageWidth - margin - 5, y, { align: 'right' });
+ y += 8;
+ }
+
+ if (resources.egress > 0) {
+ addText(`Extra Egress (${resources.egress} GB)`, margin + 5, y);
+ addText(`$${formatNumber(resources.egress * price.egress)}`,
+ pageWidth - margin - 5, y, { align: 'right' });
+ y += 8;
+ }
+ }
+
+ // Add a page break if necessary for the total
+ if (y > 220) {
+ doc.addPage();
+ y = 20;
+ }
+
+ // Total section
+ addRect(0, y, pageWidth, 20, primaryColor);
+ addText('Total Monthly Cost', margin, y + 12, {
+ size: 12,
+ color: [255, 255, 255]
+ });
+ addText(`$${calculateTotal()}`, pageWidth - margin - 5, y + 12, {
+ align: 'right',
+ size: 14,
+ style: 'bold',
+ color: [255, 255, 255]
+ });
+
+ y += 30;
+
+ // Footer
+ addText('All prices are in USD and calculated for a 30-day period', margin, y, {
+ size: 8,
+ color: [102, 102, 102]
+ });
+
+ y += 5;
+
+ addText('Resources are billed by the minute with hourly credit deduction based on actual usage',
+ margin, y, { size: 8, color: [102, 102, 102] });
+
+ // Save PDF
+ doc.save('zerops-cost-estimate.pdf');
+};
return (
-
setResources(prev => ({ ...prev, core: 'lightweight' }))}
>
@@ -442,7 +517,7 @@ function PricingCalculatorContent() {
-
setResources(prev => ({ ...prev, core: 'serious' }))}
>
@@ -477,37 +552,37 @@ function PricingCalculatorContent() {
placeholder="Service Name"
/>
-
removeService(service.id)}
aria-label="Remove service"
>
×
-
+
Nodes
- handleServiceAdjust(service.id, 'nodes', -1)}
disabled={service.nodes <= 1}
>
-
- handleServiceInputChange(service.id, 'nodes', e.target.value)}
min={1}
step={1}
/>
- handleServiceAdjust(service.id, 'nodes', 1)}
>
@@ -524,7 +599,7 @@ function PricingCalculatorContent() {
-
handleServiceTypeChange(service.id, e.target.value as 'shared' | 'dedicated')}
@@ -533,22 +608,22 @@ function PricingCalculatorContent() {
Dedicated
- handleServiceAdjust(service.id, 'cpu', -1)}
disabled={service.cpu <= 1}
>
-
- handleServiceInputChange(service.id, 'cpu', e.target.value)}
min={1}
step={1}
/>
- handleServiceAdjust(service.id, 'cpu', 1)}
>
@@ -564,22 +639,22 @@ function PricingCalculatorContent() {
${price.ram.toFixed(2)} / GB / month
- handleServiceAdjust(service.id, 'ram', -1)}
- disabled={service.ram <= 0.25}
+ disabled={service.ram <= 0.125}
>
-
- handleServiceInputChange(service.id, 'ram', e.target.value)}
- min={0.25}
- step={0.25}
+ min={0.125}
+ step={0.125}
/>
- handleServiceAdjust(service.id, 'ram', 1)}
>
@@ -594,22 +669,22 @@ function PricingCalculatorContent() {
${price.disk.toFixed(2)} / GB / month
- handleServiceAdjust(service.id, 'disk', -1)}
disabled={service.disk <= 1}
>
-
- handleServiceInputChange(service.id, 'disk', e.target.value)}
min={1}
step={0.5}
/>
- handleServiceAdjust(service.id, 'disk', 1)}
>
@@ -625,7 +700,7 @@ function PricingCalculatorContent() {
))}
-
@@ -639,7 +714,7 @@ function PricingCalculatorContent() {
Additional Features
-
+
Unique IPv4 Addresses
@@ -701,7 +776,7 @@ function PricingCalculatorContent() {
Additional Costs
-
+
Backup Space (GB)
@@ -763,7 +838,7 @@ function PricingCalculatorContent() {
Egress Traffic (GB)
- $0.10 per 1GB
+ $0.02 per 1GB
-
@@ -821,4 +896,4 @@ export default function PricingCalculator() {
{() => }
);
-}
+}
\ No newline at end of file
diff --git a/apps/docs/src/components/ResourceTable/index.tsx b/apps/docs/src/components/ResourceTable/index.tsx
new file mode 100644
index 000000000..ff5e82b23
--- /dev/null
+++ b/apps/docs/src/components/ResourceTable/index.tsx
@@ -0,0 +1,51 @@
+import React from 'react';
+
+const DEFAULT_RESOURCES = {
+ cpu: {
+ name: 'CPU cores',
+ min: '1',
+ max: '5'
+ },
+ ram: {
+ name: 'RAM',
+ min: '0.125 GB',
+ max: '32 GB'
+ },
+ disk: {
+ name: 'Disk',
+ min: '1 GB',
+ max: '100 GB'
+ }
+};
+
+const ResourceTable = ({ resources = {} }) => {
+ // Merge provided resources with defaults
+ const finalResources = {
+ cpu: { ...DEFAULT_RESOURCES.cpu, ...resources.cpu },
+ ram: { ...DEFAULT_RESOURCES.ram, ...resources.ram },
+ disk: { ...DEFAULT_RESOURCES.disk, ...resources.disk }
+ };
+
+ return (
+
+
+
+
+ Minimum
+ Maximum
+
+
+
+ {Object.values(finalResources).map((resource, index) => (
+
+ {resource.name}
+ {resource.min}
+ {resource.max}
+
+ ))}
+
+
+ );
+};
+
+export default ResourceTable;
\ No newline at end of file
diff --git a/apps/docs/src/components/TabbedCodeBlock/index.tsx b/apps/docs/src/components/TabbedCodeBlock/index.tsx
new file mode 100644
index 000000000..d05163f38
--- /dev/null
+++ b/apps/docs/src/components/TabbedCodeBlock/index.tsx
@@ -0,0 +1,50 @@
+// TabbedCodeBlocks.jsx
+import React, { useState } from 'react';
+import CodeBlock from '@theme/CodeBlock';
+import styles from './styles.module.css';
+
+/**
+ * Component for displaying code blocks with tabs
+ * @param {Object} props
+ * @param {Array} props.tabs - Array of tab objects { label, code, language, title }
+ * @param {string} props.defaultTab - Label of the default selected tab
+ */
+const TabbedCodeBlocks = ({ tabs, defaultTab }) => {
+ const [activeTab, setActiveTab] = useState(defaultTab || (tabs.length > 0 ? tabs[0].label : ''));
+
+ const handleTabChange = (tabLabel) => {
+ setActiveTab(tabLabel);
+ };
+
+ // Find the currently active tab object
+ const activeTabData = tabs.find(tab => tab.label === activeTab) || tabs[0];
+
+ // Determine title - only use title if it's non-empty
+ const codeTitle = activeTabData.title ? activeTabData.title : null;
+
+ return (
+
+
+ {tabs.map(tab => (
+ handleTabChange(tab.label)}
+ >
+ {tab.label}
+
+ ))}
+
+
+
+ {activeTabData.code}
+
+
+
+ );
+};
+
+export default TabbedCodeBlocks;
\ No newline at end of file
diff --git a/apps/docs/src/components/TabbedCodeBlock/styles.module.css b/apps/docs/src/components/TabbedCodeBlock/styles.module.css
new file mode 100644
index 000000000..85c69de6d
--- /dev/null
+++ b/apps/docs/src/components/TabbedCodeBlock/styles.module.css
@@ -0,0 +1,95 @@
+/* styles.module.css */
+:root {
+ --tab-button-bg: var(--ifm-color-emphasis-200);
+ --tab-button-hover-bg: var(--ifm-color-emphasis-300);
+ --tab-button-active-bg: var(--ifm-color-emphasis-100);
+ --tab-button-color: var(--ifm-color-emphasis-900);
+ --tab-button-hover-color: var(--ifm-color-emphasis-900);
+ --tab-button-active-color: var(--ifm-color-primary);
+}
+
+[data-theme='dark'] {
+ --tab-button-bg: var(--ifm-color-emphasis-100);
+ --tab-button-hover-bg: var(--docs-bg-subtle-pressed);
+ --tab-button-active-bg: var(--ifm-color-emphasis-200);
+ --tab-button-color: var(--ifm-color-emphasis-900);
+ --tab-button-hover-color: var(--ifm-color-emphasis-900);
+ --tab-button-active-color: var(--ifm-color-primary);
+}
+
+.tabbedCodeContainer {
+ border-radius: 8px;
+}
+
+.tabsHeader {
+ display: inline-flex;
+ background-color: var(--ifm-color-emphasis-200);
+ border-top-left-radius: 8px;
+ border-top-right-radius: 8px;
+ overflow-x: auto;
+ scrollbar-width: thin;
+}
+
+.tabButton {
+ padding: 0.75rem 1.25rem;
+ font-size: 0.9rem;
+ font-weight: 500;
+ font-family: 'Inter', sans-serif;
+ background: none;
+ border: none;
+ cursor: pointer;
+ transition: background-color 0.2s, color 0.2s;
+ color: var(--tab-button-color);
+ background-color: var(--tab-button-bg);
+ white-space: nowrap;
+}
+
+.tabButton:hover {
+ background-color: var(--tab-button-hover-bg);
+ color: var(--tab-button-hover-color);
+}
+
+.activeTab {
+ color: var(--tab-button-active-color);
+ background-color: var(--tab-button-active-bg);
+ border-bottom: 2px solid var(--ifm-color-primary);
+}
+
+.activeTab:hover {
+ color: var(--tab-button-active-color);
+ background-color: var(--tab-button-active-bg);
+ border-bottom: 2px solid var(--ifm-color-primary);
+}
+
+.codeBlockWrapper {
+ border-top-left-radius: 0;
+ border-top-right-radius: 0;
+}
+
+.loadingMessage, .errorMessage {
+ padding: 1.5rem;
+ background-color: var(--ifm-pre-background);
+ color: var(--ifm-color-emphasis-800);
+}
+
+.errorMessage {
+ color: var(--ifm-color-danger);
+}
+
+.tabbedCodeContainer :global(.code-header) {
+ @apply rounded-tl-none rounded-tr-none border-b-0;
+}
+
+.tabbedCodeContainer :global(.language-yaml) {
+ @apply rounded-tl-none rounded-tr-none border-b-0;
+}
+
+.githubLink {
+ font-size: 0.8rem;
+ color: var(--ifm-color-primary);
+ text-decoration: none;
+}
+
+.githubLink:hover {
+ text-decoration: underline;
+}
\ No newline at end of file
diff --git a/apps/docs/src/theme/Icon/Cdn/index.tsx b/apps/docs/src/theme/Icon/Cdn/index.tsx
new file mode 100644
index 000000000..55396a44e
--- /dev/null
+++ b/apps/docs/src/theme/Icon/Cdn/index.tsx
@@ -0,0 +1,22 @@
+import { IconProps } from '@medusajs/icons/dist/types';
+import clsx from 'clsx';
+import React from 'react';
+
+const IconCdn = (props: IconProps) => {
+ return (
+
+
+
+ );
+};
+
+export default IconCdn;
diff --git a/apps/docs/src/theme/Icon/CurlyBraces/index.tsx b/apps/docs/src/theme/Icon/CurlyBraces/index.tsx
new file mode 100644
index 000000000..e82c94813
--- /dev/null
+++ b/apps/docs/src/theme/Icon/CurlyBraces/index.tsx
@@ -0,0 +1,27 @@
+import { IconProps } from '@medusajs/icons/dist/types';
+import clsx from 'clsx';
+import React from 'react';
+
+const IconCurlyBraces = (props: IconProps) => {
+ return (
+
+
+
+ );
+};
+
+export default IconCurlyBraces;
diff --git a/apps/docs/src/theme/Icon/Model/index.tsx b/apps/docs/src/theme/Icon/Model/index.tsx
new file mode 100644
index 000000000..c033f3153
--- /dev/null
+++ b/apps/docs/src/theme/Icon/Model/index.tsx
@@ -0,0 +1,22 @@
+import { IconProps } from '@medusajs/icons/dist/types';
+import clsx from 'clsx';
+import React from 'react';
+
+const IconModel = (props: IconProps) => {
+ return (
+
+
+
+
+ );
+};
+
+export default IconModel;
\ No newline at end of file
diff --git a/apps/docs/src/theme/Icon/index.tsx b/apps/docs/src/theme/Icon/index.tsx
index bfb335727..dc73486fa 100644
--- a/apps/docs/src/theme/Icon/index.tsx
+++ b/apps/docs/src/theme/Icon/index.tsx
@@ -22,6 +22,7 @@ import {
CashSolid,
Channels,
ChannelsSolid,
+ ChartBar,
CheckCircleSolid,
CheckMini,
ChevronDoubleLeftMiniSolid,
@@ -41,6 +42,7 @@ import {
ComputerDesktopSolid,
CreditCardSolid,
CubeSolid,
+ CurlyBraces,
CurrencyDollar,
CurrencyDollarSolid,
Discord,
@@ -57,12 +59,14 @@ import {
GiftSolid,
GlobeEurope,
GlobeEuropeSolid,
+ InformationCircle,
InformationCircleSolid,
JavascriptEx,
Key,
KeySolid,
LightBulb,
LightBulbSolid,
+ Link,
Linkedin,
MagnifyingGlass,
Map,
@@ -91,6 +95,7 @@ import {
Sun,
Swatch,
SwatchSolid,
+ Tag,
TagSolid,
Tools,
ToolsSolid,
@@ -150,7 +155,8 @@ import IconCloudOk from './CloudOk';
import IconGitlab from './Gitlab';
import IconTypesense from './Typesense';
import IconDocker from './Docker';
-
+import IconCurlyBraces from './CurlyBraces';
+import IconCdn from './Cdn';
export default {
'academic-cap-solid': AcademicCapSolid,
@@ -177,6 +183,7 @@ export default {
'cash-solid': CashSolid,
'channels-solid': ChannelsSolid,
channels: Channels,
+ 'chart-bar': ChartBar,
'check-circle-solid': CheckCircleSolid,
'check-mini': CheckMini,
'chevron-double-left-mini-solid': ChevronDoubleLeftMiniSolid,
@@ -220,6 +227,7 @@ export default {
github: IconGitHub,
'globe-europe': GlobeEurope,
'globe-europe-solid': GlobeEuropeSolid,
+ 'information-circle': InformationCircle,
'information-circle-solid': InformationCircleSolid,
javascript: JavascriptEx,
key: Key,
@@ -227,6 +235,7 @@ export default {
'light-bulb': LightBulb,
'light-bulb-solid': LightBulbSolid,
'light-mode': Sun,
+ link: Link,
linkedin: Linkedin,
'magnifying-glass': MagnifyingGlass,
map: Map,
@@ -256,6 +265,7 @@ export default {
'star-solid': StarSolid,
stripe: Stripe,
'swatch-solid': SwatchSolid,
+ 'tag': Tag,
'tag-solid': TagSolid,
tools: Tools,
'tools-solid': ToolsSolid,
@@ -306,4 +316,6 @@ export default {
database: IconDatabase,
cloudok: IconCloudOk,
typesense: IconTypesense,
+ 'curly-braces': IconCurlyBraces,
+ cdn: IconCdn,
};
diff --git a/apps/docs/static/img/mind-maps/lightweight-dark.svg b/apps/docs/static/img/mind-maps/lightweight-dark.svg
index 98348dd9b..a832f59c6 100644
--- a/apps/docs/static/img/mind-maps/lightweight-dark.svg
+++ b/apps/docs/static/img/mind-maps/lightweight-dark.svg
@@ -1,15 +1,84 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/docs/static/img/mind-maps/lightweight.svg b/apps/docs/static/img/mind-maps/lightweight.svg
index 4a2abb9f7..067c288f9 100644
--- a/apps/docs/static/img/mind-maps/lightweight.svg
+++ b/apps/docs/static/img/mind-maps/lightweight.svg
@@ -1,15 +1,95 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/docs/static/img/mind-maps/serious-dark.svg b/apps/docs/static/img/mind-maps/serious-dark.svg
index c852825e4..6fab7c99e 100644
--- a/apps/docs/static/img/mind-maps/serious-dark.svg
+++ b/apps/docs/static/img/mind-maps/serious-dark.svg
@@ -1,54 +1,248 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/docs/static/img/mind-maps/serious.svg b/apps/docs/static/img/mind-maps/serious.svg
index 2d90e43e4..9acbdf087 100644
--- a/apps/docs/static/img/mind-maps/serious.svg
+++ b/apps/docs/static/img/mind-maps/serious.svg
@@ -1,53 +1,266 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/docs/static/img/screenshots/add_user.png b/apps/docs/static/img/screenshots/add_user.png
new file mode 100644
index 000000000..4e60670a5
Binary files /dev/null and b/apps/docs/static/img/screenshots/add_user.png differ
diff --git a/apps/docs/static/llms-full.txt b/apps/docs/static/llms-full.txt
new file mode 100644
index 000000000..4cdeac967
--- /dev/null
+++ b/apps/docs/static/llms-full.txt
@@ -0,0 +1,31717 @@
+----------------------------------------
+
+# Bun > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing Bun application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](bun/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple Bun web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Bun > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](bun/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](bun/how-to/build-pipeline#ports) `3000`, simply use `http://app:3000`
+:::info
+Do not use `https://` when communicating with Bun from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use Bun environment variables
+Zerops creates default environment variables for each Bun service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](bun/how-to/env-variables#generated-env-variables) of the Bun service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](bun/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your Bun application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access Bun application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](bun/how-to/env-variables) are available when connected through VPN. To connect to your Bun application in Zerops set the hostname and [internal port](bun/how-to/build-pipeline#ports) e.g. http://app:3000
+:::info
+Do not use `https://` when communicating with Bun over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your Bun service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your Bun service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](bun/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Bun > How To > Build Pipeline
+
+Zerops provides a customizable build and runtime environment for your Bun application.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: bun@latest
+ # OPTIONAL. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customise the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # REQUIRED. Build your application
+ buildCommands:
+ - bun i
+ - bun run build
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - dist
+ - package.json
+ - node_modules
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ cache: node_modules
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: bun@latest
+ # OPTIONAL. Sets the internal port(s) your app listens on:
+ ports:
+ # port number
+ - port: 3000
+ # OPTIONAL. Customise the runtime Bun environment by installing additional
+ # dependencies to the base Bun runtime environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Bun application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # REQUIRED. Your Bun application start command
+ start: bun start
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your Bun application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Build pipeline configuration
+### base
+_REQUIRED._ Sets the base technology for the build environment.
+Following options are available for Bun builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: bun@latest
+ ...
+```
+ The base build environment contains {data.alpine.default}, the selected
+ major version of Bun,
+ Zerops command line tool, `npm`,
+ `yarn`, `git` and `npx` tools.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base:
+ - bun@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
+To customise your build environment use the [prepareCommands](bun/how-to/build-pipeline#preparecommands) attribute.
+:::note
+Modifying the base technology will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### os
+_OPTIONAL._ Sets the operating system for the build environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+:::note
+Changing the OS setting will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache behavior.
+:::
+### prepareCommands
+_OPTIONAL._ Customises the build environment by installing additional dependencies or tools to the base build environment.
+The base build environment contains:
+- {data.alpine.default}
+- selected version of Bun defined in the [base](bun/how-to/build-pipeline#base) attribute
+- [Zerops command line tool](/references/cli)
+- `npm`, `yarn`, `git` and `npx` tools
+To install additional packages or tools add one or more prepare commands:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: bun@latest
+ # OPTIONAL. Customise the build environment by installing additional packages
+ # or tools to the base build environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first build is triggered, Zerops will
+1. create a build container
+2. download your application code from your repository
+3. run the prepare commands in the defined order
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::note
+These commands are skipped when using cached environment. Modifying `prepareCommands` will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache invalidation.
+:::
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](bun/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all prepare commands are finished, your custom build environment is ready for the build phase.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### buildCommands
+_REQUIRED._ Defines build commands.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: bun@latest
+ # REQUIRED. Build your application
+ buildCommands:
+ - bun i
+ - bun run build
+ ...
+```
+At least one command is required. Zerops triggers each command in the defined order in a dedicated build container.
+Before the build commands are triggered the build container contains:
+1. base environment defined by the [base](bun/how-to/build-pipeline#base) attribute
+2. optional customisation of the base environment defined in the [prepareCommands](bun/how-to/build-pipeline#preparecommands) attribute
+3. your application code
+#### Run build commands as a single shell instance
+Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it.
+```yaml
+buildCommands:
+ - |
+ bun i
+ bun run build
+```
+#### Run build commands as a separate shell instances
+When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command.
+```yaml
+buildCommands:
+ - bun i
+ - bun run build
+```
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](bun/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the --verbose option.
+```yaml
+buildCommands:
+ - bun i --verbose
+ - bun run build
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the deploy phase.
+### deployFiles
+_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
+```yaml
+# REQUIRED. Select which files / folders to deploy after
+# the build has successfully finished
+deployFiles:
+ - dist
+ - package.json
+ - node_modules
+```
+Determines files or folders produced by your build, which should be deployed to your runtime service containers.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Examples
+Deploys a folder, and a file from the project root directory:
+```yaml
+deployFiles:
+ - dist
+ - package.json
+```
+Deploys the whole content of the build container:
+```yaml
+deployFiles: .
+```
+Deploys a folder, and a file in a defined path:
+```yaml
+deployFiles:
+ - ./path/to/file.txt
+ - ./path/to/dir/
+```
+#### How to use a wildcard in the path
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+Deploys all folders that are located in any path that begins with `/path/to/`
+```yaml
+deployFiles: ./path/to/~/
+```
+Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/
+```
+:::note Example
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+:::
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+_OPTIONAL._ Defines which files or folders will be cached for the next build.
+```yaml
+# OPTIONAL. Which files / folders you want to cache for the next build.
+# Next builds will be faster when the cache is used.
+cache: file.txt
+```
+The cache attribute helps optimize build times by preserving specified files between builds.
+The cache attribute supports the [~ wildcard character](#how-to-use-a-wildcard-in-the-path).
+Learn more about the [build cache system](/features/build-cache) in Zerops.
+### envVariables
+_OPTIONAL._ Defines the environment variables for the build environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ base: bun@latest
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](bun/how-to/env-variables) in Zerops.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current Bun version for your runtime.
+Following options are available for Bun runtimes:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: bun@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: bun@latest
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the
+ selected major version of Bun, Zerops command line tool, `npm`, `yarn`, `git` and `npx` tools.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: bun@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base:
+ - bun@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customise your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a Bun service with hostname = "app" and port = 3000 from another service of the same project, simply use `app:3000`. Read more about [how to access a Bun service](bun/how-to/access).
+Each port has following attributes:
+| parameter | description |
+| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| port | Defines the port number. You can set any port number between _10_ and _65435_. Ports outside this interval are reserved for internal Zerops systems. |
+| protocol | **Optional.** Defines the protocol. Allowed values are `TCP` or `UDP`. Default value is `TCP`. |
+| httpSupport | **Optional.** `httpSupport = true` is the default setting for TCP protocol. Set `httpSupport = false` if a web server isn't running on the port. Zerops uses this information for the configuration of [public access](/features/access). `httpSupport = true` is available only in combination with the TCP protocol. |
+| httpSupport | **Optional.** `httpSupport = true` is the default setting for TCP protocol. Set `httpSupport = false` if a web server isn't running on the port. Zerops uses this information for the configuration of [public access](/features/access). `httpSupport = true` is available only in combination with the TCP protocol. |
+### prepareCommands
+_OPTIONAL._ Customises the Bun runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base Bun environment contains {data.alpine.default} the selected
+ major version of Bun, Zerops command line tool and `npm`, `yarn`, `git` and `npx` tools. To install
+ additional packages or tools add one or more prepare commands:
+```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 Bun runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](bun/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](bun/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the custom runtime cache go to `yyy`
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.default}, the selected major version of Bun, Zerops command line tool and `npm`,
+ `yarn`, `git` and `npx` tools.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare: ./runtime-config.yaml
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base Bun runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Bun application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your Bun application is started via the [start command](bun/how-to/build-pipeline#start).
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](bun/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](bun/how-to/build-pipeline#preparecommands1) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](bun/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](bun/how-to/env-variables) in Zerops.
+### start
+_REQUIRED._ Defines the start command for your Bun application.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Bun application start command
+ start: bun start
+```
+We recommend starting your Bun application using `bun start`.
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Bun application start command
+ start: bun start
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+| Parameter | Description |
+| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **command** | Defines a local command to be run.
+The command has access to the same [environment variables](bun/how-to/create#set-secret-environment-variables) as your Bun application.
+A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below. |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Bun application start command
+ start: bun start
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+### crontab
+_OPTIONAL._ Defines cron jobs.
+Setup cron jobs in the following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ crontab:
+ # REQUIRED. Sets the command to execute:
+ - command: ""
+ # REQUIRED. Sets the interval time to execute:
+ timing: "0 * * * *"
+```
+Read more about setting up [cron](/references/cron) in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](bun/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](bun/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+| Parameter | Description |
+| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **command** | Defines a local command to be run.
+The command has access to the same [environment variables](bun/how-to/create#set-secret-environment-variables) as your Bun application.
+A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below. |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](bun/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Bun > How To > Build Process
+
+
+## Description of the build process
+Zerops starts a temporary build container and performs following actions:
+1. Installs the build environment:
+ - Sets up base system and Go runtime
+ - Restores cached files if available (based on `build.cache` configuration)
+ - Validates cache against current `build.os`, `build.base`, and `build.prepareCommands`
+2. Downloads your application source code from [GitHub ↗](https://www.github.com), [GitLab ↗](https://www.gitlab.com) or via [Zerops CLI](/references/cli)
+3. Optionally [customizes the build environment](#customize-bun-build-environment)
+4. Runs the build commands
+5. Uploads the application artefact to the internal Zerops storage
+6. Preserves specified files for future builds (based on `build.cache` configuration)
+7. Optionally [customizes the runtime environment](/bun/how-to/customize-runtime)
+8. [Deploys your application](/bun/how-to/deploy-process)
+The build container is automatically deleted after the build has finished or failed.
+## Cancel running build
+When you know that the running build is not correct and you want to cancel it, you can do it in Zerops GUI. Go to the service detail, open the list of running processes and click on the **Open pipeline detail** button. Then click on the **Cancel build** button.
+
+:::caution
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+:::
+## Customize Bun build environment
+The default Bun build environment contains:
+- {data.alpine.default}
+- selected version of Bun defined in `zerops.yaml` [build.base](bun/how-to/build-pipeline#base) parameter
+- [zCLI](/references/cli), Zerops command line tool
+- `npm`, `yarn`, `git` and `npx` tools
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/bun/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](bun/how-to/build-pipeline#preparecommands) commands to your `zerops.yaml`.
+:::info
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::
+## Bun build hardware resources
+Build of your Bun application is run in a separate build container with following resource configuration:
+| HW resource | Minimum | Maximum |
+| ------------- | ------- | ------- |
+| **CPU cores** | 6 | 20 |
+| **RAM** | 8 GB | 8 GB |
+| **Disk** | 1 GB | 100 GB |
+| **Disk** | 1 GB | 100 GB |
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+## Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops will terminate the build pipeline and delete the build container.
+## Troubleshooting build-related problems
+### Failure of a build prepare command
+If any [prepare command](bun/how-to/build-pipeline#preparecommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](bun/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom build environment is ready for the build phase.
+### Invalidate the build cache
+If you encounter unexpected build behavior or dependency issues, the problem might be related to [cached build data](/features/build-cache). While Zerops maintains the build cache to speed up deployments, sometimes you may need to start fresh.
+To invalidate the build cache:
+1. Go to your service detail in Zerops GUI
+2. Choose **Pipelines & CI/CD Settings** from the left menu
+3. Click on the **Invalidate build cache** button
+This will force Zerops to run the next build clean, including all prepare commands, which can help resolve cache-related issues. After invalidation, your next build will also create a fresh cache.
+### Failure of a build command
+If any [build command](bun/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](bun/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `--verbose` option.
+```yaml
+buildCommands:
+ - npm i --verbose
+ - npm run build
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the [deploy](bun/how-to/deploy-process) phase.
+
+----------------------------------------
+
+# Bun > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart Bun service in Zerops GUI
+To stop the Bun service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped Bun service choose the **Start** item from the same menu.
+To restart the Bun service choose the **Restart** item from the same menu.
+## Stop and start Bun using zCLI
+zCLI is the Zerops command-line tool. To stop and start the Bun service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Bun > How To > Create
+
+Zerops provides a powerful Bun runtime service with extensive build support. The Bun runtime is highly scalable and customizable to suit your development and production needs. With just a few clicks or commands, you can have a production-ready Bun environment up and running in no time.
+## Create a Bun service using Zerops GUI
+First, set up a project in the Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu under the **Services** section. From there, you can add a new Bun service:
+### Choose a Bun version
+Zerops supports the following Bun versions:
+:::info
+You can easily [upgrade](bun/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app", "cache", "gui", etc. Duplicate services with the same name within the same project are not allowed.
+#### Limitations:
+- Maximum 25 characters
+- Must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created and cannot be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as passwords, tokens, salts, certificates, etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting secret environment variables is optional. You can always set them later in the Zerops GUI.
+Read more about the [different types of environment variables](bun/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Configure auto scaling
+Zerops automatically scales Bun services both vertically and horizontally. Vertical scaling adjusts the hardware resources (CPU, RAM, and disk) of a Bun container, while horizontal scaling adds or removes entire containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. The power your application receives depends on the other applications running on the same CPU core. In the best-case scenario, your application gets 10/10 of the CPU core power, and 1/10 in the worst-case scenario.
+**Dedicated**
+The CPU core is dedicated exclusively to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+You can choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has the following default configuration:
+Bun services always start with the minimal resources.
+In most cases, the default parameters will work without issues. If you need to limit the cost of the Bun service, you can lower the maximum resources. Zerops will never scale above the selected maximums.
+If you experience insufficient Bun performance or capacity, you can increase the minimum resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine-tune](bun/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application's needs.
+:::
+:::info
+You can change the vertical auto scaling parameters at any time.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but is already consuming the maximum resources defined for vertical auto scaling, Zerops will add a new container to your Bun service. When your Bun service doesn't need as much power and all containers are vertically scaled down such that their CPU allocation is near the minimum resources, Zerops will gradually remove entire containers.
+Horizontal auto scaling has the following default configuration:
+
+ Minimum containers
+
+ 1
+
+ Maximum containers
+
+ 6
+
+Bun services always start with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](bun/how-to/scaling) about Bun auto scaling in Zerops.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will automatically start a new container and deploy your application. However, the application will be unavailable for a short period. This mode is recommended for non-critical applications or development environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers based on your application's load. An application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed down to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents temporary outages in case any of the Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically, and the broken container will be deleted.
+:::caution
+Make sure your application is designed to run in multiple containers.
+:::
+## Create a Bun service using zCLI
+zCLI is the Zerops command-line tool. To create a new Bun service via the command line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](bun/how-to/create#create-a-project-description-file)
+3. [Create a project with a Bun and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a YAML format to describe the project infrastructure.
+#### Basic example:
+Create a directory called `my-project`. Inside the `my-project` directory, create a `description.yaml` file with the following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in Bun@{version} format
+ type: bun@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one Bun version 20 service with default [auto scaling](bun/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](bun/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Bun and PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in Bun@{version} format
+ type: bun@latest
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+ - # second service hostname
+ hostname: db
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain a Bun service and a [PostgreSQL](/postgresql/overview) service.
+Bun service with "app" hostname, the internal port(s) the service listens on will be defined later in the [zerops.yaml](bun/how-to/build-pipeline#ports). Bun service will run on version 20 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+| Parameter | Description | Limitations |
+| --------------- | ------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
+| **name** | The name of the new project. Duplicates are allowed. | |
+| **description** | **Optional.** Description of the new project. | Maximum 255 characters. |
+| **tags** | **Optional.** One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects. |
+| **tags** | **Optional.** One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects. |
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains Bun and PostgreSQL services but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [Bun service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+ All verticalAutoscaling attributes are optional. Not specified attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers
+ for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value
+ map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add Bun service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in Bun@{version} format
+ type: bun@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Bun service version 20 with default [auto scaling](bun/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Bun > How To > Customize Runtime
+
+
+The default Bun runtime environment contains:
+- {data.alpine.default}
+- selected version of Bun selected when the runtime service was created.
+-
+ `zCLI`
+
+ , Zerops command line tool
+- `npm`, `yarn`, `git` and `npx` tools
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/bun/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more `run.prepareCommands` commands to your `zerops.yaml`.
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](bun/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `run.prepareCommands` commands in the defined order
+### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](bun/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+The prepare runtime container is automatically deleted after the prepare runtime phase has finished or failed.
+### Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the `build.addToRunPrepare` and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the custom runtime cache go to `yyy`
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+
+----------------------------------------
+
+# Bun > How To > Delete
+
+## Delete Bun service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete Bun using zCLI
+zCLI is the Zerops command-line tool. To delete the Bun service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Bun > How To > Deploy Process
+
+
+## Application artefact
+When the [build phase](bun/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](bun/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](bun/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](bun/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](bun/how-to/build-pipeline#initcommands)
+4. Starts your application using the [start command](bun/how-to/build-pipeline#start)
+5. Optionally waits until the [readiness check](bun/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](bun/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customise the runtime environment](bun/how-to/build-pipeline#preparecommands-1).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The Bun process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready to handle requests right after it is started via the [start command](bun/how-to/build-pipeline#start), configure a [readiness check](bun/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your Bun service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](bun/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Bun > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+| environment | type | defined in |
+| ----------- | ------ | --------------------------------------------------------------------------------- |
+| build | basic | [zerops.yaml](bun/how-to/build-pipeline#envvariables) |
+| runtime | basic | [zerops.yaml](bun/how-to/build-pipeline#envvariables-1) |
+| runtime | secret | [Zerops GUI](bun/how-to/env-variables#set-secret-env-variables-in-zerops-gui) |
+| runtime | secret | [Zerops GUI](bun/how-to/env-variables#set-secret-env-variables-in-zerops-gui) |
+Use the [secret env variables](bun/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](bun/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](bun/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](bun/how-to/create) a new Bun service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made in the list of env variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The Bun process running in the container receives the list env variables only when it starts. Update of the env variables while the Bun process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+These restrictions apply to all [types of env variables](bun/how-to/env-variables#types-of-env-variables-in-zerops).
+## Referencing other env variables
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your Bun runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the Bun service. The Bun process running in the container receives the list env variables only when it starts. Update of the env variables while the Bun process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a Bun service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your Bun app
+Zerops passes all environment variables from all project services when your Bun app is deployed and started.
+To access the local environment variable i.e. the variable set to this Bun service in your app, use:
+```sh
+process.env.YOUR_VARIABLE_KEY_HERE
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+
+----------------------------------------
+
+# Bun > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Bun > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](bun/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](bun/how-to/build-pipeline#preparecommands-1) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the runtime containers in Zerops CLI use
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## Bun logging configuration
+Zerops logs all messages sent
+- to the standard error (`stderr`)
+- to the standard output (`stdout`)
+- via the Bun `console.log` method
+### Severity level
+By default the `console.log` creates a message with the `Informational (6)` severity.
+Add a severity number in the `` format as a prefix to set a custom severity as shown below:
+```js
+console.log('A message with the informational severity ...');
+console.log('Emergency (0) severity > system is unusable.');
+console.log('Alert (1) severity > action must be taken immediately.');
+console.log('Critical (2) severity > critical conditions.');
+console.log('Error (3) severity > error conditions.');
+console.log('Warning (4) severity > warning conditions.');
+console.log('Notice (5) severity > normal, but significant, condition.');
+console.log('Informational (6) severity > informational message.');
+console.log('Debug (7) severity > debug-level message.');
+```
+:::info
+`console.info`, `console.warn`, `console.debug`
+, and `console.error` are just aliases to the `
+ console.log
+` method. They don't set the appropriate severity number. Use the `
+ <N>
+` prefix instead. :::
+
+----------------------------------------
+
+# Bun > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the Bun service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Bun service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Bun service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Bun performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Bun service. When your Bun service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Bun service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each Bun service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the Bun service.
+### Not enough resources to scale up
+If one of the Bun containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the Bun service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor Bun resources
+Zerops provides information about how much hardware resources the Bun service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Bun > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your Bun service directly when creating a new shared storage service. Just select your Bun service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the Bun service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create Bun service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new Bun service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](bun/how-to/shared-storage#create-a-project-description-file)
+3. [Create a project with a Bun service and a shared storage](bun/how-to/shared-storage#create-a-project-with-a-bun-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](bun/how-to/create#create-a-project-description-file) how to define the Bun service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Bun and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in Bun@{version} format
+ type: bun@latest
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the Bun service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with a Bun service and a shared storage
+Follow the article [How to create a project based on the description.yaml](bun/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Bun > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](bun/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](bun/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](bun/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Bun > How To > Upgrade
+
+You can upgrade or downgrade your Bun service to a different major Bun version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](bun/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Bun version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Bun version for your runtime.
+If you want to build your application with a different major Bun version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
+
+----------------------------------------
+
+# Bun > Overview
+
+[Bun ↗](https:/bun.org/en) is an asynchronous event-driven JavaScript runtime, which is designed to build scalable network applications.
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-bun), a **_recipe_**, containing the most simple Bun web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of Bun app running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-bun/blob/main/zerops-project-import.yaml)):
+```yaml
+project:
+ name: recipe-bun
+ tags:
+ - zerops-recipe
+services:
+ - hostname: api
+ type: bun@1.1
+ enableSubdomainAccess: true
+ buildFromGit: https://github.com/zeropsio/recipe-bun
+ - hostname: db
+ type: postgresql@16
+ mode: NON_HA
+ priority: 1
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://api-806-3000.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+{"message":"This is a simple, basic Bun application running on Zerops.io,\n each request adds an entry to the PostgreSQL database and returns a count.\n See the source repository (https://github.com/zeropsio/recipe-bun) for more information.","newEntry":"dfd1e873-bfc8-4f36-af07-e32561820b93","count":"1"}
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+## How to start
+It doesn't matter whether it's your first curious introduction to Zerops, you have already mastered the basics and are looking for a tiny detail or inspiration. Below, choose a section that fits your needs:
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Company > About
+
+## Our Story
+Zerops, originally founded in 2018, began as an internal project at [vshosting.eu](https://vshosting.eu), one of the largest providers of managed hosting solutions in Central Europe. In June 2024, after a period when the project had been shut down following corporate restructuring, Zerops was re-launched as an independent startup. Now headed by the original development team and backed by strong partners, Zerops continues its mission with renewed focus and independence.
+## Technology & Infrastructure
+Zerops runs on bare metal, with the platform built from the ground up using Golang and [Incus](https://linuxcontainers.org/incus/) containerization. Our servers are currently located in Prague, Czech Republic, leveraging vshosting's state-of-the-art datacenter facilities.
+## Financial Backing & Partners
+Zerops is financially backed by established venture capital firms:
+- [Presto Ventures](https://www.prestoventures.com/) - A leading Central European venture capital firm
+- [Gi21 Capital](https://gi21capital.com/) - A technology-focused investment firm
+Our primary infrastructure partner is [vshosting.eu](https://vshosting.eu), which itself is part of [Contabo](https://contabo.com/en/), owned by global investment firm [KKR](https://www.kkr.com/). This strategic partnership provides Zerops with enterprise-grade infrastructure stability.
+## Looking Ahead
+We're committed to continually improving the Zerops platform with a focus on:
+- **Multiregional Deployment**: Beginning with built-in CDN capabilities, followed by the ability to run entire projects in different regions
+- **Enhanced Performance**: Ongoing optimization of our container orchestration and resource management
+- **Developer Experience**: Continuous improvement of our UI, CLI, and API interfaces
+## Connect With Us
+- [Discord](https://discord.com/invite/WDvCZ54)
+- [X.com](https://x.com/zeropsio)
+- [LinkedIn](https://www.linkedin.com/company/zerops)
+- [Contact Us](mailto:team@zerops.io)
+
+----------------------------------------
+
+# Company > Branding
+
+# Zerops Brand Assets
+Here you can find and download our official logos and badges in various formats. Please follow our brand guidelines when using these assets.
+## Download Assets
+Below you'll find our official assets available in various formats. Click the download buttons to get the assets in your preferred format.
+## Brand Guidelines
+When using Zerops brand assets, please:
+- Don't modify the logos or badges in any way
+- Maintain adequate spacing around the assets
+- Use the provided color versions (light/dark) as appropriate
+- Don't use the Zerops logo or badges in a way that suggests partnership or endorsement without permission
+- Don't use the assets as your own branding or as part of your logo
+
+----------------------------------------
+
+# Company > Payment
+
+Zerops provides a transparent credit-based payment system that makes managing your account finances straightforward. You can easily add funds to your account through manual or automatic top-ups, track all your transactions, and download invoices for your records.
+This page explains how to manage your account balance, set up payment preferences, and access your complete billing history to help you maintain uninterrupted service while keeping your finances organized.
+## Manual Top-up
+Manual top-ups give you direct control over your account funding. To add credits to your account immediately:
+1. Navigate to **Credit & Spend Overview** in the Organization section of the main menu
+2. Click on **Top up credit** and fill in the [billing information](#billing-information)
+3. Enter your desired top-up amount (minimum $10 VAT excl.)
+3. Complete payment using your saved or new payment method
+## Automatic Top-ups
+:::caution Beta version
+Available only for customers who have previously made a manual top-up, have a saved payment method, and have provided billing information.
+:::
+Automatic top-up ensures your projects continue running without interruption by replenishing your credits when they run low.
+### How Automatic Top-ups Work
+When enabled, Zerops monitors your credit balance and consumption rate to determine when and how much to top up, always respecting your configured limits.
+Zerops initiates an automatic payment when:
+- Your remaining credits are sufficient for **less than 10 days** of operation at your **current consumption rate**
+- You have automatic top-ups enabled
+- Your [settings](#billing-information) allow for the payment amount
+:::note Important notes
+- The charge amount is estimated based on your actual usage patterns, not maximum possible amounts
+- Negative balances are included in the next auto top-up (within your maximum charge limit)
+- The system checks your balance immediately after enabling auto top-ups, potentially triggering an immediate payment
+- Auto top-up limits don't affect manual payments — add any amount manually regardless of automatic settings
+:::
+### Configuration Options
+#### Period
+The timeframe for which the maximum configured auto-charge amount is checked. Can be set to either:
+- **Weekly**: Maximum charge amount applies to a 7-day rolling window
+- **Monthly**: Maximum charge amount applies to a 30-day rolling window
+#### Maximum Charge Amount
+The maximum amount that can be auto-charged in the given period. This serves as a safeguard against unexpected costs due to traffic spikes or other unforeseen circumstances.
+- Minimum setting: $10 (matches the minimum manual payment)
+**Scenario:** Application with $20 weekly operating costs and initial manual top-up of $100
+**Your Settings:**
+- Period = Weekly
+- Maximum charge amount = $150
+**Expected behavior:**
+- System adds approximately $20-30 when less than 10 days of credits remain (around day 35)
+- Payments continue in small increments aligned with your usage patterns
+- During traffic spikes, payments adjust to match higher consumption (up to $150 weekly limit)
+- Payment amounts return to normal when usage decreases
+## Billing Information
+You are required to enter billing details for all transactions (manual and automatic top-ups), with one exception:
+- EU-based users who are not VAT payers with transactions under $350
+You can save your billing details by navigating to **Invoices & Billing Settings** in the Organization section of the main menu.
+## Invoices
+Zerops provides easy access to all invoices generated for manual and automatic top-ups within your organization.
+To view and manage your invoices navigate to **Invoices & Billing Settings** in the Organization section of the main menu.
+## Export Credit Consumption Records
+Zerops allows you to download monthly reports of your credit consumption history for analysis and record-keeping.
+1. Navigate to **Credit & Spend Overview** in the Organization section
+2. Find the **Export Credit Consumption Records** section
+3. Click on any month button to download that period's report
+Reports are available for the past 12 months in TXT format and include:
+- Client information and reporting period
+- Starting and ending balances
+- Itemized resource charges by project and service
+- Credit transactions (top-ups, refunds, promotional credits)
+- Clear distinction between common (paid) and promotional credits
+
+----------------------------------------
+
+# Company > Pricing
+
+Zerops provides a straightforward pricing structure based on your project type and resource usage.
+The total cost of deploying an application includes your project's **core package cost** + the **cost of the resources** of the services inside a project. Additional charges may apply for optional features such as dedicated IPv4, extra egress, object storage, extra backup space and extra build time.
+:::note Fair Billing Model
+Resources are allocated per service and billed by the minute, though credit is deducted hourly based on actual usage. You're only charged for what you use, calculated down to the minute.
+:::
+Need to add credits to your account? Visit our [Top-up & Billing page](/company/payment) for instructions.
+## Project Core Plans
+Zerops offers two core types to match different needs and budgets. For detailed information on both core types, visit our [Project & Services Structure](/features/infrastructure) page.
+### Lightweight Core - Free
+Best for development, testing, and smaller workloads with limited redundancy.
+### Serious Core - $10 / 30 days
+Optimized for production workloads with high availability and comprehensive failover protection.
+## Resource Pricing
+Services in Zerops require computing resources that are billed separately from your project core. These resources are allocated per service and billed by the minute based on actual usage, with credits deducted hourly.
+
+ Resource
+ Price
+ Description
+
+ Shared CPU
+ $0.60 per CPU / 30 days
+ Economical option for most workloads with good performance
+
+ Dedicated CPU
+ $6.00 per CPU / 30 days
+ Reserved CPU cores for predictable performance
+
+ RAM
+ $0.75 per 0.25 GB / 30 days
+ Memory allocated to your services
+
+ Disk Space
+ $0.05 per 0.5 GB / 30 days
+ Storage space for your applications and data
+
+## Additional Services
+Enhance your deployment with these optional services to meet specific requirements for networking, storage, and data transfer.
+
+ Service
+ Price
+ Description
+
+ Dedicated IPv4
+ $3.00 per 30 days
+ Exclusive IPv4 address for your project (instead of shared)
+
+ Object Storage
+ $0.01 per GB / 30 days
+ Scalable storage for files, backups, and static assets
+
+## Overage Costs
+When you exceed the resources included in your project core plan, the following charges apply:
+
+ Item
+ Price
+ Description
+
+ Extra Egress
+ $0.02 per GB
+ Data transfer out of your project beyond plan limits
+
+ Extra Backup Space
+ $0.50 per 5 GB
+ Additional storage for automatic, encrypted backups
+
+ Extra Build Time
+ $0.50 per 15 hours
+ Additional time for building and deploying applications
+
+## Pricing Calculator
+Use our pricing calculator to estimate your monthly costs based on your specific needs:
+
+----------------------------------------
+
+# Deno > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing Deno application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](/deno/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple Deno web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Deno > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](/deno/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](/deno/how-to/build-pipeline#ports) `3000`, simply use `http://app:3000`
+:::info
+Do not use `https://` when communicating with Deno from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use Deno environment variables
+Zerops creates default environment variables for each Deno service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](/deno/how-to/env-variables#generated-env-variables) of the Deno service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](/deno/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your Deno application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access Deno application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/deno/how-to/env-variables) are available when connected through VPN. To connect to your Deno application in Zerops set the hostname and [internal port](/deno/how-to/build-pipeline#ports) e.g. http://app:3000
+:::info
+Do not use `https://` when communicating with Deno over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your Deno service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your Deno service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/deno/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Deno > How To > Build Pipeline
+
+Zerops provides a customizable build and runtime environment for your Deno application.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define 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. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customise the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # REQUIRED. Build your application
+ buildCommands:
+ - deno task build
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - dist
+ - deno.jsonc
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ # cache: directory
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: deno@latest
+ # OPTIONAL. Sets the internal port(s) your app listens on:
+ ports:
+ # port number
+ - port: 3000
+ # OPTIONAL. Customise the runtime Deno environment by installing additional
+ # dependencies to the base Deno runtime environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Deno application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # REQUIRED. Your Deno application start command
+ start: deno task start
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your Deno application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Build pipeline configuration
+### base
+_REQUIRED._ Sets the base technology for the build environment.
+Following options are available for Deno builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: deno@latest
+ ...
+```
+ The base build environment contains {data.alpine.default}, the selected
+ major version of Deno, Zerops command line tool, `npm`, `yarn`, `git` and `npx` tools.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base:
+ - deno@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
+To customise your build environment use the [prepareCommands](/deno/how-to/build-pipeline#preparecommands) attribute.
+:::note
+Modifying the base technology will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### os
+_OPTIONAL._ Sets the operating system for the build environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+:::note
+Changing the OS setting will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache behavior.
+:::
+### prepareCommands
+_OPTIONAL._ Customises the build environment by installing additional dependencies or tools to the base build environment.
+The base build environment contains:
+- {data.alpine.default}
+- selected version of Deno defined in the [base](/deno/how-to/build-pipeline#base) attribute
+- [Zerops command line tool](/references/cli)
+- `npm`, `yarn`, `git` and `npx` tools
+To install additional packages or tools add one or more prepare commands:
+```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:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first build is triggered, Zerops will
+1. create a build container
+2. download your application code from your repository
+3. run the prepare commands in the defined order
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::note
+These commands are skipped when using cached environment. Modifying `prepareCommands` will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache invalidation.
+:::
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/deno/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all prepare commands are finished, your custom build environment is ready for the build phase.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### buildCommands
+_REQUIRED._ Defines build commands.
+```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
+ # REQUIRED. Build your application
+ buildCommands:
+ - deno task build
+ ...
+```
+At least one command is required. Zerops triggers each command in the defined order in a dedicated build container.
+Before the build commands are triggered the build container contains:
+1. base environment defined by the [base](/deno/how-to/build-pipeline#base) attribute
+2. optional customisation of the base environment defined in the [prepareCommands](/deno/how-to/build-pipeline#preparecommands) attribute
+3. your application code
+#### Run build commands as a single shell instance
+Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it.
+```yaml
+buildCommands:
+ - |
+ deno test
+ deno task build
+```
+#### Run build commands as a separate shell instances
+When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command.
+```yaml
+buildCommands:
+ - deno task build
+```
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/deno/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the --verbose option.
+```yaml
+buildCommands:
+ - npm i --verbose
+ - npm run build
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the deploy phase.
+### deployFiles
+_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
+```yaml
+# REQUIRED. Select which files / folders to deploy after
+# the build has successfully finished
+deployFiles:
+ - dist
+ - package.json
+ - node_modules
+```
+Determines files or folders produced by your build, which should be deployed to your runtime service containers.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Examples
+Deploys a folder, and a file from the project root directory:
+```yaml
+deployFiles:
+ - dist
+ - package.json
+```
+Deploys the whole content of the build container:
+```yaml
+deployFiles: .
+```
+Deploys a folder, and a file in a defined path:
+```yaml
+deployFiles:
+ - ./path/to/file.txt
+ - ./path/to/dir/
+```
+#### How to use a wildcard in the path
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+Deploys all folders that are located in any path that begins with `/path/to/`
+```yaml
+deployFiles: ./path/to/~/
+```
+Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/
+```
+:::note Example
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+:::
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+_OPTIONAL._ Defines which files or folders will be cached for the next build.
+```yaml
+# OPTIONAL. Which files / folders you want to cache for the next build.
+# Next builds will be faster when the cache is used.
+cache: file.txt
+```
+The cache attribute helps optimize build times by preserving specified files between builds.
+The cache attribute supports the [~ wildcard character](#how-to-use-a-wildcard-in-the-path).
+Learn more about the [build cache system](/features/build-cache) in Zerops.
+### envVariables
+_OPTIONAL._ Defines the environment variables for the build environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ base: deno@latest
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/deno/how-to/env-variables) in Zerops.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current Deno version for your runtime.
+Following options are available for Deno builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: deno@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: deno@latest
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the
+ selected major version of Deno, Zerops command line tool, `npm`, `yarn`, `git` and `npx` tools.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: deno@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base:
+ - deno@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customise your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a Deno service with hostname = "app" and port = 3000 from another service of the same project, simply use `app:3000`. Read more about [how to access a Deno service](/deno/how-to/access).
+Each port has following attributes:
+| parameter | description |
+| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| port | Defines the port number. You can set any port number between _10_ and _65435_. Ports outside this interval are reserved for internal Zerops systems. |
+| protocol | **Optional.** Defines the protocol. Allowed values are `TCP` or `UDP`. Default value is `TCP`. |
+| httpSupport | **Optional.** `httpSupport = true` is the default setting for TCP protocol. Set `httpSupport = false` if a web server isn't running on the port. Zerops uses this information for the configuration of [public access](/features/access). `httpSupport = true` is available only in combination with the TCP protocol. |
+| httpSupport | **Optional.** `httpSupport = true` is the default setting for TCP protocol. Set `httpSupport = false` if a web server isn't running on the port. Zerops uses this information for the configuration of [public access](/features/access). `httpSupport = true` is available only in combination with the TCP protocol. |
+### prepareCommands
+_OPTIONAL._ Customises the Deno runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base Deno environment contains {data.alpine.default} the selected
+ major version of Deno, Zerops command line tool and `npm`, `yarn`, `git` and `npx` tools. To install
+ additional packages or tools add one or more prepare commands:
+```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 Deno runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/deno/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/deno/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the custom runtime cache go to `yyy`
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.default}, the
+ selected major version of Deno, Zerops command line tool and `npm`, `yarn`, `git` and `npx` tools.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare: ./runtime-config.yaml
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base Deno runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Deno application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your Deno application is started via the [start command](/deno/how-to/build-pipeline#start).
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](/deno/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](/deno/how-to/build-pipeline#preparecommands-1) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](/deno/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/deno/how-to/env-variables) in Zerops.
+### start
+_REQUIRED._ Defines the start command for your Deno application.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Deno application start command
+ start: deno task start
+```
+We recommend starting your Deno application using `deno task start`.
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Deno application start command
+ start: deno task start
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+| Parameter | Description |
+| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **command** | Defines a local command to be run.
+The command has access to the same [environment variables](/deno/how-to/create#set-secret-environment-variables) as your Deno application.
+A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below. |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Deno application start command
+ start: deno task start
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+### crontab
+_OPTIONAL._ Defines cron jobs.
+Setup cron jobs in the following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ crontab:
+ # REQUIRED. Sets the command to execute:
+ - command: ""
+ # REQUIRED. Sets the interval time to execute:
+ timing: "0 * * * *"
+```
+Read more about setting up [cron](/references/cron) in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](/deno/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](/deno/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+| Parameter | Description |
+| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **command** | Defines a local command to be run.
+The command has access to the same [environment variables](/deno/how-to/create#set-secret-environment-variables) as your Deno application.
+A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below. |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](/deno/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Deno > How To > Build Process
+
+
+## Description of the build process
+Zerops starts a temporary build container and performs following actions:
+1. Installs the build environment:
+ - Sets up base system and Go runtime
+ - Restores cached files if available (based on `build.cache` configuration)
+ - Validates cache against current `build.os`, `build.base`, and `build.prepareCommands`
+2. Downloads your application source code from [GitHub ↗](https://www.github.com), [GitLab ↗](https://www.gitlab.com) or via [Zerops CLI](/references/cli)
+3. Optionally [customizes the build environment](#customize-deno-build-environment)
+4. Runs the build commands
+5. Uploads the application artefact to the internal Zerops storage
+6. Preserves specified files for future builds (based on `build.cache` configuration)
+7. Optionally [customizes the runtime environment](/deno/how-to/customize-runtime)
+8. [Deploys your application](/deno/how-to/deploy-process)
+The build container is automatically deleted after the build has finished or failed.
+## Cancel running build
+When you know that the running build is not correct and you want to cancel it, you can do it in Zerops GUI. Go to the service detail, open the list of running processes and click on the **Open pipeline detail** button. Then click on the **Cancel build** button.
+
+:::caution
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+:::
+## Customize Deno build environment
+The default Deno build environment contains:
+- {data.alpine.default}
+- selected version of Deno defined in `zerops.yaml` [build.base](/deno/how-to/build-pipeline#base) parameter
+- [zCLI](/references/cli), Zerops command line tool
+- `npm`, `yarn`, `git` and `npx` tools
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/deno/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](/deno/how-to/build-pipeline#preparecommands) commands to your `zerops.yaml`.
+:::info
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::
+## Deno build hardware resources
+Build of your Deno application is run in a separate build container with following resource configuration:
+| HW resource | Minimum | Maximum |
+| ------------- | ------- | ------- |
+| **CPU cores** | 6 | 20 |
+| **RAM** | 8 GB | 8 GB |
+| **Disk** | 1 GB | 100 GB |
+| **Disk** | 1 GB | 100 GB |
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+## Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops will terminate the build pipeline and delete the build container.
+## Troubleshooting build-related problems
+### Failure of a build prepare command
+If any [prepare command](/deno/how-to/build-pipeline#preparecommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/deno/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom build environment is ready for the build phase.
+### Invalidate the build cache
+If you encounter unexpected build behavior or dependency issues, the problem might be related to [cached build data](/features/build-cache). While Zerops maintains the build cache to speed up deployments, sometimes you may need to start fresh.
+To invalidate the build cache:
+1. Go to your service detail in Zerops GUI
+2. Choose **Pipelines & CI/CD Settings** from the left menu
+3. Click on the **Invalidate build cache** button
+This will force Zerops to run the next build clean, including all prepare commands, which can help resolve cache-related issues. After invalidation, your next build will also create a fresh cache.
+### Failure of a build command
+If any [build command](/deno/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/deno/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `--verbose` option.
+```yaml
+buildCommands:
+ - npm i --verbose
+ - npm run build
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the [deploy](/deno/how-to/deploy-process) phase.
+
+----------------------------------------
+
+# Deno > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart Deno service in Zerops GUI
+To stop the Deno service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped Deno service choose the **Start** item from the same menu.
+To restart the Deno service choose the **Restart** item from the same menu.
+## Stop and start Deno using zCLI
+zCLI is the Zerops command-line tool. To stop and start the Deno service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Deno > How To > Create
+
+Zerops provides a powerful Deno runtime service with extensive build support. The Deno runtime is highly scalable and customizable to suit your development and production needs. With just a few clicks or commands, you can have a production-ready Deno environment up and running in no time.
+## Create a Deno service using Zerops GUI
+First, set up a project in the Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu under the **Services** section. From there, you can add a new Deno service:
+### Choose a Deno version
+Zerops supports the following Deno versions:
+:::info
+You can easily [upgrade](/deno/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app", "cache", "gui", etc. Duplicate services with the same name within the same project are not allowed.
+#### Limitations:
+- Maximum 25 characters
+- Must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created and cannot be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as passwords, tokens, salts, certificates, etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting secret environment variables is optional. You can always set them later in the Zerops GUI.
+Read more about the [different types of environment variables](/deno/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Configure auto scaling
+Zerops automatically scales Deno services both vertically and horizontally. Vertical scaling adjusts the hardware resources (CPU, RAM, and disk) of a Deno container, while horizontal scaling adds or removes entire containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. The power your application receives depends on the other applications running on the same CPU core. In the best-case scenario, your application gets 10/10 of the CPU core power, and 1/10 in the worst-case scenario.
+**Dedicated**
+The CPU core is dedicated exclusively to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+You can choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has the following default configuration:
+Deno services always start with the minimal resources.
+In most cases, the default parameters will work without issues. If you need to limit the cost of the Deno service, you can lower the maximum resources. Zerops will never scale above the selected maximums.
+If you experience insufficient Deno performance or capacity, you can increase the minimum resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine-tune](/deno/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application's needs.
+:::
+:::info
+You can change the vertical auto scaling parameters at any time.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but is already consuming the maximum resources defined for vertical auto scaling, Zerops will add a new container to your Deno service. When your Deno service doesn't need as much power and all containers are vertically scaled down such that their CPU allocation is near the minimum resources, Zerops will gradually remove entire containers.
+Horizontal auto scaling has the following default configuration:
+
+ Minimum containers
+
+ 1
+
+ Maximum containers
+
+ 6
+
+Deno services always start with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](/deno/how-to/scaling) about Deno auto scaling in Zerops.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will automatically start a new container and deploy your application. However, the application will be unavailable for a short period. This mode is recommended for non-critical applications or development environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers based on your application's load. An application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed down to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents temporary outages in case any of the Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically, and the broken container will be deleted.
+:::caution
+Make sure your application is designed to run in multiple containers.
+:::
+## Create a Deno service using zCLI
+zCLI is the Zerops command-line tool. To create a new Deno service via the command line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/deno/how-to/create#create-a-project-description-file)
+3. [Create a project with a Deno and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a YAML format to describe the project infrastructure.
+#### Basic example:
+Create a directory called `my-project`. Inside the `my-project` directory, create a `description.yaml` file with the following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in deno@{version} format
+ type: deno@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one Deno version 20 service with default [auto scaling](/deno/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/deno/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Deno and PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in deno@{version} format
+ type: deno@latest
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+ - # second service hostname
+ hostname: db
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain a Deno service and a [PostgreSQL](/postgresql/overview) service.
+Deno service with "app" hostname, the internal port(s) the service listens on will be defined later in the [zerops.yaml](/deno/how-to/build-pipeline#ports). Deno service will run on version 20 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+| Parameter | Description | Limitations |
+| --------------- | ------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
+| **name** | The name of the new project. Duplicates are allowed. | |
+| **description** | **Optional.** Description of the new project. | Maximum 255 characters. |
+| **tags** | **Optional.** One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects. |
+| **tags** | **Optional.** One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects. |
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains Deno and PostgreSQL services but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [Deno service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+ All verticalAutoscaling attributes are optional. Not specified
+ attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers
+ for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value
+ map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add Deno service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in deno@{version} format
+ type: deno@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Deno service version 20 with default [auto scaling](/deno/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Deno > How To > Customize Runtime
+
+
+The default Deno runtime environment contains:
+- {data.alpine.default}
+- selected version of Deno selected when the runtime service was created.
+-
+ `zCLI`
+
+ , Zerops command line tool
+- `npm`, `yarn`, `git` and `npx` tools
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/deno/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more `run.prepareCommands` commands to your `zerops.yaml`.
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/deno/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `run.prepareCommands` commands in the defined order
+### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/deno/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+The prepare runtime container is automatically deleted after the prepare runtime phase has finished or failed.
+### Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the `build.addToRunPrepare` and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the custom runtime cache go to `yyy`
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+
+----------------------------------------
+
+# Deno > How To > Delete
+
+## Delete Deno service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete Deno using zCLI
+zCLI is the Zerops command-line tool. To delete the Deno service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Deno > How To > Deploy Process
+
+
+## Application artefact
+When the [build phase](/deno/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](/deno/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/deno/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/deno/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/deno/how-to/build-pipeline#initcommands)
+4. Starts your application using the [start command](/deno/how-to/build-pipeline#start)
+5. Optionally waits until the [readiness check](/deno/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/deno/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customise the runtime environment](/deno/how-to/build-pipeline#preparecommands-1).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The Deno process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready to handle requests right after it is started via the [start command](/deno/how-to/build-pipeline#start), configure a [readiness check](/deno/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your Deno service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/deno/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Deno > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+| environment | type | defined in |
+| ----------- | ------ | --------------------------------------------------------------------------------- |
+| build | basic | [zerops.yaml](/deno/how-to/build-pipeline#envvariables) |
+| runtime | basic | [zerops.yaml](/deno/how-to/build-pipeline#envvariables-1) |
+| runtime | secret | [Zerops GUI](#set-secret-env-variables-in-zerops-gui) |
+| runtime | secret | [Zerops GUI](#set-secret-env-variables-in-zerops-gui) |
+Use the [secret env variables](/deno/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](/deno/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/deno/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](/deno/how-to/create) a new Deno service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made to environment variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The Deno process running in the container receives the list env variables only when it starts. Update of the env variables while the Deno process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+These restrictions apply to all [types of env variables](/deno/how-to/env-variables#types-of-env-variables-in-zerops).
+## Referencing other env variables
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your Deno runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the Deno service. The Deno process running in the container receives the list env variables only when it starts. Update of the env variables while the Deno process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a Deno service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your Deno app
+Zerops passes all environment variables from all project services when your Deno app is deployed and started.
+To access the local environment variable i.e. the variable set to this Deno service in your app, use:
+```sh
+process.env.YOUR_VARIABLE_KEY_HERE
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+
+----------------------------------------
+
+# Deno > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Deno > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](/deno/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](/deno/how-to/build-pipeline#preparecommands-1) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the runtime containers in Zerops CLI use
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## Deno logging configuration
+Zerops logs all messages sent
+- to the standard error (`stderr`)
+- to the standard output (`stdout`)
+- via the Deno `console.log` method
+### Severity level
+By default the `console.log` creates a message with the `Informational (6)` severity.
+Add a severity number in the `` format as a prefix to set a custom severity as shown below:
+```js
+console.log('A message with the informational severity ...');
+console.log('Emergency (0) severity > system is unusable.');
+console.log('Alert (1) severity > action must be taken immediately.');
+console.log('Critical (2) severity > critical conditions.');
+console.log('Error (3) severity > error conditions.');
+console.log('Warning (4) severity > warning conditions.');
+console.log('Notice (5) severity > normal, but significant, condition.');
+console.log('Informational (6) severity > informational message.');
+console.log('Debug (7) severity > debug-level message.');
+```
+:::info
+`console.info`, `console.warn`, `console.debug`
+, and `console.error` are just aliases to the `
+ console.log
+` method. They don't set the appropriate severity number. Use the `
+ <N>
+` prefix instead. :::
+
+----------------------------------------
+
+# Deno > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the Deno service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Deno service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Deno service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Deno performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Deno service. When your Deno service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Deno service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each Deno service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the Deno service.
+### Not enough resources to scale up
+If one of the Deno containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the Deno service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor Deno resources
+Zerops provides information about how much hardware resources the Deno service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Deno > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your Deno service directly when creating a new shared storage service. Just select your Deno service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the Deno service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create Deno service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new Deno service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/deno/how-to/shared-storage#create-a-project-description-file)
+3. [Create a project with a Deno service and a shared storage](/deno/how-to/shared-storage#create-a-project-with-a-deno-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](/deno/how-to/create#create-a-project-description-file) how to define the Deno service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Deno and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in deno@{version} format
+ type: deno@latest
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the Deno service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with a Deno service and a shared storage
+Follow the article [How to create a project based on the description.yaml](/deno/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Deno > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](/deno/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](/deno/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](/deno/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Deno > How To > Upgrade
+
+You can upgrade or downgrade your Deno service to a different major Deno version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/deno/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Deno version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Deno version for your runtime.
+If you want to build your application with a different major Deno version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
+
+----------------------------------------
+
+# Deno > Overview
+
+[Deno ↗](https://deno.org/en) is an asynchronous event-driven JavaScript runtime, which is designed to build scalable network applications.
+:::tip
+Have you got any additional question? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-deno), a **_recipe_**, containing the most simple Deno web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of Deno app running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-deno/blob/main/zerops-project-import.yaml)):
+```yaml
+project:
+ name: recipe-deno
+ tags:
+ - zerops-recipe
+services:
+ - hostname: api
+ type: deno@1
+ buildFromGit: https://github.com/zeropsio/recipe-deno
+ enableSubdomainAccess: true
+ - hostname: db
+ type: postgresql@16
+ mode: NON_HA
+ priority: 1
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://api-7f6-8000.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+{"message":"This is a simple, basic Deno / Oak application running on Zerops.io,\n each request adds an entry to the PostgreSQL database and returns a count.\n See the source repository (https://github.com/zeropsio/recipe-deno) for more information.","newEntry":"274b0cc1-5b6d-4351-b8ec-53cf82bd9d0f","count":1}
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+## How to start
+It doesn't matter whether it's your first curious introduction to Zerops, you have already mastered the basics and are looking for a tiny detail or inspiration. Below, choose a section that fits your needs:
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Docker > Overview
+
+Zerops provides Docker support through dedicated Virtual Machine (VM) environments, ensuring maximum compatibility and isolation while maintaining integration with the broader Zerops ecosystem. This guide explains how to effectively use Docker services on Zerops, including best practices and important considerations.
+## Why VMs
+While Zerops primarily uses native Linux containers for optimal performance, this VM-based approach allows you to run virtually any Docker container while maintaining Zerops' robust infrastructure management.
+You can learn more about [differences](/features/container-vs-vm) between Containers and Virtual Machines on Zerops.
+Before using Docker services, consider these important aspects:
+### Virtual Machine Environment
+Docker services on Zerops operate in a full VM environment, which has several implications:
+- **Slower Boot Times**: VMs require more time to initialize due to full kernel boot
+- **Higher Resource Usage**: VMs include additional system overhead compared to native containers
+- **Scaling Limitations**:
+ - Vertical scaling requires VM restart
+ - Resources must be set as fixed values (no min-max ranges)
+ - Zerops automatically restarts the VM when resource values are changed in UI
+- **Storage Management**: Disk space can only be increased, not decreased without recreation
+- **Build Phase Limitations**: Build phase runs in containers, not in the VM environment
+### Advantages
+Despite these limitations, Docker services offer some benefits:
+- **Broad Compatibility**: Run almost any Docker container with minimal modification
+- **Familiar Environment**: Standard Docker runtime environment
+## Configuration Guide
+### Supported Version
+Currently supported Docker versions:
+### Basic Structure
+Docker services in Zerops are configured through the `zerops.yaml` file. Here's a typical configuration pattern:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ run:
+ prepareCommands:
+ - docker image pull
+ start: docker run --network=host
+ ports:
+ - port:
+ httpSupport: true
+```
+Refer to the [Docker recipe repository](https://github.com/zeropsio/recipe-docker) for an example configuration.
+:::note
+We are actively working on improving the speed of image caching after `run.prepareCommands` and reducing the startup time of runtime VMs. These improvements will be released in future updates.
+:::
+### Network Configuration
+Docker services require the `--network=host` flag for proper integration with Zerops:
+- **Direct Port Management**: Ports are managed through `zerops.yaml`
+- **Simplified Configuration**: Avoids double port exposure in Docker and Zerops
+- **Native Performance**: Direct access to host networking
+### Docker Compose Support
+For projects using Docker Compose, additional configuration is required:
+1. **File Deployment**:
+ ```yaml title="zerops.yaml"
+ build:
+ deployFiles: ./docker-compose.yaml
+ addToRunPrepare: ./docker-compose.yaml
+ ```
+2. **Network Mode**:
+ ```yaml title="docker-compose.yaml"
+ services:
+ your-service:
+ network_mode: host
+ ```
+3. **Start Command**:
+ ```yaml title="zerops.yaml"
+ run:
+ start: docker compose up --force-recreate
+ ```
+### Environment Variables
+When using Docker services, there's an additional layer to consider since environment variables defined in Zerops must be explicitly passed to your Docker containers.
+#### 1. Defining Variables in Zerops
+Define your environment variables in the `run.envVariables` section of your `zerops.yaml` (example uses [referenced](/features/env-variables#referencing-variables) variables):
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ run:
+ envVariables:
+ DB_HOST: ${db_hostname}
+ DB_PORT: ${db_port}
+```
+#### 2. Passing Variables to Docker Containers
+For single containers, pass variables using the `-e` flag:
+```yaml title="zerops.yaml"
+run:
+ prepareCommands:
+ - docker image pull my-application:latest
+ start: docker run -e DB_HOST -e DB_PORT --network=host my-application:latest
+```
+For Docker Compose setups, pass environment variables in your `docker-compose.yaml`:
+```yaml title="docker-compose.yaml"
+services:
+ api:
+ image: my-application:latest
+ network_mode: host
+ environment:
+ - DB_HOST
+ - DB_PORT
+```
+## Implementation Examples
+### Single Container
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ run:
+ prepareCommands:
+ - docker image pull crccheck/hello-world
+ start: docker run --network=host crccheck/hello-world
+ ports:
+ - port: 8000
+ httpSupport: true
+```
+### Single Service with Docker Compose
+```yaml title="zerops.yaml"
+zerops:
+ - setup: api
+ build:
+ deployFiles: ./docker-compose.yaml
+ addToRunPrepare: ./docker-compose.yaml
+ run:
+ prepareCommands:
+ - docker compose pull api
+ start: docker compose up api --force-recreate
+ ports:
+ - port: 8000
+ httpSupport: true
+```
+### Multiple Services with Docker Compose
+```yaml title="zerops.yaml"
+zerops:
+ - setup: apps
+ build:
+ deployFiles: ./docker-compose.yaml
+ addToRunPrepare: ./docker-compose.yaml
+ run:
+ prepareCommands:
+ - docker compose pull
+ start: docker compose up --force-recreate
+ ports:
+ - port: 8000
+ httpSupport: true
+```
+## Best Practices
+#### Image Management
+- Use `prepareCommands` for image pulling
+- Consider using specific image tags instead of `latest`
+#### Resource Planning
+- Account for VM overhead in resource allocation
+- Plan for longer initialization times
+- Consider the impact on scaling operations
+#### Migration Consideration
+- Evaluate if your workload could run on native containers
+- Consider gradual migration for complex applications
+- Balance development effort against operational benefits
+## Limitations and Workarounds
+### Build Phase
+Since the build phase runs in containers rather than VMs:
+- Use `run.prepareCommands` for Docker-specific build steps
+- Consider external CI/CD for complex Docker builds
+- Leverage pre-built images when possible
+### Scaling Operations
+Docker services on Zerops have specific scaling characteristics that differ from native containers:
+#### Vertical Scaling
+- Resources must be defined with **fixed** values instead of min-max ranges
+- CPU, RAM, and disk are specified as single values:
+ ```yaml
+ verticalAutoscaling:
+ cpu: 3
+ ram: 2
+ disk: 20
+ ```
+- Any change to these values through the UI triggers an automatic VM restart
+- Plan your resource allocation carefully to minimize scaling operations
+#### Horizontal Scaling
+- Still supports multiple containers through `minContainers` and `maxContainers`
+- Consider breaking large services into smaller components
+- Implement proper health checks for reliable scaling
+- Use horizontal scaling when possible to avoid VM restarts
+
+----------------------------------------
+
+# Dotnet > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing .NET application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](/dotnet/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple .NET web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Dotnet > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](/dotnet/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](/dotnet/how-to/build-pipeline#ports) `5000`, simply use `http://app:5000`
+:::info
+Do not use `https://` when communicating with .NET from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use .NET environment variables
+Zerops creates default environment variables for each .NET service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](/dotnet/how-to/env-variables#generated-env-variables) of the .NET service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](/dotnet/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your .NET application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access .NET application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/dotnet/how-to/env-variables) are available when connected through VPN. To connect to your .NET application in Zerops set the hostname and [internal port](/dotnet/how-to/build-pipeline#ports) e.g. http://app:5000
+:::info
+Do not use `https://` when communicating with .NET over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your .NET service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your .NET service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/dotnet/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Dotnet > How To > Build Pipeline
+
+Zerops provides a customizable build and runtime environment for your .NET application.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: dotnet@6
+ # OPTIONAL. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # REQUIRED. Build your application
+ buildCommands:
+ - npm i
+ - npm run build
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - dist
+ - package.json
+ - node_modules
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ cache: node_modules
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: dotnet@latest
+ # OPTIONAL. Sets the internal port(s) your app listens on:
+ ports:
+ # port number
+ - port: 5000
+ # OPTIONAL. Customize the runtime .NET environment by installing additional
+ # dependencies to the base .NET runtime environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your .NET application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # REQUIRED. Your .NET application start command
+ start: npm start
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your .NET application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Build pipeline configuration
+### base
+_REQUIRED._ Sets the base technology for the build environment.
+Following options are available for .NET builds:
+```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
+ ...
+```
+ The base build environment contains {data.alpine.default}, the selected
+ major version of .NET, Zerops command line tool, `ASP .NET` and `git`.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
+```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
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
+To customize your build environment use the [prepareCommands](/dotnet/how-to/build-pipeline#preparecommands) attribute.
+:::note
+Modifying the base technology will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### os
+_OPTIONAL._ Sets the operating system for the build environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customized.
+:::
+:::note
+Changing the OS setting will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache behavior.
+:::
+### prepareCommands
+_OPTIONAL._ Customizes the build environment by installing additional dependencies or tools to the base build environment.
+The base build environment contains:
+- {data.alpine.default}
+- selected version of .NET defined in the [base](/dotnet/how-to/build-pipeline#base) attribute
+- [Zerops command line tool](/references/cli)
+- `ASP .NET` and `git`
+To install additional packages or tools add one or more prepare commands:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: dotnet@6
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first build is triggered, Zerops will
+1. create a build container
+2. download your application code from your repository
+3. run the prepare commands in the defined order
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::note
+These commands are skipped when using cached environment. Modifying `prepareCommands` will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache invalidation.
+:::
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/dotnet/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all prepare commands are finished, your custom build environment is ready for the build phase.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### buildCommands
+_REQUIRED._ Defines build commands.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: dotnet@6
+ # REQUIRED. Build your application
+ buildCommands:
+ - dotnet build -o app
+ ...
+```
+At least one command is required. Zerops triggers each command in the defined order in a dedicated build container.
+Before the build commands are triggered the build container contains:
+1. base environment defined by the [base](/dotnet/how-to/build-pipeline#base) attribute
+2. optional customisation of the base environment defined in the [prepareCommands](/dotnet/how-to/build-pipeline#preparecommands) attribute
+3. your application code
+#### Run build commands as a single shell instance
+Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it.
+```yaml
+buildCommands:
+ - |
+ apt-get -y install dotnet-runtime-6.0 aspnetcore-runtime-6.0 dotnet-sdk-6.0 # already installed for .NET service
+ dotnet build -o app
+```
+#### Run build commands as a separate shell instances
+When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command.
+```yaml
+buildCommands:
+ - apt-get -y install dotnet-runtime-6.0 aspnetcore-runtime-6.0 dotnet-sdk-6.0 # already installed for .NET service
+ - dotnet build -o app
+```
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/dotnet/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `--verbosity ` option.
+```yaml
+buildCommands:
+ - dotnet build --verbosity detailed
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the deploy phase.
+### deployFiles
+_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
+```yaml
+# REQUIRED. Select which files / folders to deploy after
+# the build has successfully finished
+deployFiles:
+ - app
+```
+Determines files or folders produced by your build, which should be deployed to your runtime service containers.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Examples
+Deploys a folder, and a file from the project root directory:
+```yaml
+deployFiles:
+ - app
+ - file.txt
+```
+Deploys the whole content of the build container:
+```yaml
+deployFiles: .
+```
+Deploys a folder, and a file in a defined path:
+```yaml
+deployFiles:
+ - ./path/to/file.txt
+ - ./path/to/dir/
+```
+#### How to use a wildcard in the path
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+Deploys all folders that are located in any path that begins with `/path/to/`
+```yaml
+deployFiles: ./path/to/~/
+```
+Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/
+```
+:::note Example
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+:::
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+_OPTIONAL._ Defines which files or folders will be cached for the next build.
+```yaml
+# OPTIONAL. Which files / folders you want to cache for the next build.
+# Next builds will be faster when the cache is used.
+cache: file.txt
+```
+The cache attribute helps optimize build times by preserving specified files between builds.
+The cache attribute supports the [~ wildcard character](#how-to-use-a-wildcard-in-the-path).
+Learn more about the [build cache system](/features/build-cache) in Zerops.
+### envVariables
+_OPTIONAL._ Defines the environment variables for the build environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ base: dotnet@6
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ DOTNET_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/dotnet/how-to/env-variables) in Zerops.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current .NET version for your runtime.
+Following options are available for .NET builds:
+```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
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the
+ selected major version of .NET, Zerops command line tool and `ASP .NET` and `git`.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```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
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customise your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a .NET service with hostname = "app" and port = 5000 from another service of the same project, simply use `app:5000`. Read more about [how to access a .NET service](/dotnet/how-to/access).
+Each port has following attributes:
+
+ Parameter
+ Description
+
+ port
+ Defines the port number. You can set any port number between 10 and 65435. Ports outside this interval are reserved for internal Zerops systems.
+
+ protocol
+ Optional. Defines the protocol. Allowed values are TCP or UDP. Default value is TCP.
+
+ httpSupport
+ Optional. httpSupport = true is the default setting for TCP protocol. Set httpSupport = false if a web server isn't running on the port. Zerops uses this information for the configuration of public access. httpSupport = true is available only in combination with the TCP protocol.
+
+### prepareCommands
+_OPTIONAL._ Customises the .NET runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base .NET environment contains {data.alpine.default}, the selected
+ major version of .NET, Zerops command line tool and `ASP .NET` and `git`. To install additional packages
+ or tools add one or more prepare commands:
+```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 .NET runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/dotnet/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/dotnet/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+When the prepare cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.default}, the
+ selected major version of .NET,
+ Zerops command line tool and
+ `ASP .NET` and `git`.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare: ./runtime-config.yaml
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base .NET runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your .NET application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your .NET application is started via the [start command](/dotnet/how-to/build-pipeline#start).
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](/dotnet/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](/dotnet/how-to/build-pipeline#preparecommands-1) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](/dotnet/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ DOTNET_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/dotnet/how-to/env-variables) in Zerops.
+### start
+_REQUIRED._ Defines the start command for your .NET application.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your .NET application start command
+ start: cd app && dotnet dnet.dll
+```
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your .NET application start command
+ start: cd app && dotnet dnet.dll
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your .NET application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your .NET application start command
+ start: cd app && dotnet dnet.dll
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+### crontab
+_OPTIONAL._ Defines cron jobs.
+Setup cron jobs in the following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ crontab:
+ # REQUIRED. Sets the command to execute:
+ - command: ""
+ # REQUIRED. Sets the interval time to execute:
+ timing: "0 * * * *"
+```
+Read more about setting up [cron](/references/cron) in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](/dotnet/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](/dotnet/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your .NET application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](/dotnet/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Dotnet > How To > Build Process
+
+
+## Description of the build process
+Zerops starts a temporary build container and performs following actions:
+1. Installs the build environment:
+ - Sets up base system and Go runtime
+ - Restores cached files if available (based on `build.cache` configuration)
+ - Validates cache against current `build.os`, `build.base`, and `build.prepareCommands`
+2. Downloads your application source code from [GitHub ↗](https://www.github.com), [GitLab ↗](https://www.gitlab.com) or via [Zerops CLI](/references/cli)
+3. Optionally [customizes the build environment](#customize-net-build-environment)
+4. Runs the build commands
+5. Uploads the application artefact to the internal Zerops storage
+6. Preserves specified files for future builds (based on `build.cache` configuration)
+7. Optionally [customizes the runtime environment](/dotnet/how-to/customize-runtime)
+8. [Deploys your application](/dotnet/how-to/deploy-process)
+The build container is automatically deleted after the build has finished or failed.
+## Cancel running build
+When you know that the running build is not correct and you want to cancel it, you can do it in Zerops GUI. Go to the service detail, select **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Cancel build** button.
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+## Customize .NET build environment
+The default .NET build environment contains:
+- {data.alpine.default}
+- selected version of .NET defined in `zerops.yaml` [build.base](/dotnet/how-to/build-pipeline#base) parameter
+- [zCLI](/references/cli)
+- ASP .NET and Git
+:::note
+To use Ubuntu instead of the default Alpine, set the [build.os](/zerops-yaml/specification#os-) attribute.
+Additional packages and tools can be installed using [build.prepareCommands](/zerops-yaml/specification#preparecommands-).
+:::
+:::info
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::
+## .NET build hardware resources
+Build of your .NET application is run in a separate build container with following resource configuration:
+| HW resource | Minimum | Maximum |
+| ------------- | ------- | ------- |
+| **CPU cores** | 6 | 20 |
+| **RAM** | 8 GB | 8 GB |
+| **Disk** | 1 GB | 100 GB |
+| **Disk** | 1 GB | 100 GB |
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+## Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops will terminate the build pipeline and delete the build container.
+## Troubleshooting build-related problems
+### Failure of a build prepare command
+If any [prepare command](/dotnet/how-to/build-pipeline#preparecommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/dotnet/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom build environment is ready for the build phase.
+### Invalidate the build cache
+If you encounter unexpected build behavior or dependency issues, the problem might be related to [cached build data](/features/build-cache). While Zerops maintains the build cache to speed up deployments, sometimes you may need to start fresh.
+To invalidate the build cache:
+1. Go to your service detail in Zerops GUI
+2. Choose **Pipelines & CI/CD Settings** from the left menu
+3. Click on the **Invalidate build cache** button
+This will force Zerops to run the next build clean, including all prepare commands, which can help resolve cache-related issues. After invalidation, your next build will also create a fresh cache.
+### Failure of a build command
+If any [build command](/dotnet/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/dotnet/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `--verbosity ` option.
+```yaml
+buildCommands:
+ - dotnet build --verbosity detailed
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the [deploy](/dotnet/how-to/deploy-process) phase.
+
+----------------------------------------
+
+# Dotnet > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart .NET service in Zerops GUI
+To stop the .NET service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped .NET service choose the **Start** item from the same menu.
+To restart the .NET service choose the **Restart** item from the same menu.
+## Stop and start .NET using zCLI
+zCLI is the Zerops command-line tool. To stop and start the .NET service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Dotnet > How To > Create
+
+Zerops provides a .NET runtime service with extensive build support. .NET runtime is highly scalable and customisable to suit both development and production.
+## Create .NET service using Zerops GUI
+First, set up a project in Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new .NET service:
+### Choose .NET version
+Following .NET versions are currently supported:
+:::info
+You can [change](/dotnet/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app","cache", "gui" etc. Duplicate services with the same name in the same project are forbidden.
+#### Limitations:
+- maximum 25 characters
+- must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created. It can't be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as password, tokens, salts, certificates etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting the secret environment variables is optional. You can set them later in Zerops GUI.
+Read more about [different types of env variables](/dotnet/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Set auto scaling configuration
+Zerops scales the .NET services automatically both vertically and horizontally. Vertical scaling means increasing or decreasing the hardware resources (CPU, RAM and disk) of a .NET container. Horizontal scaling adds or removes whole containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+.NET service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the .NET service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient .NET performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/dotnet/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+:::info
+You can change the vertical auto scaling parameters later.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your .NET service. When your .NET service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+.NET service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](/dotnet/how-to/scaling) about .NET auto scaling.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Create .NET service using zCLI
+zCLI is the Zerops command-line tool. To create a new .NET service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/dotnet/how-to/create#create-a-project-description-file)
+3. [Create a project with a .NET and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### Basic example:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in dotnet@6 format
+ type: dotnet@6
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one .NET version 6 service with default [auto scaling](/dotnet/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/dotnet/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a .NET and PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in dotnet@6 format
+ type: dotnet@6
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create secret env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+ - # second service hostname
+ hostname: db
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain a .NET service and a [PostgreSQL](/postgresql/overview) service.
+.NET service with "app" hostname, the internal port(s) the service listens on will be defined later in the [zerops.yaml](/dotnet/how-to/build-pipeline#ports). .NET service will run on version 6 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+ Limitations
+
+ name
+ The name of the new project. Duplicates are allowed.
+
+ description
+ Optional. Description of the new project.
+ Maximum 255 characters.
+
+ tags
+ Optional. One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects.
+
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains .NET and PostgreSQL services but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ The hostname of the new database will be set to the `hostname` value.
+
+ Limitations:
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+ See what [.NET service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+
+ All verticalAutoscaling attributes are optional. Not specified attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add .NET service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in dotnet@6 format
+ type: dotnet@6
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one .NET service version 6 with default [auto scaling](/dotnet/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Dotnet > How To > Customize Runtime
+
+
+The default .NET runtime environment contains:
+- {data.alpine.default}
+- Selected version of .NET when the runtime service was created.
+- [zCLI](/references/cli)
+- ASP .NET and Git
+:::note
+To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yaml/specification#os--1) attribute.
+Additional packages and tools can be installed using [run.prepareCommands](/zerops-yaml/specification#preparecommands--1).
+:::
+## Runtime Flow
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. Create a prepare runtime container
+2. Optionally: [copy selected folders or files from your build container](/dotnet/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. Run the `prepareCommands` in the defined order
+## Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/dotnet/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+The prepare runtime container is automatically deleted after the prepare runtime phase has finished or failed.
+## Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the build.addToRunPrepare and run.prepareCommands attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+:::tip
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+:::
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+
+----------------------------------------
+
+# Dotnet > How To > Delete
+
+## Delete .NET service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete .NET using zCLI
+zCLI is the Zerops command-line tool. To delete the .NET service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects to choose from.
+
+----------------------------------------
+
+# Dotnet > How To > Deploy Process
+
+
+## Application artefact
+When the [build phase](/dotnet/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](/dotnet/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/dotnet/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/dotnet/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/dotnet/how-to/build-pipeline#initcommands)
+4. Starts your application using the [start command](/dotnet/how-to/build-pipeline#start)
+5. Optionally waits until the [readiness check](/dotnet/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/dotnet/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customize the runtime environment](/dotnet/how-to/customize-runtime).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The .NET process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready to handle requests right after it is started via the [start command](/dotnet/how-to/build-pipeline#start), configure a [readiness check](/dotnet/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your .NET service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/dotnet/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Dotnet > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+
+ Type
+ Environment
+ Defined in
+
+ basic
+ build
+ zerops.yaml
+
+ basic
+ runtime
+ zerops.yaml
+
+ secret
+ runtime
+ Zerops GUI
+
+Use the [secret env variables](/dotnet/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](/dotnet/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/dotnet/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](/dotnet/how-to/create) a new .NET service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made to environment variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The .NET process running in the container receives the list env variables only when it starts. Update of the env variables while the .NET process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+These restrictions apply to all [types of env variables](/dotnet/how-to/env-variables#types-of-env-variables-in-zerops).
+## Referencing other env variables
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your .NET runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the .NET service. The .NET process running in the container receives the list env variables only when it starts. Update of the env variables while the .NET process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a .NET service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your .NET app
+Zerops passes all environment variables from all project services when your .NET app is deployed and started.
+To access the local environment variable i.e. the variable set to this .NET service in your app, use:
+```sh
+Environment.GetEnvironmentVariable("YOUR_VARIABLE_KEY_HERE");
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+
+----------------------------------------
+
+# Dotnet > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Dotnet > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](/dotnet/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](/dotnet/how-to/build-pipeline#preparecommands-1) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the runtime containers in Zerops CLI use
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## .NET logging configuration
+Zerops logs all messages sent
+- to the standard error (`stderr`)
+- to the standard output (`stdout`)
+- via the .NET `Console` logging provider and `Log{LogLevel}` method
+### Severity level
+By default the `Log{LogLevel}` methods create messages with the `Informational (6)` severity.
+Add a severity number in the `` format as a prefix to set a custom severity as shown below:
+```csharp
+builder.Logging.AddConsole();
+var app = builder.Build();
+app.Logger.LogInformation('A message with the informational severity ...');
+app.Logger.LogInformation('Emergency (0) severity > system is unusable.');
+app.Logger.LogInformation('Alert (1) severity > action must be taken immediately.');
+app.Logger.LogInformation('Critical (2) severity > critical conditions.');
+app.Logger.LogInformation('Error (3) severity > error conditions.');
+app.Logger.LogInformation('Warning (4) severity > warning conditions.');
+app.Logger.LogInformation('Notice (5) severity > normal, but significant, condition.');
+app.Logger.LogInformation('Informational (6) severity > informational message.');
+app.Logger.LogInformation('Debug (7) severity > debug-level message.');
+```
+:::info
+`logger.LogTrace`, `logger.LogInformation`,
+`logger.LogWarning`, `logger.LogDebug`, `
+ logger.LogError
+` and `logger.LogCritical` are just aliases to the `
+ logger.LogInformation
+` method. They don't set the appropriate severity number. Use the `
+ <N>
+` prefix instead. :::
+
+----------------------------------------
+
+# Dotnet > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the .NET service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+.NET service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the .NET service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient .NET performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your .NET service. When your .NET service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+.NET service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each .NET service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the .NET service.
+### Not enough resources to scale up
+If one of the .NET containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the .NET service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor .NET resources
+Zerops provides information about how much hardware resources the .NET service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Dotnet > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your .NET service directly when creating a new shared storage service. Just select your .NET service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the .NET service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create .NET service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new .NET service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/dotnet/how-to/shared-storage#create-a-project-description-file)
+3. [Create a project with a .NET service and a shared storage](/dotnet/how-to/shared-storage#create-a-project-with-a-net-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](/dotnet/how-to/create#create-a-project-description-file) how to define the .NET service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a .NET and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in dotnet@6 format
+ type: dotnet@6
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the .NET service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with a .NET service and a shared storage
+Follow the article [How to create a project based on the description.yaml](/dotnet/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Dotnet > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](/dotnet/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](/dotnet/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](/dotnet/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Dotnet > How To > Upgrade
+
+You can upgrade or downgrade your .NET service to a different major .NET version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/dotnet/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required .NET version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current .NET version for your runtime.
+If you want to build your application with a different major .NET version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
+
+----------------------------------------
+
+# Dotnet > Overview
+
+[.NET ↗](https://dotnet.microsoft.com/en-us/) is the free, open-source, cross-platform framework for building modern apps and powerful cloud services..
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-dotnet-hello-world), a **_recipe_**, containing the most simple .NET web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of .NET running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-dotnet-hello-world/blob/main/import-project/description.yaml)):
+```yaml
+project:
+ name: my-first-project
+services:
+ - hostname: helloworld
+ type: dotnet@latest
+ minContainers: 1
+ maxContainers: 3
+ buildFromGit: https://github.com/zeropsio/recipe-dotnet-hello-world@main
+ enableSubdomainAccess: true
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://helloworld-24-8080.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+Hello, World!
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+## How to start
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Elasticsearch > Overview
+
+Deploy [Elasticsearch] instances in Zerops with flexible scaling options, from standalone to highly available clusters.
+## Connection
+- **Port**: 9200
+- **Protocol**: HTTP only
+- **Internal Access**: `http://hostname:9200`
+- **Note**: When accessing from another service within the same project, use the service hostname
+## Configuration
+### How to install/uninstall plugins
+Configure Elasticsearch plugins using a comma-separated list:
+```yaml
+envSecrets:
+ PLUGINS: "analysis-icu,ingest-attachment"
+```
+- **Description**: Defines plugins to install at startup
+- **Format**: `plugin1,plugin2,...`
+- **Note**: Removing a plugin from this list triggers uninstallation on service restart
+### How to adjust JVM heap allocation
+Control JVM heap size as a percentage of container memory:
+```yaml
+envSecrets:
+ HEAP_PERCENT: "75"
+```
+- **Description**: Percentage of container memory allocated to JVM heap
+- **Default**: 50
+- **Range**: 1-100
+- **Note**: To increase available memory, adjust the service's RAM allocation in scaling configuration
+- **Important**: Changes to HEAP_PERCENT require a service restart to take effect
+## Backup
+- **Format:** .gz
+- **Implementation:** Created using elasticdump and compressed using gzip
+For detailed information about backup configuration and management, see [Backup Management](/features/backup)
+## Example Configuration
+```yaml
+services:
+ - hostname: elasticsearch
+ type: elasticsearch@8.16
+ mode: HA
+ envSecrets:
+ PLUGINS: "analysis-icu,ingest-attachment"
+ HEAP_PERCENT: "75"
+```
+## Related Resources
+- [Elasticsearch Official Documentation](https://www.elastic.co/guide/index.html)
+- [Available Elasticsearch Plugins](https://www.elastic.co/guide/en/elasticsearch/plugins/current/index.html)
+
+----------------------------------------
+
+# Elixir > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing Elixir application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](/elixir/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple Elixir web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Elixir > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](/elixir/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](/elixir/how-to/build-pipeline#ports) `3000`, simply use `http://app:3000`
+:::info
+Do not use `https://` when communicating with Elixir from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use Elixir environment variables
+Zerops creates default environment variables for each Elixir service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](/elixir/how-to/env-variables#generated-env-variables) of the Elixir service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](/elixir/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your Elixir application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access Elixir application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/elixir/how-to/env-variables) are available when connected through VPN. To connect to your Elixir application in Zerops set the hostname and [internal port](/elixir/how-to/build-pipeline#ports) e.g. http://app:3000
+:::info
+Do not use `https://` when communicating with Elixir over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your Elixir service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your Elixir service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/elixir/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Elixir > How To > Build Pipeline
+
+Zerops provides a customizable build and runtime environment for your Elixir application.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: elixir@latest
+ # OPTIONAL. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customise the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # REQUIRED. Build your application
+ buildCommands:
+ - mix deps.get --only prod
+ - mix compile
+ - mix release
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles: _build/prod/rel/app/
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ cache: node_modules
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: elixir@latest
+ # OPTIONAL. Sets the internal port(s) your app listens on:
+ ports:
+ # port number
+ - port: 3000
+ # OPTIONAL. Customise the runtime Elixir environment by installing additional
+ # dependencies to the base Elixir runtime environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Elixir application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # REQUIRED. Your Elixir application start command
+ start: npm start
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your Elixir application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Build pipeline configuration
+### base
+_REQUIRED._ Sets the base technology for the build environment.
+Following options are available for Elixir builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: elixir@latest
+ ...
+```
+ The base build environment contains {data.alpine.default}, the selected
+ major version of Elixir, Zerops command line tool, `npm`, `yarn`, `git` and `npx` tools.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base:
+ - elixir@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
+To customise your build environment use the [prepareCommands](/elixir/how-to/build-pipeline#preparecommands) attribute.
+:::note
+Modifying the base technology will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### os
+_OPTIONAL._ Sets the operating system for the build environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+:::note
+Changing the OS setting will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache behavior.
+:::
+### prepareCommands
+_OPTIONAL._ Customises the build environment by installing additional dependencies or tools to the base build environment.
+The base build environment contains:
+- {data.alpine.default}
+- selected version of Elixir defined in the [base](/elixir/how-to/build-pipeline#base) attribute
+- [Zerops command line tool](/references/cli)
+- `npm`, `yarn`, `git` and `npx` tools
+To install additional packages or tools add one or more prepare commands:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: elixir@latest
+ # OPTIONAL. Customise the build environment by installing additional packages
+ # or tools to the base build environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first build is triggered, Zerops will
+1. create a build container
+2. download your application code from your repository
+3. run the prepare commands in the defined order
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::note
+These commands are skipped when using cached environment. Modifying `prepareCommands` will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache invalidation.
+:::
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/elixir/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all prepare commands are finished, your custom build environment is ready for the build phase.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### buildCommands
+_REQUIRED._ Defines build commands.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: elixir@latest
+ # REQUIRED. Build your application
+ buildCommands:
+ - npm i
+ - npm run build
+ ...
+```
+At least one command is required. Zerops triggers each command in the defined order in a dedicated build container.
+Before the build commands are triggered the build container contains:
+1. base environment defined by the [base](/elixir/how-to/build-pipeline#base) attribute
+2. optional customisation of the base environment defined in the [prepareCommands](/elixir/how-to/build-pipeline#preparecommands) attribute
+3. your application code
+#### Run build commands as a single shell instance
+Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it.
+```yaml
+buildCommands:
+ - |
+ npm i
+ npm run build
+```
+#### Run build commands as a separate shell instances
+When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command.
+```yaml
+buildCommands:
+ - npm i
+ - npm run build
+```
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/elixir/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the --verbose option.
+```yaml
+buildCommands:
+ - npm i --verbose
+ - npm run build
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the deploy phase.
+### deployFiles
+_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
+```yaml
+# REQUIRED. Select which files / folders to deploy after
+# the build has successfully finished
+deployFiles:
+ - dist
+ - package.json
+ - node_modules
+```
+Determines files or folders produced by your build, which should be deployed to your runtime service containers.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Examples
+Deploys a folder, and a file from the project root directory:
+```yaml
+deployFiles:
+ - dist
+ - package.json
+```
+Deploys the whole content of the build container:
+```yaml
+deployFiles: .
+```
+Deploys a folder, and a file in a defined path:
+```yaml
+deployFiles:
+ - ./path/to/file.txt
+ - ./path/to/dir/
+```
+#### How to use a wildcard in the path
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+Deploys all folders that are located in any path that begins with `/path/to/`
+```yaml
+deployFiles: ./path/to/~/
+```
+Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/
+```
+:::note Example
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+:::
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+_OPTIONAL._ Defines which files or folders will be cached for the next build.
+```yaml
+# OPTIONAL. Which files / folders you want to cache for the next build.
+# Next builds will be faster when the cache is used.
+cache: file.txt
+```
+The cache attribute helps optimize build times by preserving specified files between builds.
+The cache attribute supports the [~ wildcard character](#how-to-use-a-wildcard-in-the-path).
+Learn more about the [build cache system](/features/build-cache) in Zerops.
+### envVariables
+_OPTIONAL._ Defines the environment variables for the build environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ base: elixir@latest
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/elixir/how-to/env-variables) in Zerops.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current Elixir version for your runtime.
+Following options are available for Elixir builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: elixir@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: elixir@latest
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the
+ selected major version of Elixir, Zerops command line tool, `npm`, `yarn`, `git` and `npx` tools.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: elixir@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base:
+ - elixir@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customise your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a Elixir service with hostname = "app" and port = 3000 from another service of the same project, simply use `app:3000`. Read more about [how to access a Elixir service](/elixir/how-to/access).
+Each port has following attributes:
+| parameter | description |
+| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| port | Defines the port number. You can set any port number between _10_ and _65435_. Ports outside this interval are reserved for internal Zerops systems. |
+| protocol | **Optional.** Defines the protocol. Allowed values are `TCP` or `UDP`. Default value is `TCP`. |
+| httpSupport | **Optional.** `httpSupport = true` is the default setting for TCP protocol. Set `httpSupport = false` if a web server isn't running on the port. Zerops uses this information for the configuration of [public access](/features/access). `httpSupport = true` is available only in combination with the TCP protocol. |
+| httpSupport | **Optional.** `httpSupport = true` is the default setting for TCP protocol. Set `httpSupport = false` if a web server isn't running on the port. Zerops uses this information for the configuration of [public access](/features/access). `httpSupport = true` is available only in combination with the TCP protocol. |
+### prepareCommands
+_OPTIONAL._ Customises the Elixir runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base Elixir environment contains {data.alpine.default} the selected
+ major version of Elixir, Zerops command line tool and `npm`, `yarn`, `git` and `npx` tools. To install
+ additional packages or tools add one or more prepare commands:
+```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 Elixir runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/elixir/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/elixir/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the custom runtime cache go to `yyy`
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.default}, the
+ selected major version of Elixir, Zerops command line tool and `npm`, `yarn`, `git` and `npx` tools.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare: ./runtime-config.yaml
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base Elixir runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Elixir application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your Elixir application is started via the [start command](/elixir/how-to/build-pipeline#start).
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](/elixir/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](/elixir/how-to/build-pipeline#preparecommands-1) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](/elixir/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/elixir/how-to/env-variables) in Zerops.
+### start
+_REQUIRED._ Defines the start command for your Elixir application.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Elixir application start command
+ start: npm start
+```
+We recommend starting your Elixir application using `npm start`.
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Elixir application start command
+ start: npm start
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+| Parameter | Description |
+| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **command** | Defines a local command to be run.
+The command has access to the same [environment variables](/elixir/how-to/create#set-secret-environment-variables) as your Elixir application.
+A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below. |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Elixir application start command
+ start: npm start
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+### crontab
+_OPTIONAL._ Defines cron jobs.
+Setup cron jobs in the following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ crontab:
+ # REQUIRED. Sets the command to execute:
+ - command: ""
+ # REQUIRED. Sets the interval time to execute:
+ timing: "0 * * * *"
+```
+Read more about setting up [cron](/references/cron) in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](/elixir/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](/elixir/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+| Parameter | Description |
+| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **command** | Defines a local command to be run.
+The command has access to the same [environment variables](/elixir/how-to/create#set-secret-environment-variables) as your Elixir application.
+A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below. |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](/elixir/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Elixir > How To > Build Process
+
+
+## Description of the build process
+Zerops starts a temporary build container and performs following actions:
+1. Installs the build environment:
+ - Sets up base system and Go runtime
+ - Restores cached files if available (based on `build.cache` configuration)
+ - Validates cache against current `build.os`, `build.base`, and `build.prepareCommands`
+2. Downloads your application source code from [GitHub ↗](https://www.github.com), [GitLab ↗](https://www.gitlab.com) or via [Zerops CLI](/references/cli)
+3. Optionally [customizes the build environment](#customize-elixir-build-environment)
+4. Runs the build commands
+5. Uploads the application artefact to the internal Zerops storage
+6. Preserves specified files for future builds (based on `build.cache` configuration)
+7. Optionally [customizes the runtime environment](/elixir/how-to/customize-runtime)
+8. [Deploys your application](/elixir/how-to/deploy-process)
+The build container is automatically deleted after the build has finished or failed.
+## Cancel running build
+When you know that the running build is not correct and you want to cancel it, you can do it in Zerops GUI. Go to the service detail, open the list of running processes and click on the **Open pipeline detail** button. Then click on the **Cancel build** button.
+
+:::caution
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+:::
+## Customize Elixir build environment
+The default Elixir build environment contains:
+- {data.alpine.default}
+- selected version of Elixir defined in `zerops.yaml` [build.base](/elixir/how-to/build-pipeline#base) parameter
+- [zCLI](/references/cli), Zerops command line tool
+- `npm`, `yarn`, `git` and `npx` tools
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/elixir/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](/elixir/how-to/build-pipeline#preparecommands) commands to your `zerops.yaml`.
+:::info
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::
+## Elixir build hardware resources
+Build of your Elixir application is run in a separate build container with following resource configuration:
+| HW resource | Minimum | Maximum |
+| ------------- | ------- | ------- |
+| **CPU cores** | 6 | 20 |
+| **RAM** | 8 GB | 8 GB |
+| **Disk** | 1 GB | 100 GB |
+| **Disk** | 1 GB | 100 GB |
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+## Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops will terminate the build pipeline and delete the build container.
+## Troubleshooting build-related problems
+### Failure of a build prepare command
+If any [prepare command](/elixir/how-to/build-pipeline#preparecommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/elixir/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom build environment is ready for the build phase.
+### Invalidate the build cache
+If you encounter unexpected build behavior or dependency issues, the problem might be related to [cached build data](/features/build-cache). While Zerops maintains the build cache to speed up deployments, sometimes you may need to start fresh.
+To invalidate the build cache:
+1. Go to your service detail in Zerops GUI
+2. Choose **Pipelines & CI/CD Settings** from the left menu
+3. Click on the **Invalidate build cache** button
+This will force Zerops to run the next build clean, including all prepare commands, which can help resolve cache-related issues. After invalidation, your next build will also create a fresh cache.
+### Failure of a build command
+If any [build command](/elixir/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/elixir/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `--verbose` option.
+```yaml
+buildCommands:
+ - npm i --verbose
+ - npm run build
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the [deploy](/elixir/how-to/deploy-process) phase.
+
+----------------------------------------
+
+# Elixir > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart Elixir service in Zerops GUI
+To stop the Elixir service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped Elixir service choose the **Start** item from the same menu.
+To restart the Elixir service choose the **Restart** item from the same menu.
+## Stop and start Elixir using zCLI
+zCLI is the Zerops command-line tool. To stop and start the Elixir service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Elixir > How To > Create
+
+Zerops provides a powerful Elixir runtime service with extensive build support. The Elixir runtime is highly scalable and customizable to suit your development and production needs. With just a few clicks or commands, you can have a production-ready Elixir environment up and running in no time.
+## Create a Elixir service using Zerops GUI
+First, set up a project in the Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu under the **Services** section. From there, you can add a new Elixir service:
+### Choose a Elixir version
+Zerops supports the following Elixir versions:
+:::info
+You can easily [upgrade](/elixir/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app", "cache", "gui", etc. Duplicate services with the same name within the same project are not allowed.
+#### Limitations:
+- Maximum 25 characters
+- Must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created and cannot be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as passwords, tokens, salts, certificates, etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting secret environment variables is optional. You can always set them later in the Zerops GUI.
+Read more about the [different types of environment variables](/elixir/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Configure auto scaling
+Zerops automatically scales Elixir services both vertically and horizontally. Vertical scaling adjusts the hardware resources (CPU, RAM, and disk) of a Elixir container, while horizontal scaling adds or removes entire containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. The power your application receives depends on the other applications running on the same CPU core. In the best-case scenario, your application gets 10/10 of the CPU core power, and 1/10 in the worst-case scenario.
+**Dedicated**
+The CPU core is dedicated exclusively to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+You can choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has the following default configuration:
+Elixir services always start with the minimal resources.
+In most cases, the default parameters will work without issues. If you need to limit the cost of the Elixir service, you can lower the maximum resources. Zerops will never scale above the selected maximums.
+If you experience insufficient Elixir performance or capacity, you can increase the minimum resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine-tune](/elixir/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application's needs.
+:::
+:::info
+You can change the vertical auto scaling parameters at any time.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but is already consuming the maximum resources defined for vertical auto scaling, Zerops will add a new container to your Elixir service. When your Elixir service doesn't need as much power and all containers are vertically scaled down such that their CPU allocation is near the minimum resources, Zerops will gradually remove entire containers.
+Horizontal auto scaling has the following default configuration:
+
+ Minimum containers
+
+ 1
+
+ Maximum containers
+
+ 6
+
+Elixir services always start with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](/elixir/how-to/scaling) about Elixir auto scaling in Zerops.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will automatically start a new container and deploy your application. However, the application will be unavailable for a short period. This mode is recommended for non-critical applications or development environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers based on your application's load. An application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed down to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents temporary outages in case any of the Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically, and the broken container will be deleted.
+:::caution
+Make sure your application is designed to run in multiple containers.
+:::
+## Create a Elixir service using zCLI
+zCLI is the Zerops command-line tool. To create a new Elixir service via the command line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/elixir/how-to/create#create-a-project-description-file)
+3. [Create a project with a Elixir and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a YAML format to describe the project infrastructure.
+#### Basic example:
+Create a directory called `my-project`. Inside the `my-project` directory, create a `description.yaml` file with the following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in elixir@{version} format
+ type: elixir@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one Elixir version 20 service with default [auto scaling](/elixir/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/elixir/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Elixir and PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in elixir@{version} format
+ type: elixir@latest
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+ - # second service hostname
+ hostname: db
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain a Elixir service and a [PostgreSQL](/postgresql/overview) service.
+Elixir service with "app" hostname, the internal port(s) the service listens on will be defined later in the [zerops.yaml](/elixir/how-to/build-pipeline#ports). Elixir service will run on version 20 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+| Parameter | Description | Limitations |
+| --------------- | ------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
+| **name** | The name of the new project. Duplicates are allowed. | |
+| **description** | **Optional.** Description of the new project. | Maximum 255 characters. |
+| **tags** | **Optional.** One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects. |
+| **tags** | **Optional.** One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects. |
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains Elixir and PostgreSQL services but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [Elixir service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+ All verticalAutoscaling attributes are optional. Not specified
+ attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers
+ for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value
+ map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add Elixir service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in elixir@{version} format
+ type: elixir@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Elixir service version 20 with default [auto scaling](/elixir/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Elixir > How To > Customize Runtime
+
+
+The default Elixir runtime environment contains:
+- {data.alpine.default}
+- selected version of Elixir selected when the runtime service was created.
+-
+ `zCLI`
+
+ , Zerops command line tool
+- `npm`, `yarn`, `git` and `npx` tools
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/elixir/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more `run.prepareCommands` commands to your `zerops.yaml`.
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/elixir/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `run.prepareCommands` commands in the defined order
+### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/elixir/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+The prepare runtime container is automatically deleted after the prepare runtime phase has finished or failed.
+### Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the `build.addToRunPrepare` and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the custom runtime cache go to `yyy`
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+
+----------------------------------------
+
+# Elixir > How To > Delete
+
+## Delete Elixir service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete Elixir using zCLI
+zCLI is the Zerops command-line tool. To delete the Elixir service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Elixir > How To > Deploy Process
+
+
+## Application artefact
+When the [build phase](/elixir/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](/elixir/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/elixir/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/elixir/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/elixir/how-to/build-pipeline#initcommands)
+4. Starts your application using the [start command](/elixir/how-to/build-pipeline#start)
+5. Optionally waits until the [readiness check](/elixir/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/elixir/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customize the runtime environment](/elixir/how-to/build-pipeline#preparecommands-1).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The Elixir process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready to handle requests right after it is started via the [start command](/elixir/how-to/build-pipeline#start), configure a [readiness check](/elixir/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your Elixir service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/elixir/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Elixir > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+| environment | type | defined in |
+| ----------- | ------ | --------------------------------------------------------------------------------- |
+| build | basic | [zerops.yaml](/elixir/how-to/build-pipeline#envvariables) |
+| runtime | basic | [zerops.yaml](/elixir/how-to/build-pipeline#envvariables-1) |
+| runtime | secret | [Zerops GUI](#set-secret-env-variables-in-zerops-gui) |
+| runtime | secret | [Zerops GUI](#set-secret-env-variables-in-zerops-gui) |
+Use the [secret env variables](/elixir/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](/elixir/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/elixir/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](/elixir/how-to/create) a new Elixir service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made to environment variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The Elixir process running in the container receives the list env variables only when it starts. Update of the env variables while the Elixir process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+These restrictions apply to all [types of env variables](/elixir/how-to/env-variables#types-of-env-variables-in-zerops).
+## Referencing other env variables
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your Elixir runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the Elixir service. The Elixir process running in the container receives the list env variables only when it starts. Update of the env variables while the Elixir process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a Elixir service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your Elixir app
+Zerops passes all environment variables from all project services when your Elixir app is deployed and started.
+To access the local environment variable i.e. the variable set to this Elixir service in your app, use:
+```sh
+process.env.YOUR_VARIABLE_KEY_HERE
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+
+----------------------------------------
+
+# Elixir > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Elixir > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](/elixir/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](/elixir/how-to/build-pipeline#preparecommands-1) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the runtime containers in Zerops CLI use
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## Elixir logging configuration
+Zerops logs all messages sent
+- to the standard error (`stderr`)
+- to the standard output (`stdout`)
+- via the Elixir `console.log` method
+### Severity level
+By default the `console.log` creates a message with the `Informational (6)` severity.
+Add a severity number in the `` format as a prefix to set a custom severity as shown below:
+```js
+console.log('A message with the informational severity ...');
+console.log('Emergency (0) severity > system is unusable.');
+console.log('Alert (1) severity > action must be taken immediately.');
+console.log('Critical (2) severity > critical conditions.');
+console.log('Error (3) severity > error conditions.');
+console.log('Warning (4) severity > warning conditions.');
+console.log('Notice (5) severity > normal, but significant, condition.');
+console.log('Informational (6) severity > informational message.');
+console.log('Debug (7) severity > debug-level message.');
+```
+:::info
+`console.info`, `console.warn`, `console.debug`
+, and `console.error` are just aliases to the `
+ console.log
+` method. They don't set the appropriate severity number. Use the `
+ <N>
+` prefix instead. :::
+
+----------------------------------------
+
+# Elixir > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the Elixir service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Elixir service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Elixir service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Elixir performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Elixir service. When your Elixir service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Elixir service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each Elixir service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the Elixir service.
+### Not enough resources to scale up
+If one of the Elixir containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the Elixir service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor Elixir resources
+Zerops provides information about how much hardware resources the Elixir service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Elixir > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your Elixir service directly when creating a new shared storage service. Just select your Elixir service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the Elixir service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create Elixir service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new Elixir service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/elixir/how-to/shared-storage#create-a-project-description-file)
+3. [Create a project with a Elixir service and a shared storage](/elixir/how-to/shared-storage#create-a-project-with-a-elixir-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](/elixir/how-to/create#create-a-project-description-file) how to define the Elixir service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Elixir and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in elixir@{version} format
+ type: elixir@latest
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the Elixir service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with a Elixir service and a shared storage
+Follow the article [How to create a project based on the description.yaml](/elixir/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Elixir > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](/elixir/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](/elixir/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](/elixir/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Elixir > How To > Upgrade
+
+You can upgrade or downgrade your Elixir service to a different major Elixir version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/elixir/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Elixir version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Elixir version for your runtime.
+If you want to build your application with a different major Elixir version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
+
+----------------------------------------
+
+# Elixir > Overview
+
+[Elixir ↗](https://elixir.org/en) is an asynchronous event-driven JavaScript runtime, which is designed to build scalable network applications.
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-elixir), a **_recipe_**, containing the most simple Elixir web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of Elixir app running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-elixir/blob/main/zerops-project-import.yaml)):
+```yaml
+project:
+ name: recipe-elixir
+ tags:
+ - zerops-recipe
+services:
+ - hostname: api
+ type: elixir@1.16
+ enableSubdomainAccess: true
+ buildFromGit: https://github.com/zeropsio/recipe-elixir
+ - hostname: db
+ type: postgresql@16
+ mode: NON_HA
+ priority: 1
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://api-808-4000.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+{"message":"This is a simple Elixir application running on Zerops.io, each request adds an entry to the PostgreSQL database and returns a count. See the source repository (https://github.com/zeropsio/recipe-elixir) for more information.","newEntry":"e64be640-d6c2-4be8-93ac-d1e40e56fa06","count":1}
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+## How to start
+It doesn't matter whether it's your first curious introduction to Zerops, you have already mastered the basics and are looking for a tiny detail or inspiration. Below, choose a section that fits your needs:
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Features > Access
+
+export const languages = [
+ { name: "Bun", link: "/java/how-to/build-pipeline#ports" },
+ { name: "Deno", link: "/go/how-to/build-pipeline#ports" },
+ { name: ".NET", link: "/dotnet/how-to/build-pipeline#ports" },
+ { name: "Elixir", link: "/php/how-to/build-pipeline#ports" },
+ { name: "Gleam", link: "/dotnet/how-to/build-pipeline#ports" },
+ { name: "Go", link: "/go/how-to/build-pipeline#ports" },
+ { name: "Java", link: "/java/how-to/build-pipeline#ports" },
+ { name: "Node.js", link: "/nodejs/how-to/build-pipeline#ports" },
+ { name: "PHP", link: "/php/how-to/build-pipeline#ports" },
+ { name: "Python", link: "/python/how-to/build-pipeline#ports" },
+ { name: "Rust", link: "/rust/how-to/build-pipeline#ports" },
+]
+Zerops provides three ways to make your application accessible from the internet:
+- [Zerops subdomain](#public-access-through-zerops-subdomain) - ideal for testing and development
+- [Custom domain](#public-access-through-your-domain) - recommended for production deployments
+- [Direct port access](#opening-public-ports) - for non-HTTP protocols and specialized use cases
+Each method serves different needs and comes with its own configuration options.
+:::note
+By default, your runtime service is not publicly accessible until you configure one of these methods.
+:::
+## Public Access Through Zerops Subdomain
+For development and testing purposes, Zerops offers a quick way to make your application accessible through a `.zerops.app` subdomain. This option requires minimal configuration and includes automatic SSL certificate management.
+### Configuration Steps
+1. Navigate to your service detail page in Zerops GUI
+2. Select **Public access & internal ports** from the left menu
+3. Toggle the **Zerops subdomain access** switch
+
+Once enabled, Zerops assigns a unique subdomain for your application. If you've defined multiple [internal ports](/zerops-yaml/specification#ports-) with HTTP support in your `zerops.yaml`, each port receives its own unique `.zerops.app` subdomain.
+### Technical Details
+When using Zerops subdomains:
+- Access your application using the `https://` protocol (Zerops automatically manages SSL certificates)
+- Traffic flows through a central HTTP balancer that:
+ - Terminates SSL connections
+ - Forwards requests to your application via HTTP
+ - Handles all security certificates
+:::warning Production Limitations
+- The central HTTPS balancer is shared across all Zerops projects, which creates a scalability bottleneck
+- Maximum upload size is limited to 50MB
+- Not recommended for production traffic
+:::
+## Public Access Through Your Domain
+When your application is ready for production or you need to test with your actual domain, configure custom domain access. This method provides better performance, scalability, and full control over your domain settings.
+
+### IP Address Configuration
+Before setting up domain access, you'll need public IP addresses. Zerops offers the following IP options:
+#### IPv4 Options
+##### Dedicated IPv4 Address ($3/30 days)
+- Dedicated to your project and shared across all project services
+- One IPv4 address per project limit
+- Protects against blacklisting risks associated with shared IPs
+- Subscription automatically renews every 30 days *(cannot be purchased with promo credit)*
+ - Fee is non-refundable but address can be reused in another project until subscription ends
+- **Recommended for production workloads**
+##### Shared IPv4 Address (Free)
+- Available at no cost
+- Shared across all Zerops users and their projects
+- Limitations:
+ - Restricted number of open connections
+ - Shorter connection timeouts
+- **Not recommended for production use**
+#### IPv6 Address (Free)
+- Dedicated to your project and shared across all project services
+- One IPv6 address per project limit
+- Automatically activated with first domain setup
+- Available for all projects at no additional cost
+:::tip
+Since IPv6 support is not universal, using both IPv4 and IPv6 is recommended for maximum accessibility.
+:::
+### Configuring HTTP Routing
+To set up domain access:
+1. Go to your service detail in Zerops GUI and select **Public access & internal ports**
+2. Click **Setup first domain access**
+3. Configure your domain settings:
+ - Enter domain names (e.g., `mydomain.com`, `app.mydomain.com`)
+ - Add multiple domains if needed (useful for multi-language sites)
+ - Choose SSL certificate management
+4. Define routing rules:
+ - Source: The public path (the part of URL after your domain)
+ - Destination: Choose which application and internal port receives the traffic
+ - Add multiple routing configurations as needed
+All settings can be modified later as your needs change.
+### DNS Configuration
+After setting up domain access in Zerops, you'll need to configure your DNS records with your domain registrar.
+For detailed instructions on DNS configuration, including specific implementation details for Cloudflare, please refer to the [DNS and Proxy Setup](/features/dns) guide.
+### HTTPS Configuration
+When using Let's Encrypt certificates (recommended):
+#### Certificate Management
+- Zerops handles all certificate installation and renewal
+- Certificates are free of charge
+- No manual certificate management required
+#### Traffic Flow
+1. Traffic arrives at your public IPv4/IPv6 addresses
+2. Requests route through your project's dedicated HTTPS balancer
+3. SSL termination occurs at the balancer level
+4. Internal traffic uses HTTP protocol for optimal performance
+#### Balancer Architecture
+- Deployed in two containers for redundancy
+- Scales vertically based on traffic demands
+- Cannot be directly modified
+- Included free of charge
+## Opening Public Ports
+For applications requiring direct port access or non-HTTP protocols, Zerops provides flexible port configuration options.
+:::important
+Currently, direct public port access is only available for runtime services and PostgreSQL databases.
+:::
+
+### Port Configuration
+1. Navigate to service detail page in Zerops GUI
+ - For runtime services select **Subdomain & domain & IP access**
+ - For PostgreSQL select **Direct access through IP address**
+2. Configure your port settings:
+ - Either **Setup first access through IPv6** or activate **Unique IPv4 add-on** (if needed)
+ - Choose any port from 10-65435 (except 80 and 443)
+ - Select destination service and internal port
+ - Each public port can be mapped to any internal service port
+ - Multiple public ports can point to the same internal port if needed
+ - Port configurations can be set independently for IPv4 and IPv6
+### Firewall Configuration
+Optionally secure your ports with firewall rules:
+1. Enable firewall for specific ports
+2. Choose policy type:
+ - **Blacklist**: Block specific IPs/ranges
+ - **Whitelist**: Allow only specific IPs/ranges
+3. Configure IP rules:
+ - Single IP format affects only the specific IP
+ - IP range format affects all IPs in that CIDR range
+
+
+----------------------------------------
+
+# Features > Backup
+
+Zerops provides data backup for certain services.
+Whether a service supports backups is specified on the documentation page of each service. Technical details about backup implementation for each service are also described on their respective service pages.
+## Frequency and volume
+By default, your data is backed up automatically **every day** between 00:00:00 UTC and 01:00:00 UTC, unless you update your settings.
+### Managing Backups in GUI
+To manage backups, go to the service detail and choose **Backups List & Configuration** section in the left menu.
+#### Configure Backup Settings
+From this section, you can:
+- Do a one-time backup of your data
+- Change the frequency of your automatic backups
+- Turn off backing up your data completely
+
+#### Backup Frequency Options
+You can configure backups with several preset schedules:
+- **No backups**: Disable automatic backups (not recommended)
+- **Once a day**: Daily backups at the specified time
+- **Once a week**: Weekly backups on the specified day and time
+- **Once a month**: Monthly backups on the specified day and time
+- **Custom CRON**: Define a custom schedule using CRON syntax
+For the Custom CRON option, you can use the following syntax:
+
+ Field name
+ Allowed values
+
+ Minute
+ 0-59
+
+ Hour
+ 0-23
+
+ Day
+ 1-31
+
+ Month
+ 1-12
+
+ Week Day
+ 0–7; both 0 and 7 represent Sunday
+
+Examples:
+- `0 2 * * *` - Every day at 2:00 AM
+- `0 4 * * 0` - Every Sunday at 4:00 AM
+- `0 0 1 * *` - First day of every month at midnight
+#### View and Manage Backup Files
+In the same section, you can:
+- View all of your backups
+- Download a backup
+- Delete a backup
+
+### Limits
+- Each backup is stored for a maximum period of **1 month**
+- For each **service** a maximum of **100 backups** is stored
+- For each **project** a maximum of **25 GiB** of backup volume is stored. Only full backups are stored, the backup that exceeds the limit by its part is not stored
+If you need more backup storage space, contact our support team.
+#### Examples
+1. If you backup your data every day, and the total volume is less than 25 GiB, the maximum number of backups is ~30 for the last month. A new backup is stored every day (with the oldest one being deleted), unless you exceed the 25 GiB limit.
+2. If you backup your data every hour, and the total volume is less than 25 GiB, the total number of backups is 100 for the last 100 hours. A new backup is stored every hour (with the oldest one being deleted), unless you exceed the 25 GiB limit.
+3. If you backup your data every hour, and your backups exceed 25 GiB after 50 hours, the total number of backups is 50, unless you delete some of your backups or wait the oldest one is older than 1 month.
+## Persistence
+When deleting a service or a project:
+* Project deletion affects backups of **all** services within that project
+* Backups remain accessible for 7 days
+* After 7 days, all backups are permanently removed
+## High Availability Setup
+For services running in HA mode, the backup is created on one of the nodes at random. Other nodes report that the backup is running on another node.
+## Encryption and Security
+Backups are encrypted as soon as they are created. Here is the process:
+* **Key Generation:** We use asymmetric cryptography (X25519) to generate a private key, which is then encrypted using our secret key (RSA-OAEP) and securely stored in our database.
+* **Public Key Usage:** The public key is sent to the application, which uses it to encrypt the backup.
+* **Decryption:** When a user downloads a backup, it is decrypted using the private key stored safely in our database.
+This ensures your data remains secure during both storage and transmission.
+All backups are stored in a separate ObjectStorage instance, isolated from the instance accessible by users.
+After a project is deleted and the 7-day retention period expires, the project's encryption key is permanently deleted. Once this happens, there is no way to decrypt or restore the backup data.
+
+----------------------------------------
+
+# Features > Build Cache
+
+# Understanding Zerops Build Cache
+> Zerops implements a sophisticated two-layer caching strategy that optimizes build times while maintaining complete control over the build environment. This documentation explores the architecture, configuration patterns, and practical implementation of the build cache system.
+## Architecture Overview
+The build cache operates through two distinct layers:
+1. **Base Layer**: Comprises the OS, installed dependencies, and prepare commands
+2. **Build Layer**: Contains the state after executing build commands
+The layers work together to create an efficient and predictable build environment, though they are currently coupled in their cache invalidation behavior (invalidating one layer affects the other).
+### Cache Implementation
+The caching mechanism is implemented through an efficient file movement strategy. This approach ensures near-instantaneous cache operations through simple directory relocation within the container, implementing the following characteristics:
+- Files are moved between `/build/source` and `/build/cache` using container-level rename operations
+- No packaging, compression, or network transfer is involved
+- Cache preservation is achieved through simple directory relocation within the container
+- Files maintain their original state and permissions throughout the process
+:::note
+See detailed [build process lifecycle](#build-process-lifecycle).
+:::
+## Configuration Guide
+### Essential zerops.yaml Fields
+The following fields in `zerops.yaml` affect build cache behavior:
+**Direct Cache Configuration**:
+- `build.cache`: Explicitly defines what should be cached through paths or patterns
+**Cache Invalidation Triggers**:
+These parameters trigger cache invalidation when modified:
+- `build.os`: Base operating system selection
+- `build.base`: Pre-installed software stacks and runtimes
+- `build.prepareCommands`: System preparation and dependency installation
+- `build.cache`: Changes to cache configuration
+**Build Artifact Generation**:
+- `build.buildCommands`: Generates the build artifact that will be deployed.
+## Cache Configuration Patterns
+### Pattern 1: System-Wide Cache Control
+```yaml
+build:
+ cache: true # Cache everything
+ # OR
+ cache: false # Intended to disable all caching
+```
+The boolean values provide system-wide cache control:
+`cache: true`:
+- Preserves the entire build container state
+- Maintains system-level package installations
+- Ideal for globally installed packages (Python/PHP packages, Go modules)
+`cache: false`:
+- Intended to disable all caching
+- Currently, due to layer coupling, only files within `/build/source` are not cached
+- Everything outside `/build/source` remains cached (see [Common Pitfalls: Layer Coupling](#current-pitfalls))
+### Pattern 2: Path-Specific Caching
+```yaml
+# Single path
+build:
+ cache: node_modules
+# Multiple paths
+build:
+ cache:
+ - node_modules
+ - package-lock.json
+ - .build
+```
+Execution flow:
+1. Source code extraction to `/build/source`
+2. Build command execution
+3. Specified path preservation in `/build/cache`
+4. Cached content restoration (no-clobber mode - source files take precedence)
+:::tip
+Ideal for non-versioned dependencies in your working directory (e.g., `node_modules`, `vendor`, `.venv`).
+:::
+## Path Pattern Reference
+Zerops supports [Go's filepath.Match](https://pkg.go.dev/path/filepath#Match) syntax. Consider this example structure:
+```
+├── node_modules/
+├── package.json
+├── package-lock.json
+└── subdir/
+ ├── file1.txt
+ ├── file2.txt
+ └── file3.md
+```
+Pattern examples and matches:
+```yaml
+build:
+ cache:
+ - "subdir/*.txt" # Matches: subdir/file1.txt, subdir/file2.txt
+ - "package*" # Matches: package.json, package-lock.json
+ - "node_modules" # Matches: entire node_modules directory recursively
+```
+:::note
+All patterns resolve relative to `/build/source`. Path variations like `./node_modules`, `node_modules`, and `node_modules/` are treated identically.
+:::
+## Build Process Lifecycle
+1. **Initialization Phase**
+ - Build container startup
+ - Builder process launch
+ - Source code loading into `/build/source`
+2. **Cache Restoration Phase**
+ - Cached file movement to `/build/source` (no-clobber mode)
+ - Source file precedence handling
+ - Conflict logging (no build interruption)
+ - Cache directory cleanup
+3. **Build Execution Phase**
+ - Build command processing
+ - Artifact packaging (`build.deployFiles`)
+4. **Cache Preservation Phase**
+ - Specific cache files movement outside `/build/source`
+ - `/build/source` directory cleanup
+ - Container termination
+## Cache Invalidation Reference
+The build cache invalidates under these conditions:
+1. **Manual Triggers**
+ - API call: `DELETE /service-stack/{id}/build-cache`
+ - GUI: Manual cache clear action
+2. **Version Management**
+ - Backup app version activation via `PUT /app-version/{id}/deploy`
+3. **Configuration Changes**
+ Any modifications to:
+ ```yaml
+ build.os
+ build.base
+ build.prepareCommands
+ build.cache
+ ```
+### Current Pitfalls
+The current implementation has some important characteristics:
+1. **Layer Coupling**
+ ```yaml
+ build:
+ base: go@1
+ prepareCommands:
+ - sudo apk update
+ - sudo apk add sqlite
+ buildCommands:
+ - go build -o app main.go
+ cache: false
+ ```
+ Even with `cache: false`, Go modules outside `/build/source` remain cached.
+2. **Cascade Invalidation**
+ ```yaml
+ build:
+ base: node@22
+ prepareCommands:
+ - sudo apk update
+ - sudo apk add sqlite vim # Adding 'vim' invalidates everything
+ buildCommands:
+ - npm install
+ - npm build
+ cache:
+ - node_modules
+ ```
+ Modifying `prepareCommands` invalidates both layers, including cached `node_modules`.
+## Real-World Implementation Examples
+### Node.js Project with TypeScript
+```yaml
+build:
+ base: node@22
+ buildCommands:
+ - npm ci
+ - npm run build
+ cache:
+ - node_modules
+ - .next
+ - .turbo
+ - package-lock.json
+```
+### Go Project with Multiple Dependencies
+```yaml
+build:
+ base: go@1
+ prepareCommands:
+ - sudo apk add build-base
+ buildCommands:
+ - go mod download
+ - go build -o bin/app cmd/main.go
+ cache: true # Caches entire Go modules directory
+```
+### PHP/Laravel Project
+```yaml
+build:
+ base: php@8.3
+ buildCommands:
+ - composer install --no-dev
+ - php artisan optimize
+ cache:
+ - vendor
+ - composer.lock
+```
+## Debugging and Monitoring
+* **Build Logs**
+ - Cache operations are detailed in build logs
+ - File conflicts during restoration are logged
+ - Cache preservation status is visible
+## Implementation Best Practices
+### Cache Strategy Optimization
+1. **Layer Management**
+ - Maintain stable `prepareCommands` to prevent cache invalidation
+ - Group related prepare commands logically
+2. **Performance Optimization**:
+ - Cache package manager lock files alongside dependency directories
+ - Use system-wide caching (`cache: true`) for languages with global package managers
+3. **Performance Tuning**
+ - Leverage system-wide caching for complex builds
+ - Monitor build logs for cache operations and potential conflicts
+ - Use explicit patterns for precise control
+ - Don't over-optimize – the system handles large caches efficiently
+## Future Development
+Planned system enhancements include:
+- Layer independence implementation
+- Granular cache control mechanisms
+- Enhanced layer management capabilities
+- Improved cache invalidation patterns
+
+----------------------------------------
+
+# Features > Cdn
+
+Zerops CDN is a global content delivery network that brings your static content closer to your users, resulting in faster load times and improved user experience. Built on Nginx and Cloudflare geo-steering technology, our CDN automatically routes users to the nearest server location based on their DNS request.
+## Key Benefits
+- **Global Reach**: Serve content from strategic locations across the world
+- **Reduced Latency**: Content is delivered from the server closest to your users
+- **Simple Integration**: No complex configuration required
+## Global CDN Infrastructure
+Zerops CDN operates across **6 strategic regions** to ensure your content is always delivered from a location close to your users:
+
+ Region
+ Location
+ Coverage Area
+
+ EU
+ CZ
+ Prague, Czech Republic
+ Primary European coverage + failover for all regions
+
+ DE
+ Falkenstein, Germany
+
+ UK
+ London, United Kingdom
+ UK and surrounding areas
+
+ AU
+ Sydney, Australia
+ Australia and Oceania
+
+ SG
+ Singapore, Singapore
+ Southeast Asia
+
+ CA
+ Beauharnois, Canada
+ North America
+
+### Geo-Steering Technology
+Zerops CDN's geo-steering technology automatically routes users to the server location closest to them. Here's how it works:
+* **Automatic routing**: Users are directed to the optimal CDN node based on their geographic location
+* **Quick failover**: The DNS TTL is set to just 30 seconds, allowing fast recovery if a node fails
+* **Redundancy**: If any node becomes unavailable, Cloudflare automatically redirects traffic to the next closest node
+* **Reliable backup**: The EU region serves as the ultimate fallback - if all other nodes go down, EU will always be served in DNS
+## CDN Modes and Implementation
+Zerops CDN currently supports two distinct usage modes (with a third mode coming soon), each designed for specific content delivery needs.
+### Object Storage Mode
+Perfect for efficiently delivering media files, documents, and other static assets stored in Zerops [Object Storage](/object-storage/overview) to users across different geographical regions.
+**Setup process:**
+1. Create an Object Storage service or select an existing one
+2. Enable the CDN option for this service
+3. Set appropriate public read access policies for objects you want to serve via CDN
+**Accessing content:**
+```txt
+https://storage.cdn.zerops.app/your-bucket/path/to/file
+```
+:::tip
+Access the storage CDN URL via the `storageCdnUrl` **project** environment variable `${storageCdnUrl}/your-bucket/path/to/file`.
+:::
+### Static Mode
+Ideal for caching and delivering static website assets like HTML, CSS, JavaScript, and images served from your custom domains.
+**Setup process:**
+1. Configure domain access for your service
+2. Ensure your domains are DNS-verified and have active SSL certificates
+3. Enable CDN for the domain group
+**Accessing content:**
+```txt
+https://static.cdn.zerops.app/your-domain.com/path/to/file
+```
+:::tip
+Access the static CDN URL via the `staticCdnUrl` **project** environment variable `${staticCdnUrl}/your-domain.com/path/to/file`.
+:::
+:::warning Wildcard Domains Not Supported
+Static CDN cannot be activated for wildcard domains (e.g., *.example.com). You must use specific domain names.
+:::
+### API Mode *(Coming Soon)*
+Designed for caching API responses to reduce load on your backend services and deliver faster responses to clients.
+**Environment variable:** Once available, you'll be able to access the API CDN URL via the `apiCdnUrl` **project** environment variable.
+:::warning
+API Mode is currently under development and will be available in a future release.
+:::
+### HTML Implementation Examples
+Here's how to integrate CDN URLs in your HTML code:
+```html
+```
+### Testing Specific CDN Nodes
+For testing or debugging purposes, you can bypass the automatic geo-steering and access a specific CDN node directly:
+```
+https://{region}-{mode}.cdn.zerops.app/path/to/content
+```
+Available region prefixes: `cz`, `de`, `au`, `sg`, `uk`, and `ca`
+**Examples:**
+- Test Australia node: `https://au-storage.cdn.zerops.app/my-bucket/test.jpg`
+- Test UK node: `https://uk-static.cdn.zerops.app/my-domain.com/index.html`
+## Managing CDN Content
+### Cache Lifecycle
+Content served through Zerops CDN follows this lifecycle:
+1. **First Request**: When a user requests content not yet in the CDN cache, the request goes to the origin server (your Zerops service), and the response is cached at the CDN node
+2. **Subsequent Requests**: Further requests for the same content are served directly from the CDN cache, reducing latency and origin server load
+3. **Cache Expiration**: By default, content remains cached for 30 days unless explicitly purged
+4. **Automatic Management**: When CDN storage reaches capacity, the least recently used content is automatically removed
+:::note Important Cache Behavior
+Zerops CDN implements a fixed 30-day TTL policy. Currently, HTTP caching headers such as `Cache-Control`, `Expires`, `Pragma`, etc. do not influence CDN caching behavior. To refresh content sooner than the 30-day period, use the [purge API](#api-reference).
+Your `Cache-Control` headers will still affect browser caching behavior.
+:::
+### When to Purge Cache
+You should consider purging cached content when:
+- **Content Updates**: You've updated content but kept the same URL (e.g., updated images, CSS files)
+- **Deployment Rollouts**: You've deployed a new version of your application
+- **Emergency Removal**: You need to immediately remove content that was accidentally made public
+- **Testing Changes**: You want to ensure users see the latest version during testing
+### Purging Cached Content
+Zerops provides multiple ways to manage and purge cached content before its normal expiration:
+- **Command Line**: Use the `zsc cdn purge` [command](/references/zsc#cdn) available in all Zerops containers:
+ ```sh
+ # Purge all content for a domain
+ zsc cdn purge example.com
+ # Purge all content (wildcard)
+ zsc cdn purge example.com "/*"
+ # Purge specific file
+ zsc cdn purge example.com "/path/to/my-file$"
+ ```
+ :::important
+ - This command must be executed in any container within the project that has the CDN-enabled domain active
+ - Currently only works for [Static Mode](#static-mode) CDN
+ :::
+- **API Endpoints**: For programmatic control, use the [API endpoints](#api-reference). Here are ready-to-use curl examples for quickly purging content in your scripts:
+ ```sh
+ # Static mode: Purge all content for a domain
+ curl --location --request PUT "https://api.app-prg1.zerops.io/api/rest/public/project/$PROJECT_ID/purge-cdn/static/$DOMAIN/*" \
+ --header "Authorization: Bearer $USER_OR_ACCESS_TOKEN"
+ ```
+ ```sh
+ # Storage mode: Purge all content for object storage
+ curl --location --request PUT "https://api.app-prg1.zerops.io/api/rest/public/service-stack/$OBJECT_STORAGE_SERVICE_ID/purge-cdn/*" \
+ --header "Authorization: Bearer $USER_OR_ACCESS_TOKEN"
+ ```
+#### Purge Pattern Examples
+
+ Pattern
+ Description
+ Example
+
+ `/*`
+ Purges all content
+ Useful after major updates
+
+ `/images/*`
+ Purges all content in a directory
+ Clear all cached images
+
+ `/css/main.css$`
+ Purges a specific file
+ Update a single CSS file
+
+ `/2023*`
+ Purges content starting with pattern
+ Clear content with date prefix
+
+:::warning Pattern Rules
+- Wildcards (`*`) must be at the end of the pattern
+- Specific files must include `$` at the end
+- Nested wildcards (e.g., `/dir/*.jpg`) are not supported
+:::
+## API Reference
+Zerops provides a comprehensive set of API endpoints to manage your CDN configuration and content. For complete information about base URLs, authorization, and general API usage, please refer to our [API specification](/references/api).
+The endpoint links below will take you to the Swagger documentation with detailed request/response schemas and examples:
+### CDN Management API
+- **[Enable CDN for Storage ↗](https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicServiceStack/EnableStorageCdn)** `PUT /api/rest/public/service-stack/{id}/cdn`
+- **[Disable CDN for Storage ↗](https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicServiceStack/DisableStorageCdn)** `DELETE /api/rest/public/service-stack/{id}/cdn`
+- **[Create Object Storage with CDN ↗](https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicServiceStackObjectStorage/CreateObjectStorageV1)** `POST /api/rest/public/service-stack/object_storage_v1`
+- **[Create Domain Routing with CDN ↗](https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicPublicHttpRouting/CreatePublicHttpRouting)** `POST /api/public/public-http-routing`
+- **[Update Domain Routing with CDN ↗](https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicPublicHttpRouting/UpdatePublicHttpRouting)** `PUT /api/public/public-http-routing/{id}`
+### Cache Purge API
+- **[Purge Storage Mode Cache ↗](https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicServiceStack/PurgeStorageCdn)** `PUT /api/rest/public/service-stack/{id}/purge-cdn/{path}`
+- **[Purge Static Mode Cache ↗](https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicProject/PurgeStaticCdn)** `PUT /api/rest/public/project/{id}/purge-cdn/static/{domain}/{path}`
+- **Purge Api Mode Cache *(Coming soon)***
+## Troubleshooting
+Having issues with your CDN? Here are solutions to the most common problems:
+#### Content Not Updated After Changes
+* **Issue:** You've updated content, but users still see the old version.
+* **Possible Cause:** The CDN cache is continuing to serve the previously cached version.
+* **Solution:**
+ - Use the [purge API](#api-reference) with the specific content path
+ - For immediate changes, use versioned file names (e.g., `style.v2.css` instead of just `style.css`)
+#### Content Not Being Cached
+* **Issue:** Your content isn't being cached by the CDN.
+* **Possible Cause:** Missing public read permissions on objects.
+* **Solution:**
+ - For object storage: Check bucket and object access policies
+ - Verify the object is accessible directly before attempting CDN access
+:::note
+Remember that only publicly accessible objects will be cached by the CDN. Private objects will always be fetched directly from the origin.
+:::
+#### Environment Variables Not Available
+* **Issue:** You can't access the new CDN-related project level environment variables in your containers.
+* **Possible Cause:** When new environment variables are created, existing services need to be restarted to access them. Services created before the CDN feature release require special handling.
+* **Solution:**
+ - For services created after CDN release: Restart the service to apply the new environment variables
+ - For services created before CDN release: Add and then remove a dummy environment variable in the project settings adn restart the service
+#### Unexpected 404 Errors
+* **Issue:** Users receive 404 errors when accessing content via CDN.
+* **Possible Cause:** Incorrect CDN URL formatting or missing content at origin.
+* **Solution:**
+ - Double-check your [URL structure](#) (pay attention to domain names and paths)
+ - Verify content exists at the origin before attempting CDN access
+ - Test accessing the content directly from origin first
+**Correct URL patterns:**
+- Object Storage: `https://storage.cdn.zerops.app/your-bucket/path/to/file`
+- Static Mode: `https://static.cdn.zerops.app/your-domain.com/path/to/file`
+---
+*Need help implementing CDN in your project? Join our [Discord community](https://discord.gg/zeropsio) where our team and other Zerops users can assist you!*
+
+----------------------------------------
+
+# Features > Container Vs Vm
+
+Ever wondered why container technologies like Docker took over the development world so quickly? Let's break down the real differences between traditional VMs and containers - and why you might want to use one over the other.
+## Key Distinctions
+**Containers** are like lightweight packages that contain just your app and what it needs to run, sharing resources with your main system.
+**Virtual Machines** are like having a whole computer inside your computer. Complete with its own operating system, memory, and everything else.
+### Why Developers Love Containers
+#### They're Fast
+- Start up in seconds (not minutes)
+- Take up way less space
+- You can run many more of them on the same hardware
+#### They're Consistent
+- Works on your machine? Will work on everyone's machine
+- No more "but it works locally" problems
+- Same environment from development to production
+#### They're Simple
+- Easy to share with your team
+- Quick to update and modify
+- Less configuration headaches
+### When VMs Still Make Sense
+Sometimes you actually want a full computer-within-a-computer:
+- You need to run a completely different operating system
+- You're dealing with legacy applications that need specific system configurations
+- You require maximum isolation for security reasons
+### Real-World Comparison
+Think of it like this:
+- **Containers** are like apartments in a well-managed building (shared infrastructure, efficient, but with some limitations)
+- **VMs** are like having your own house (complete control, but with more overhead)
+## Containers and VMs in Zerops
+### Why Zerops Uses Both
+At Zerops, we use **containers** as our primary runtime environment - they're fast, efficient, and perfect for most modern development workflows. We've optimized our container infrastructure to handle nearly every type of application you might need to run.
+However, we also provide **VMs** when you need them, particularly for Docker-based workloads where the additional isolation is essential. Docker containers are a special case - on Zerops, they actually need to run inside VMs for proper security and isolation. While it's technically possible to run Docker in containers using privileged mode, this creates security vulnerabilities.
+### When to Use What
+
+ Go with Containers when:
+
+ Building modern web applications
+
+ Working with microservices
+
+ Need quick deployment and vertical scaling
+
+ Want efficient resource usage
+
+ Consider VMs when:
+
+ Running legacy applications
+
+ Need complete OS isolation
+
+ Require specific hardware access
+
+ Need to run Docker containers
+
+### Resource Allocation
+Both containers and VMs in Zerops can have guaranteed resources:
+- Specific CPU cores
+- Dedicated memory
+- Controlled disk space
+The difference isn't in resource guarantee capabilities, but rather in how these resources are managed and isolated.
+## The Bottom Line
+For most modern development work, containers are the way to go. They're faster, more efficient, and easier to work with. VMs still have their place, but unless you have a specific reason to use them, containers will usually make your life easier.
+*Remember: The goal is to spend less time managing infrastructure and more time building great applications. Choose the tool that lets you do that most effectively.*
+:::tip Pro Tip
+Not sure which to choose? Start with containers. You can always switch to VMs if you discover you need them for specific use cases.
+:::
+
+----------------------------------------
+
+# Features > Dns
+
+This guide will show you how to configure DNS records and proxy settings to work with your Zerops applications, with specific implementation details for Cloudflare.
+## DNS Configuration
+DNS records for Zerops services can be configured in two main ways:
+* **With Proxy**: Routes traffic through proxy services, providing additional security and performance features (recommended for DDoS protection)
+* **Without Proxy (DNS Only)**: Direct connection to your Zerops service's IP address
+DNS allows you to set two records based on IP address type:
+* **A** record for **IPv4** - Zerops offers either a free **shared** IPv4 or a paid **dedicated** IPv4
+* **AAAA** record for **IPv6** - Zerops provides a free **dedicated** IPv6
+### With Proxy
+#### IPv6 only
+```bash
+Type Name Content Proxy status TTL
+AAAA Proxied Auto
+```
+:::note
+Make sure your proxy service supports IPv4 to IPv6 translation for this configuration to work for **both IPv4 and IPv6** users.
+Do not add a proxied A record with shared IPv4 - doing so would prevent the proxy from properly routing IPv4 traffic to your service.
+:::
+#### Dedicated IPv4
+```bash
+Type Name Content Proxy status TTL
+A Proxied Auto
+# Optional
+AAAA Proxied Auto
+```
+:::tip
+Adding also AAAA record can be beneficial as visitors with IPv6 support will connect directly via IPv6.
+:::
+#### Shared IPv4 *(valid but NOT recommended)*
+```bash
+Type Name Content Proxy status TTL
+AAAA DNS only Auto
+A Proxied Auto
+```
+:::tip Why not?
+It does not make sense to expose your IPv6 address while proxying the shared IPv4. Use [IPv6 only](#ipv6-only) setup instead.
+:::
+### Without Proxy
+#### Shared IPv4
+```bash
+Type Name Content Proxy status TTL
+AAAA DNS only Auto
+A DNS only Auto
+```
+:::note Both A + AAAA Required
+Adding AAAA record is essential for shared IPv4 configuration as it serves as a [security measure](#understand-shared-ipv4) to prevent unauthorized domain claims.
+:::
+#### Dedicated IPv4
+```bash
+Type Name Content Proxy status TTL
+A DNS only Auto
+# Optional
+AAAA DNS only Auto
+```
+:::tip
+Adding also AAAA record can be beneficial as visitors with IPv6 support will connect directly via IPv6.
+:::
+#### IPv6 only
+```bash
+Type Name Content Proxy status TTL
+AAAA DNS only Auto
+```
+:::note
+This configuration will only work for users with IPv6 connectivity, which may limit your service accessibility.
+:::
+## Wildcard Domain Configuration
+Zerops supports wildcard domains (`*.`) that allow routing all subdomains to your project.
+### DNS Configuration
+#### Method A: Direct configuration of A and AAAA records
+Configure wildcard DNS records following the same patterns described in the [DNS Configuration](#dns-configuration) section, using `*.` in the Name field:
+```bash
+Type Name Content Proxy status TTL
+A *. DNS only/Proxied Auto
+AAAA *. DNS only/Proxied Auto
+```
+#### Method B: Using a CNAME record
+First configure A and AAAA records for your main domain (``), then set up a CNAME record:
+```bash
+Type Name Content Proxy status TTL
+CNAME *. DNS only/Proxied Auto
+```
+### Certificate Validation
+For proper HTTPS certificate functionality with wildcard domains, configure:
+```bash
+Type Name Content Proxy status TTL
+CNAME _acme-challenge. .zerops.zone DNS only Auto
+```
+This record enables Zerops to issue and verify a wildcard certificate for your domain.
+### Higher-Level Wildcard Subdomains
+You can also set up higher-level wildcard subdomains like `*..`:
+#### Method A: Direct configuration
+```bash
+Type Name Content Proxy status TTL
+A *.. DNS only/Proxied Auto
+AAAA *.. DNS only/Proxied Auto
+```
+#### Method B: Using a CNAME record
+```bash
+Type Name Content Proxy status TTL
+CNAME *.. . DNS only/Proxied Auto
+```
+or
+```bash
+Type Name Content Proxy status TTL
+CNAME *.. DNS only/Proxied Auto
+```
+For certificate validation:
+```bash
+Type Name Content Proxy status TTL
+CNAME _acme-challenge.. ..zerops.zone DNS only Auto
+```
+### Combining Main Domain and Wildcard Domain
+To use both `` and `*.`, specify both variants in your [Zerops configuration](/features/access#configuring-http-routing). Zerops automatically issues a single shared certificate for both the main domain and all its subdomains.
+## Cloudflare-Specific Configuration
+#### SSL/TLS Mode
+Set encryption mode to `Full (strict)` or `Full`
+ - Ensures end-to-end encryption
+ - *Full* mode requires any SSL certificate (even if self-signed/expired), while *Full (strict)* requires a valid certificate
+#### Certificate Management
+1. Enable Edge Certificates to allow Cloudflare to manage SSL/TLS certificates
+2. During initial setup, handle HTTPS settings in one of two ways:
+ - **Option A (Simple but Limited)**:
+ - Disable `Always Use HTTPS`
+ - **Option B (Recommended for Production)**:
+ - Keep `Always Use HTTPS` enabled
+ - Create and enable a Configuration Rule, which disables Automatic HTTPS Rewrites for this specific path:
+ ```
+ Field: URI Path
+ Operator: starts with
+ Value: /.well-known/acme-challenge/
+ ```
+ This rule disables Automatic HTTPS Rewrites for the certificate validation path.
+## Validation Steps
+Test your configuration:
+```bash
+# Check DNS resolution
+dig AAAA
+# Verify connectivity
+curl -vI https://
+# Test IPv4 access
+curl -4 -v https://
+# Test IPv6 access
+curl -6 -v https://
+```
+## Troubleshooting Guide
+1. **DNS Resolution Issues**
+ - Confirm correct record configuration
+ - Verify proxy status settings
+ - Check IPv6 address accuracy
+ - Allow time for DNS propagation (typically 5-10 minutes)
+2. **Connection Problems**
+ - Test both IPv4 and IPv6 connectivity
+ - Check proxy server status if applicable
+ - Confirm port configurations
+3. **Certificate Issues**
+ - Verify proper _acme-challenge CNAME configuration for wildcard domains
+ - Check that DNS records match the domains configured in Zerops
+ - **Cloudflare-specific certificate problems**:
+ - Verify `Always Use HTTPS` is disabled
+ - If you encounter **too many redirects** or similar SSL errors:
+ - Double-check that SSL/TLS encryption mode is set to *Full* or *Full (strict)*, not *Flexible*
+ - SSL mode might show incorrectly for newly added domains, try refreshing the page if settings appear incorrect
+## Technical Background
+### Understanding Shared IPv4 Addresses {#understand-shared-ipv4}
+Shared IPv4 allows multiple Zerops projects to use the same IPv4 address while maintaining separate routing for each project. Here's how it works:
+1. When a visitor makes a request, it first arrives at the shared IPv4 address
+2. The system looks at the domain name in the request (using SNI - Server Name Indication)
+3. For security, it checks if this domain properly resolves to your project's IPv6 address
+4. Only if IPv6 address matches your project will the traffic be routed correctly
+This is why configuring both A (IPv4) and AAAA (IPv6) records is crucial when using shared IPv4 addresses - the IPv6 record acts as a security key that helps prevent unauthorized use of the shared IPv4 address.
+### Certificate Verification Methods
+When issuing SSL/TLS certificates, different verification methods are used depending on the certificate type:
+#### HTTP-01 vs DNS-01 Verification
+- **Regular certificates** (for a single domain like ``) are typically issued using the **HTTP-01** challenge method. This verification checks that you control the domain by placing a specific file at a specific URL.
+- **Wildcard certificates** (for domains like `*.`) must be issued using the **DNS-01** challenge method. This method requires creating specific TXT records in your DNS configuration.
+### How Zerops Handles Wildcard Certificate Verification
+Zerops simplifies the DNS-01 challenge process:
+1. You create a CNAME record (e.g., `_acme-challenge. CNAME .zerops.zone`)
+2. When a certificate needs to be issued or renewed, Zerops automatically creates the required TXT records on its `zerops.zone` domain
+3. The certificate authority verifies these TXT records through the CNAME redirection
+4. Once verified, the wildcard certificate is issued without requiring manual intervention
+
+----------------------------------------
+
+# Features > Env Variables
+
+Zerops manages environment variables at two scopes: service level and project level. These variables are handled automatically without requiring `.env` files.
+## Service Variables
+Variables that are specific to individual [services](/features/infrastructure#services).
+### User-Defined Variables
+You can define service-level variables in two ways:
+#### 1. Build & Runtime Variables
+These variables are defined with `envVariables` attribute in the `build` or `run` section of your [zerops.yaml](/zerops-yaml/specification) file and are accessible within their respective containers.
+```yaml title="zerops.yaml"
+...
+ build:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: 127.0.0.1
+ DB_USER: db
+ DB_PASS: password
+ ...
+ run:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: 127.0.0.1
+ DB_USER: db
+ DB_PASS: password
+```
+See how to [reference variables](#referencing-variables) between services and between build and runtime environments.
+:::note
+Your application must be redeployed when updating environmental variables in `zerops.yaml`.
+:::
+#### 2. Secret Variables
+For storing sensitive data you don't want in your source repository. They can be updated without redeployment (though services need to be restarted).
+Secret variables can be managed through:
+##### GUI Interface
+Navigate to service details and find **Environment variables** in the menu. You can:
+- Add individual variables using the "Add secret variable" button
+- Edit individual variables through the menu that appears on hover
+- Use the bulk editor for managing multiple variables in .env format
+
+##### Import Configuration
+Create secret variables for a service with `envSecrets` attribute. See the complete [import.yaml structure](/reference/import).
+```yaml title="import.yaml"
+services:
+ ...
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'your-secret-s3-key'
+ S3_ACCESS_SECRET: 'your-s3-access-secret'
+```
+### System-Generated Variables
+Zerops automatically generates variables based on service type.
+These variables cannot be deleted and are always listed at the bottom of the environment variables page. Some are read-only (like `hostname`), while others can be edited (like `PATH`).
+These variables can also be [referenced](#referencing-variables).
+## Project Variables
+Variables that apply across all services within a [project](/features/infrastructure#projects). These provide a way to share common configuration across services.
+They work similarly to service secret variables but at project scope - they're managed through the GUI and can be updated without redeployment (though services need to be restarted).
+### User-Defined Variables
+You can set project-wide variables through:
+#### GUI Interface
+Access **Project environment variables** in your project detail to:
+- Add individual variables one by one
+- Edit individual variables
+- Use the bulk editor with .env format:
+#### Import Configuration
+Create project variables with `envVariables` attribute. See the complete [import.yaml structure](/reference/import).
+```yaml title="import.yaml"
+project:
+ ...
+ envVariables:
+ LOG_LEVEL: info
+ API_VERSION: v1
+```
+### System-Generated Variables
+Zerops automatically generates project-level variables containing that can be [referenced](#referencing-variables) from services.
+## Variable Restrictions
+All environment variables must follow these restrictions:
+### Key
+- Alphanumeric characters only (use `_` to separate words)
+- Must be unique within their scope
+- Case-sensitive
+### Value
+- ASCII characters only
+- No EOL characters
+## Variable Management
+### Variable Precedence
+When the same environment variable key exists in multiple places, Zerops follows these precedence rules:
+1. Service-level variables take precedence over project variables
+2. Within service-level:
+ - Build/runtime variables override secret variables
+ - Build and runtime containers are separate environments
+### Referencing Variables
+You can reference other variables using the `${variable_name}` syntax:
+#### Within Same Service
+```yaml
+envVariables:
+ id: 42069
+ hostname: app
+ name: ${id}-${hostname} # Results in: 42069-app
+```
+#### Across Services
+Prefix variables with their respective service name:
+```yaml
+setup: dbtest
+ run:
+ envVariables:
+ connectionString: 127.0.0.1
+setup: app
+ run:
+ envVariables:
+ dbConnection: ${dbtest_connectionString}
+```
+#### Between Build and Runtime Environments
+Build and runtime are two distinct environments in Zerops. Each environment can have its own set of variables, and you can use the same variable names in both environments since they are separate. Due to this separation, variables defined in one are not automatically accessible in the other.
+To share variables between environments, you need to use specific prefixes:
+- Use `RUNTIME_` prefix to access runtime variables during build
+- Use `BUILD_` prefix to access build variables during runtime
+Here's an example of `zerops.yaml` file showing how to reference a runtime variable during build:
+```yaml title="zerops.yaml"
+build:
+ envVariables:
+ API_KEY: ${RUNTIME_API_KEY} # Using runtime variable during build
+run:
+ envVariables:
+ API_KEY: "12345-abcde" # Referenced in build with RUNTIME_ prefix
+```
+#### Project Variables
+No prefix needed when referencing project variables:
+```yaml title="import.yaml"
+project:
+ ...
+ envVariables:
+ projectName: devel
+```
+```yaml title="zerops.yaml"
+envVariables:
+ id: 42069
+ hostname: app
+ name: ${projectName}-${hostname} # Results in: devel-app
+```
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Features > Infrastructure
+
+Zerops organizes your infrastructure into three hierarchical levels: **projects**, **services**, and **containers**.
+## Projects
+A project is the top-level entity in Zerops, functioning as a private network where services can communicate internally and share environment variables. Each project provides essential infrastructure including load balancing, routing, and container orchestration.
+:::tip
+Consider your project organization strategy carefully. You can create separate projects for different environments or consolidate multiple applications in a single project to optimize resource usage.
+:::
+### Key Project Features
+Projects provide several important capabilities:
+- **Private Networking**: All services within a project share a secure network
+- **Environment Variables**: Services can access shared environment variables
+- **IPv6/IPv4 Addressing**: Each project receives an IPv6 address, with optional IPv4 addressing
+### Project Core
+When you create a project, it requires a functioning **core** that includes:
+- Logger and statistics services
+- HTTP routing with automatic SSL certificate management
+- IP routing with integrated firewall
+Zerops offers two core types to match different needs and budgets:
+### Lightweight Core
+Our single-container solution that packs everything you need to get started quickly. Includes a project controller, L3 balancer, firewall, logger, statistics, and HTTP handling—all in one efficient package. Perfect for development projects and smaller production workloads where simplicity matters. Automatically handles SSL certificates and load balancing without complex setup.
+### Serious Core
+Enterprise-grade infrastructure designed for mission-critical applications. Separates core services across multiple containers for true redundancy and high availability. Includes redundant project controllers and balancers, dedicated statistics and logging services, and advanced HTTP management. Ideal when your production workloads demand maximum reliability and scalability without compromise.
+### Features Comparison
+Compare our core infrastructure options side-by-side to find the right fit for your project needs, from resource allocations to available features:
+
+ Lightweight Core
+ Serious Core
+
+ Infrastructure
+ Single container (limited redundancy)
+ Multi-container (highly available)
+
+ SSL Termination
+
+ Automatic Certificate Generation
+
+ Proxy / Load Balancer
+
+ IPv6 Address
+
+ Build Time
+ 15 hours
+ 150 hours
+
+ Backup Space
+ 5 GB
+ 25 GB
+
+ Egress
+ 100 GB
+ 3 TB
+
+ Failover Protection
+ Limited
+ Comprehensive
+
+For detailed pricing information on both core types, visit our [pricing page](/features/pricing#project-core-plans).
+## Services
+Services encapsulate your containers and provide specific functionality. A project can contain unlimited services, each with its own purpose.
+Services in Zerops can be:
+- **Fully managed**: Zerops handles scaling, routing, and repairs automatically
+- **Partially managed**: You maintain control over certain management aspects
+## Containers
+Containers are the most granular level of the Zerops architecture. Each service consists of one or more containers that work together to deliver functionality.
+In High Availability (HA) mode, a service may utilize multiple containers with different roles. For example, a fully managed MariaDB service might use 5 containers: 3 for the database and 2 for proxies.
+Containers in Zerops:
+- Use predefined images ranging from fully managed databases to customizable Ubuntu environments
+- Can be exposed to the public via Zerops subdomains, custom domains, or public ports (for applicable service types only)
+- Operate within the service's resource constraints
+
+----------------------------------------
+
+# Features > Pipeline
+
+export const languages = [
+ { name: "Node.js", link: "/nodejs/how-to/env-variables#how-to-read-env-variables-from-your-nodejs-app" },
+ { name: "PHP", link: "/php/how-to/env-variables#how-to-read-env-variables-from-your-php-app" },
+ { name: "Python", link: "/python/how-to/env-variables#how-to-read-env-variables-from-your-python-app" },
+ { name: "Go", link: "/go/how-to/env-variables#how-to-read-env-variables-from-your-go-app" },
+ { name: ".NET", link: "/dotnet/how-to/env-variables#how-to-read-env-variables-from-your-dotnet-app" },
+ { name: "Rust", link: "/rust/how-to/env-variables#how-to-read-env-variables-from-your-rust-app" }
+]
+export const builds = [
+ { name: "Node.js", link: "/nodejs/how-to/build-process##nodejs-build-hardware-resources" },
+ { name: "PHP", link: "/php/how-to/build-process#php-build-hardware-resources" },
+ { name: "Python", link: "/python/how-to/build-process#python-build-hardware-resources" },
+ { name: "Go", link: "/go/how-to/build-process#go-build-hardware-resources" },
+ { name: ".NET", link: "/dotnet/how-to/build-process#dotnet-build-hardware-resources" },
+ { name: "Rust", link: "/rust/how-to/build-process#rust-build-hardware-resources" },
+ { name: "Java", link: "/java/how-to/build-process#java-build-hardware-resources" },
+]
+export const customizeBuild = [
+ { name: "Node.js", link: "/nodejs/how-to/build-process#customize-nodejs-build-environment" },
+ { name: "PHP", link: "/php/how-to/build-process#customize-php-build-environment" },
+ { name: "Python", link: "/python/how-to/build-process#customize-python-build-environment" },
+ { name: "Go", link: "/go/how-to/build-process#customize-go-build-environment" },
+ { name: ".NET", link: "/dotnet/how-to/build-process#customize-net-build-environment" },
+ { name: "Rust", link: "/rust/how-to/build-process#customize-rust-build-environment" },
+ { name: "Java", link: "/java/how-to/build-process#customize-java-build-environment" },
+]
+export const customizeRuntime = [
+ { name: "Node.js", link: "/nodejs/how-to/customize-runtime" },
+ { name: "PHP", link: "/php/how-to/customize-runtime" },
+ { name: "Python", link: "/python/how-to/customize-runtime" },
+ { name: "Go", link: "/go/how-to/customize-runtime" },
+ { name: ".NET", link: "/dotnet/how-to/customize-runtime" },
+ { name: "Rust", link: "/rust/how-to/customize-runtime" },
+ { name: "Java", link: "/java/how-to/customize-runtime" },
+]
+## Configure the pipeline
+Zerops provides a customizable build and runtime environment for your application.
+Start by adding a [zerops.yaml](/zerops-yaml/specification) file to the **root of your repository** and modify it to fit your application.
+Here is a basic example for a Node.js application:
+```yaml
+zerops:
+ - setup: api
+ build:
+ base: nodejs@20
+ buildCommands:
+ - npm i
+ - npm run build
+ deployFiles: ./dist
+ cache: node_modules
+ run:
+ base: nodejs@20
+ start: npm start
+```
+The zerops.yaml in your repository tells Zerops how to build and deploy your application.
+Zerops will follow these instruction when the build & deploy pipeline is triggered for the Node.js service named `api`:
+1. Create a standard build environment with the Node.js v.20 preinstalled.
+2. Build your app using these commands: `npm i`, `npm run build`
+3. Create a standard runtime environment with the Node.js v.20 preinstalled.
+4. Deploy the built artefact from the `./dist` folder to the runtime container
+5. Cache the content of the `./node_modules` folder for the next build
+6. Start your application using the `npm start` command
+Learn more about all `zerops.yaml` parameters for your runtime:
+## Trigger the pipeline
+
+### Automatically
+Trigger the build & deploy pipeline automatically with each push to the selected branch or with a new tag. Create a new runtime service and connect it to your GitHub repository or GitLab repository.
+
+### Manually
+To start a new build & deploy pipeline manually, use the [Zerops CLI](/references/cli). zCLI is the Zerops command-line tool.
+The [zcli service push](/references/cli/commands#service-push) command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the build pipeline defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the `--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+If you just want to [deploy](#deploy-phase) your already built application to Zerops, use the zcli service deploy command instead.
+## Build phase
+
+Zerops starts a temporary build container and performs following actions:
+1. Installs the build environment.
+2. Downloads your application source code from [GitHub ↗](https://www.github.com), [GitLab ↗](https://www.gitlab.com) or via [Zerops CLI].
+3. Optionally customizes the build environment.
+4. Runs the build commands.
+5. Uploads the application artefact to the internal Zerops storage and prepares it for the deploy.
+6. Optionally [caches](/features/build-cache) the selected files for the next build.
+The build container is automatically deleted after the build has finished or failed.
+### Build hardware resources
+Each runtime service have different HW resources for build containers:
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+### Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops terminates the build pipeline and deletes the build container.
+### Customize the build environment
+Each runtime service in Zerops has a default build environment with a major version based on the [build.base](/zerops-yaml/specification#base-) attribute in `zerops.yaml`.
+To install additional packages or tools add one or more [build.prepareCommands](/zerops-yaml/specification#preparecommands-) commands to your `zerops.yaml`.
+Learn more about what is included in the default build environment:
+## Deploy phase
+
+### Application artefact
+When the [build phase](/dotnet/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](/dotnet/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/dotnet/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+### First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/go/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/go/how-to/build-pipeline#initcommands)
+4. Starts your application using the [start command](/go/how-to/build-pipeline#start)
+5. Optionally waits until the [readiness check](/go/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/go/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customize the runtime environment](/go/how-to/customize-runtime).
+:::
+### Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The PHP process inside each of the old containers is terminated and all old containers are gradually deleted.
+### Readiness checks
+If your application isn't ready to handle requests right after it is started via the [start command](/nodejs/how-to/build-pipeline#start), configure a [readiness check](/nodejs/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your Node.js service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/nodejs/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Customize the runtime environment
+Each runtime service in Zerops has a default runtime environment with a major version based on the [run.base](/zerops-yaml/specification#base--1) attribute in `zerops.yaml`.
+To install additional packages or tools add one or more [run.prepareCommands](/zerops-yaml/specification#preparecommands--1) commands to your `zerops.yaml`.
+Learn more about what is included in the default runtime environment:
+
+When the first deploy with a defined [prepareCommands](/zerops-yaml/specification#preparecommands--1) attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container]
+3. run the [run.prepareCommands](/zerops-yaml/specification#preparecommands--1) commands in the defined order
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](/zerops-yaml/specification#addtorunprepare-) and [run.prepareCommands](/zerops-yaml/specification#preparecommands--1) attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+## Manual deploy using Zerops CLI
+
+To start only a deploy pipeline, use the [Zerops CLI](/references/cli). zCLI is the Zerops command-line tool.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatically) or [manual](#manually) build process.
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+## Manage build and deploys
+### Cancel running build
+When you know that the running build is not correct and you want to cancel it, you can do it in Zerops GUI. Go to the service detail, open the list of running processes and click on the **Open pipeline detail** button. Then click on the **Cancel build** button.
+
+:::caution
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+:::
+### Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+### Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Features > Scaling Ha
+
+## What is automatic scaling?
+Zerops scales your application or a database based on the current load. If your application isn't used so often the auto scaling reduces the amount of required hardware resources and thus reduces the costs. If your application is used more, then auto scaling increases the resources for the application to make sure it runs smoothly even with the higher demand.
+On Zerops, you never pay for resources you don't need. At the same time you don't have to worry about traffic peaks or fast growth as the auto scaling feature handles this with no trouble. By default Zerops scales the applications and databases based on the best practices but you are always in control. Set the ranges for the auto scaling and fine-tune the settings so it fits the exact project and environment needs.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+## Auto scaling configuration for runtimes
+Both minimum and maximum limits for auto scaling are under your control. Technical minimums for CPU cores, RAM and Disk are preset for each runtime service. Configure the minimums and maximums CPU cores, RAM and Disk depending on the needs of your application and Zerops will scale them within defined limits.
+You can change the settings any time, Zerops will update the number of containers and their allocated resources accordingly.
+## Shared vs. dedicated CPU
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is dependent on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+Your application gets exclusive access to the full physical CPU core. This means the entire processing power is guaranteed and reserved only for your application, ensuring consistent and predictable performance without any resource contention from other applications. This mode is ideal for production environments and CPU-intensive workloads where performance stability is critical.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#shared-vs-dedicated-cpu) to dedicated to allocate the stable CPU power to your application.
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Auto scaling configuration for databases
+Vertical auto scaling configuration for databases is identical to runtime services. Technical minimums for CPU cores, RAM and Disk are preset according to the database type and version.
+You can choose 2 modes for each database: **Single Container** or **Highly Available** mode. The mode cannot be changed after the database is created.
+### Database in the Single Container mode
+In the **Single Container** mode the database is deployed in a single container. The number of containers cannot be increased. This mode is useful for non-essential data or dev environments.
+Your data is stored only in a single container. If the container or the underlying physical machine fails, your data since the last backup will be lost. Zerops is not able to provide any automatic repair of single container mode databases.
+### Database in the Highly Available mode
+If the **Highly Available** mode is chosen, Zerops will deploy the database cluster with a fixed number of containers and control mechanisms for automatic cluster repair.
+The KeyDB (Redis) cluster consists of 2 containers in the master-master replica. MariaDB and PostgreSQL databases are deployed in 3 containers connected in the High Availability cluster with 2 additional load balancers which ensures high reliability.
+You are not charged for the resources consumed by load balancers.
+This mode is highly recommended for production use.
+### Prevent the data loss by using the HA mode
+Zerops always keeps the database containers on different physical machines. All your data is stored redundantly in 3 identical copies (2 in case of Redis). In case of a failure of a container or the underlying physical machine, Zerops automatically disconnects the failed container from the cluster, creates a new container and syncs all data from the remaining copies. Finally the broken container is automatically deleted.
+## Auto scaling configuration for shared storage
+Vertical auto scaling configuration for shared storage is identical to database. Technical minimums for CPU cores, RAM and Disk are preset.
+You can choose 2 modes for a shared storage service: Single Container or Highly Available mode. The mode cannot be changed after the shared storage is created.
+### Single Container mode shared storage
+In the **Single Container** mode the shared storage is deployed in a single container. The number of containers cannot be increased. This mode is useful for non-essential data or dev environments.
+Your data is stored only in a single container. If the container or the underlying physical machine fails, your data since the last backup will be lost. Zerops is not able to provide any automatic repair of single container mode shared storages.
+### Highly Available mode shared storage
+If the **Highly Available** mode is chosen, Zerops will deploy the shared storage cluster with 3 containers and control mechanisms for automatic cluster repair.
+This mode is highly recommended for production use.
+### Prevent the data loss by using the HA mode
+Zerops always keeps the shared storage containers on different physical machines. All your data is stored redundantly in 3 identical copies. In case of a failure of a container or the underlying physical machine, Zerops automatically disconnects the failed container from the cluster, creates a new container and syncs all data from the remaining copies. Finally the broken container is automatically deleted.
+
+----------------------------------------
+
+# Frameworks > Laravel
+
+# Laravel on Zerops
+> Modern Laravel development demands infrastructure that doesn't get in your way. Zerops provides the foundation that lets you focus on building great apps, not wrestling with environment configuration or resource management.
+## Why Zerops for Laravel?
+Zerops implements what we call "transparent infrastructure" - you get enterprise-grade capabilities with development-friendly ergonomics. This means:
+- **Full system access** across all environments
+- **Granular resource control** starting at 0.125GB RAM
+- **True environment parity** from local to production
+- **Zero-downtime deployments** by default
+*No artificial limitations, no framework-specific compromises - just solid infrastructure that lets Laravel do what it does best.*
+:::tip
+New Zerops accounts receive $15 in free credits for testing. After verifying your account with a $10 initial payment, you'll get an additional $50 in credits.
+:::
+## Quick Start
+Choose a recipe that matches your needs and deploy with a single click. Each recipe sets up a complete environment with all necessary services preconfigured.
+All recipes include:
+- **PHP 8.3 + Nginx**
+- **PostgreSQL 16**
+- **L3/L7 balancers**
+- **Logging & metrics**
+
+ The most bare-bones examples of Laravel app including core services + PostgreSQL.
+
+ A full-stack setup including Redis, Object Storage, and Mailpit.
+
+ Admin panel optimized setup including Redis, Object Storage, and Mailpit.
+
+ Content management focused setup including Redis, Object Storage, and Mailpit.
+
+## Core Features
+### Infrastructure and Security
+Each project runs in its own isolated network with enterprise-level security features automatically configured.
+What makes this special is how it combines security with simplicity - this infrastructure requires zero configuration from you – it's all handled automatically when you create your project.
+### Native Service Discovery
+Services within your project communicate seamlessly using internal hostnames:
+```php title=".env"
+DB_HOST=${db_hostname}
+REDIS_HOST=${cache_hostname}
+```
+*Environment variables are automatically injected and synchronized across all containers.*
+### Intelligent Scaling
+One of Zerops' most powerful features is its intelligent autoscaling system, which:
+* Scales resources (CPU, RAM, Disk) up and down based on actual usage
+* Maintains minimum required resources to optimize costs
+* Handles both vertical and horizontal scaling automatically
+* Manages disk space dynamically (a unique feature in the industry)
+Through a simple configuration, you define resource boundaries while Zerops automatically handles the complex scaling decisions:
+```yaml
+# Example scaling configuration
+services:
+ - hostname: app
+ minContainers: 2
+ maxContainers: 6
+ cpu:
+ min: 1
+ max: 4
+ ram:
+ min: 0.25
+ max: 4
+```
+### Zero-Downtime Deployments
+Deploy with confidence using our battle-tested pipeline:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ base: php@8.3
+ buildCommands:
+ - composer install --no-dev --optimize-autoloader
+ deployFiles: ./
+ cache: vendor
+ run:
+ base: php-nginx@8.3
+ initCommands:
+ - php artisan config:cache
+ - php artisan route:cache
+ - php artisan migrate --force --isolated
+```
+### High Availability
+Every service can run in HA mode with automatic failover.
+```yaml
+services:
+ - hostname: db
+ type: postgresql@16
+ mode: HA # Automatic primary-replica setup
+ - hostname: cache
+ type: valkey@7.2
+ mode: HA # Redis cluster configuration
+```
+Setting up a production-grade HA database cluster typically requires deep DevOps expertise. Zerops automates this complexity, giving you an enterprise-grade setup with a single configuration flag:
+* **Database Cluster** distributed across multiple physical servers
+* **Automatic failover** and data replication
+* **Enhanced performance** through load distribution
+* **Production-grade reliability** out of the box
+## Development Workflow
+### Team Collaboration
+Zerops enables seamless team development through:
+* **Declarative Infrastructure** - version control your entire setup
+* **Identical Environments** - every team member gets production-parity
+* **Automated Setup** - new team members are productive in minutes
+* **Transparent Configuration** - easily review and audit changes
+### Local Development
+Connect to your production-grade databases without any local setup through Zerops' VPN.
+Start with
+```
+zcli vpn up
+```
+and select your project. Get your database credentials from the service's **Access details** in your project dashboard and update your local `.env`. See PostgreSQL example below:
+```yaml
+DB_CONNECTION=pgsql
+DB_HOST=db.zerops # References the service's hostname
+DB_PORT=5432
+DB_DATABASE=db
+DB_USERNAME=db
+DB_PASSWORD=[password from Access details]
+```
+With this configuration, you can use any database tool - no local installation needed.
+### Deployment Options
+Choose the workflow that fits your team:
+1. **GitHub/GitLab Integration**
+ - Automatic deployments on push/merge
+ - Branch-specific environments
+ - Build caching and artifacts
+2. **CLI-Driven Pipeline**
+ ```bash
+ # Deploy from your terminal
+ zcli push
+ ```
+3. **Manual Triggers**
+ - Deploy specific versions
+ - Roll back to previous states
+ - Test deployment configurations
+## Next Steps
+- [Environment Variables](/frameworks/laravel/env-variables)
+- [Database Migrations](/frameworks/laravel/migrations)
+- [Cache & Queue with Redis](/frameworks/laravel/redis)
+- [Schedule Jobs & CRON](//frameworks/laravel/cron)
+- [SMTP Configuration](/frameworks/laravel/smtp)
+- [Logs](/frameworks/laravel/logs)
+## Resources
+- [Laravel Documentation](https://laravel.com/docs)
+- [Laravel Recipe Repository](https://github.com/zeropsio/recipe-laravel-minimal)
+- [zCLI Documentation](/references/cli)
+*Need help? Join our [Discord community](https://discord.gg/zeropsio) or check out our [quickstart guide](/frameworks/laravel/introduction).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Cron
+
+Zerops provides a convenient way for managing scheduled tasks through CRON jobs, configured directly in your `zerops.yaml` file. These tasks can be scheduled to run on single or multiple containers with granular timing control.
+## Basic Configuration
+Cron jobs are defined in the `run.crontab` section of your `zerops.yaml`. Each job requires two essential parameters:
+- **command**: The command to execute
+- **timing**: The CRON schedule expression
+```yaml
+run:
+ crontab:
+ - command: "date >> /var/log/cron.log"
+ timing: "0 * * * *"
+```
+This example logs the current timestamp every hour.
+:::tip Detailed Configuration
+For comprehensive configuration options and examples, refer to our [CRON configuration guide](/zerops-yaml/cron).
+:::
+## Common Implementation Patterns
+### Laravel Scheduler
+To run Laravel's scheduler, configure it to execute every minute:
+```yaml
+run:
+ crontab:
+ - command: "php artisan schedule:run"
+ timing: "* * * * *"
+ workingDir: /var/www/html
+```
+### Cleanup Tasks
+Execute maintenance tasks on all containers:
+```yaml
+run:
+ crontab:
+ - command: "rm -rf /tmp/*"
+ timing: "0 0 * * *"
+ allContainers: true
+```
+### Multiple Jobs
+Configure multiple scheduled tasks within a single service:
+```yaml
+run:
+ crontab:
+ - command: "php artisan schedule:run"
+ timing: "* * * * *"
+ workingDir: /var/www/html
+
+ - command: "php artisan cache:clear"
+ timing: "0 0 * * *"
+ workingDir: /var/www/html
+
+ - command: "php artisan queue:restart"
+ timing: "0 */6 * * *"
+ workingDir: /var/www/html
+```
+## Best Practices
+1. **Log Output**: Implement comprehensive logging for debugging and monitoring:
+ ```yaml
+ command: "php artisan schedule:run >> /var/log/scheduler.log 2>&1"
+ ```
+2. **Working Directory**: Always specify `workingDir` for Laravel commands to ensure they are executed from the correct location.
+3. **Container Selection**: Use `allContainers: true` carefully to avoid duplicate operations in a multi-container setup.
+4. **Timing Considerations**: Schedule intensive tasks during off-peak hours.
+## Monitoring
+Enable detailed scheduler [logging](/frameworks/laravel/logs) in your `.env`:
+```
+LOG_CHANNEL=daily
+```
+
+----------------------------------------
+
+# Frameworks > Laravel > Env Variables
+
+Zerops manages environment variables without requiring manual `.env` files, enabling application deployment across different environments (development, staging, production) while keeping environment-specific configurations isolated from your code.
+Read more about how [environment variables](/features/env-variables) work in Zerops.
+## Laravel Environment Variables in Zerops
+### Secret Variables
+Some Laravel variables contain sensitive information that should never be exposed as plain text. Manage these using Zerops Secret Variables by:
+* Creating and managing them through the Zerops GUI
+* Defining them in a configuration file when importing a project or service (allows [automatic generation](#automatic-generation-during-import))
+When importing a project or service, you can define secret variables directly in your import configuration:
+```yaml
+services:
+ - hostname: app
+ type: php-nginx@8.4
+ envSecrets:
+ APP_KEY: your-secret-key
+```
+:::tip
+Secret variables can be updated at any time without requiring application redeployment.
+:::
+#### Automatic Generation During Import
+If you prefer to have certain secrets **generated automatically**, you can use the [yaml preprocessor](/references/import-yaml/pre-processor). This is optional and only available during import:
+```yaml
+#yamlPreprocessor=on
+services:
+ - hostname: app
+ type: php-nginx@8.4
+ envSecrets:
+ APP_KEY: )>
+```
+### Runtime Variables
+These variables, defined in `zerops.yaml`, are typically environment-specific but not sensitive.
+:::note
+Changes to runtime variables require application redeployment to take effect.
+:::
+Below is a complete working example of `envVariables` in `zerops.yaml` (sourced from [Laravel Jetstream recipe](https://github.com/zeropsio/recipe-laravel-jetstream/blob/main/zerops.yaml)):
+```yaml title="zerops.yaml"
+run:
+ envVariables:
+ APP_LOCALE: en
+ APP_FAKER_LOCALE: en_US
+ APP_FALLBACK_LOCALE: en
+ APP_MAINTENANCE_DRIVER: file
+ APP_MAINTENANCE_STORE: database
+ APP_TIMEZONE: UTC
+ APP_URL: ${zeropsSubdomain} # References generated variable
+ ASSET_URL: ${APP_URL}
+ VITE_APP_NAME: ${APP_NAME}
+ # PostgreSQL connection settings
+ DB_CONNECTION: pgsql
+ DB_DATABASE: db
+ DB_HOST: db # References database service hostname
+ DB_PASSWORD: ${db_password} # References database password
+ DB_PORT: 5432
+ DB_USERNAME: ${db_user} # References database user
+ # S3-compatible object storage settings
+ AWS_ACCESS_KEY_ID: ${storage_accessKeyId}
+ AWS_REGION: us-east-1
+ AWS_BUCKET: ${storage_bucketName} # References bucket name of service 'storage'
+ AWS_ENDPOINT: ${storage_apiUrl}
+ AWS_SECRET_ACCESS_KEY: ${storage_secretAccessKey} # Safely references secret
+ AWS_URL: ${storage_apiUrl}/${storage_bucketName}
+ AWS_USE_PATH_STYLE_ENDPOINT: true
+ FILESYSTEM_DISK: s3
+ # Logging Configuration
+ LOG_CHANNEL: syslog
+ LOG_LEVEL: debug
+ LOG_STACK: single
+ # SMTP settings for email delivery
+ MAIL_FROM_ADDRESS: hello@example.com
+ MAIL_FROM_NAME: ZeropsLaravel
+ MAIL_HOST: mailpit # References mail service hostname
+ MAIL_MAILER: smtp
+ MAIL_PORT: 1025
+ # Redis-based caching and session management
+ BROADCAST_CONNECTION: redis
+ CACHE_PREFIX: cache
+ CACHE_STORE: redis
+ QUEUE_CONNECTION: redis
+ REDIS_CLIENT: phpredis
+ REDIS_HOST: valkey # References Redis service hostname
+ REDIS_PORT: 6379
+ SESSION_DRIVER: redis
+ SESSION_ENCRYPT: false
+ SESSION_LIFETIME: 120
+ SESSION_PATH: /
+ # Security Configuration
+ BCRYPT_ROUNDS: 12
+ TRUSTED_PROXIES: "*"
+```
+Let's look at variable configurations that may need additional context and where to find detailed implementation guides:
+#### Application Configuration
+Core application settings that define your Laravel app's identity, URL structure, and environment parameters. Reference environment variables from the same service.
+```yaml
+APP_URL: ${zeropsSubdomain} # zeropsSubdomain variable is system generated
+ASSET_URL: ${APP_URL}
+VITE_APP_NAME: ${APP_NAME} # APP_NAME variable was created during import (envSecrets)
+```
+#### Database Configuration
+Essential database connection parameters that securely reference your PostgreSQL service `db` by hostname and its variables - `password` and `user`.
+It is safe to store `DB_PASSWORD` in `envVariables` by reference as it does not contain the sensitive value itself.
+```yaml
+DB_HOST: db
+DB_PASSWORD: ${db_password}
+DB_USERNAME: ${db_user}
+```
+Read more about [database management](/frameworks/laravel/migrations) for Laravel in Zerops.
+#### Storage Configuration
+S3-compatible object storage settings that enable efficient file handling and asset management in your Laravel application. Reference variables of Object storage service called `storage`.
+```yaml
+AWS_ACCESS_KEY_ID: ${storage_accessKeyId}
+AWS_REGION: us-east-1
+AWS_BUCKET: ${storage_bucketName}
+AWS_ENDPOINT: ${storage_apiUrl}
+AWS_SECRET_ACCESS_KEY: ${storage_secretAccessKey}
+AWS_URL: ${storage_apiUrl}/${storage_bucketName}
+AWS_USE_PATH_STYLE_ENDPOINT: true
+FILESYSTEM_DISK: s3
+```
+Read more about [object storage](/object-storage/overview) in Zerops.
+#### Logging Configuration
+System monitoring and debugging configuration that determines how your application tracks events and errors. Use `syslog` channel to access logs from Zerops Dashboard.
+```
+LOG_CHANNEL: syslog
+```
+Learn how to properly [configure logging](/frameworks/laravel/logs) for Laravel in Zerops.
+#### Mail Configuration
+SMTP server settings that enable your application to send emails through a dedicated mail service. Reference service `mailpit` by hostname.
+```
+MAIL_HOST: mailpit
+```
+Learn how to properly [configure SMTP](/frameworks/laravel/smtp) for Laravel in Zerops.
+#### Cache and Session
+Redis-based configuration for handling application caching, queues, and session management to optimize performance. Reference service `valkey` by hostname.
+```
+REDIS_HOST: valkey
+```
+Learn how to properly [configure cache, queue & session management](/frameworks/laravel/redis) for Laravel in Zerops.
+:::tip
+For automatic execution with each deploy, add these commands to the `initCommands` section of your `zerops.yaml` file.
+```yaml title="zerops.yaml"
+initCommands:
+ - php artisan view:cache
+ - php artisan config:cache
+ - php artisan route:cache
+```
+:::
+
+----------------------------------------
+
+# Frameworks > Laravel > Faq
+
+ Question: How do I configure environment variables?
+Answer:
+ You can set environment variables through the Zerops dashboard or in your `zerops.yaml` file under the `run.envVariables` section:
+ ```yaml
+ zerops:
+ - setup: app
+ run:
+ envVariables:
+ APP_KEY: "base64:your-key-here"
+ DB_CONNECTION: "pgsql"
+ DB_HOST: ${db_host}
+ ```
+
+ Question: How do I run database migrations?
+Answer:
+ You can run migrations during initialization by adding the command to your `zerops.yaml`:
+ ```yaml
+ zerops:
+ - setup: app
+ run:
+ initCommands:
+ - php artisan migrate --isolated --force
+ ```
+
+ Question: Can I use Laravel queue with Zerops?
+Answer:
+ Yes, Laravel Queue is fully supported. Configure Redis as your queue driver:
+ ```yaml
+ zerops:
+ - setup: app
+ run:
+ envVariables:
+ QUEUE_CONNECTION: redis
+ REDIS_HOST: redis
+ REDIS_PORT: 6379
+ ```
+
+ Question: How do I handle file storage?
+Answer:
+ Zerops supports S3-compatible storage. Configure it using these environment variables:
+ ```yaml
+ zerops:
+ - setup: app
+ run:
+ envVariables:
+ FILESYSTEM_DISK: s3
+ AWS_ACCESS_KEY_ID: ${storage_accessKeyId}
+ AWS_SECRET_ACCESS_KEY: ${storage_secretAccessKey}
+ AWS_BUCKET: ${storage_bucketName}
+ AWS_ENDPOINT: ${storage_apiUrl}
+ AWS_URL: ${storage_apiUrl}/${storage_bucketName}
+ AWS_USE_PATH_STYLE_ENDPOINT: true
+ ```
+
+ Question: How do I enable HTTPS?
+Answer:
+ HTTPS is automatically enabled when you use either a Zerops subdomain or configure your custom domain. No additional configuration is required.
+
+ Question: Can I run scheduled tasks?
+Answer:
+ Yes, you can configure cron jobs in your `zerops.yaml`:
+ ```yaml
+ zerops:
+ - setup: app
+ run:
+ crontab:
+ - command: "php artisan schedule:run"
+ timing: "* * * * *"
+ workingDir: /var/www/html
+ ```
+
+ Question: How do I configure Redis for caching?
+Answer:
+ Configure Redis for caching, sessions, and queues:
+ ```yaml
+ zerops:
+ - setup: app
+ run:
+ envVariables:
+ CACHE_STORE: redis
+ SESSION_DRIVER: redis
+ REDIS_HOST: redis
+ REDIS_PORT: 6379
+ REDIS_CLIENT: phpredis
+ ```
+
+ Question: How do I optimize my Laravel application?
+Answer:
+ Add these optimization commands to your initialization:
+ ```yaml
+ zerops:
+ - setup: app
+ run:
+ initCommands:
+ - php artisan view:cache
+ - php artisan config:cache
+ - php artisan route:cache
+ - php artisan optimize
+ ```
+
+ Question: How do I handle asset compilation?
+Answer:
+ Configure asset compilation in your build phase:
+ ```yaml
+ zerops:
+ - setup: app
+ build:
+ base:
+ - php@8.4
+ - nodejs@18
+ buildCommands:
+ - composer install --optimize-autoloader --no-dev
+ - npm install
+ - npm run build
+ cache:
+ - vendor
+ - node_modules
+ ```
+
+ Question: How do I implement health checks?
+Answer:
+ Add health checks to ensure your application is running properly:
+ ```yaml
+ zerops:
+ - setup: app
+ deploy:
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /up
+ run:
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /up
+ ```
+
+
+----------------------------------------
+
+# Frameworks > Laravel > Introduction
+
+ Deploy the same Laravel setup as in this tutorial with a single click. All you need is a Zerops account.
+
+## Introduction
+In this tutorial, you'll learn how to deploy a Laravel application on Zerops. We'll configure a complete environment using Apache as the web server and PostgreSQL as the database.
+By the end of this tutorial, you will:
+- Have a fresh Laravel installation running locally
+- Set up a Zerops project with Apache and PostgreSQL
+- Configure zero-downtime deployment with environment variables
+- Deploy a production-ready Laravel application with Zerops subdomain access
+- Set up secure VPN access to your PostgreSQL database
+## Prerequisites
+This tutorial assumes you have:
+* PHP, Composer, git installed locally
+* [Zerops account](https://app.zerops.io/signup)
+* [zcli](/references/cli) tool installed
+:::note
+You don't need to install PostgreSQL locally - Zerops VPN lets you connect directly to the remote database for development.
+:::
+## Step 1 — Creating a New Laravel Project
+Let's start by creating a fresh Laravel project:
+```bash
+composer create-project laravel/laravel zerops-laravel
+cd zerops-laravel
+```
+Let's verify everything works locally. Start Laravel's development server:
+```bash
+php artisan serve
+```
+Visit http://localhost:8000 in your browser. You should see Laravel's welcome page.
+:::tip
+While we're using Laravel's built-in server for simplicity, you can use any local development setup you prefer (Valet, Sail, XAMPP, etc.).
+:::
+If you see the welcome page, great! Your local setup is working correctly.
+## Step 2 — Setting Up Your Zerops Project
+### Log in to zcli
+[Log in](/references/cli#personal-access-tokens) to zcli with your **Personal access token**.
+### Create Project Configuration
+When you create a project in Zerops, you get a production-grade infrastructure with automated security, load balancing, and SSL management. Each project runs in its own isolated network where services communicate securely using simple hostnames, all accessible through VPN for seamless local development.
+Learn more about infrastructure features in documentation section [Project & Services Structure](/features/infrastructure).
+#### Project Configuration File
+The project configuration defines your infrastructure using YAML. This approach provides clear, reproducible configuration that can be version controlled. Later in this tutorial, we'll also show how to achieve the same using the GUI.
+Create a new file in your project root called `zerops-project-import.yaml` with the following content:
+```yaml title="zerops-project-import.yaml"
+#yamlPreprocessor=on
+project:
+ name: laravel-zerops
+ tags:
+ - zerops-tutorial # tag for easy filtering (optional)
+services:
+ - hostname: app
+ type: php-apache@8.4
+ envSecrets:
+ # yamlPreprocessor feat: generates a random 32 char and stores it
+ APP_KEY: )>
+ - hostname: db
+ type: postgresql@16
+ mode: HA # High Availability mode for robust production setup
+```
+:::tip Generate secrets
+The `#yamlPreprocessor=on` directive enables Zerops' [YAML preprocessing](/references/import-yaml/pre-processor) for this import file, allowing us to use dynamic values and built-in functions like `generateRandomString`.
+:::
+#### Automatic Resource Management
+Zerops features intelligent autoscaling that manages all resources (CPU, RAM, Disk) based on actual usage, automatically scaling up and down to optimize costs while maintaining performance.
+In this guide, we'll use default scaling ranges and that's why you won't find resource configurations in the import file. See current ranges for [horizontal](/php/how-to/scaling#horizontal-auto-scaling) and [vertical](/php/how-to/scaling#vertical-auto-scaling) scaling of PHP services.
+#### High-Availability Database
+In this guide, [enabling HA mode](/postgresql/how-to/scale#horizontal-scaling) creates a database cluster across three physical servers, with all the complexity managed automatically by Zerops.
+Through Zerops VPN, you can securely access this database setup directly from your local machine, ensuring your development environment matches production exactly.
+#### Import the Project
+Now create the project by running:
+```bash
+zcli project project-import zerops-project-import.yaml
+```
+### Alternative: Creating Project via GUI
+You can also create and configure your project through the Zerops dashboard:
+1. Log into your [Zerops Dashboard](https://app.zerops.io)
+2. Click **Add new project**
+3. Set a project name (e.g., "laravel-zerops") and click **Create project**
+Then add the required services:
+1. **PHP + Apache Service:**
+ - Click **Add Service** and select **PHP+Apache**
+ - Set hostname to "app"
+ - Keep all other settings as default
+2. **PostgreSQL Service:**
+ - Click **Add Service** and select **PostgreSQL**
+ - Set hostname to "db"
+ - Keep all other settings as default
+## Step 3 — Configuring Your Application
+The [deployment configuration](/zerops-yaml/specification) controls how your application builds and runs. Create a `zerops.yaml` file in your project root:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ base:
+ - php@8.4
+ buildCommands:
+ - composer install --ignore-platform-reqs
+ deployFiles: ./
+ cache:
+ - vendor
+ - composer.lock
+ deploy:
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /up
+ run:
+ base: php-apache@8.4
+ envVariables:
+ APP_NAME: "Laravel Zerops Demo"
+ APP_DEBUG: false
+ APP_ENV: production
+ APP_URL: ${zeropsSubdomain}
+ DB_CONNECTION: pgsql
+ DB_HOST: db
+ DB_PORT: 5432
+ DB_DATABASE: db
+ DB_USERNAME: ${db_user}
+ DB_PASSWORD: ${db_password}
+ LOG_CHANNEL: stack
+ LOG_LEVEL: debug
+ SESSION_DRIVER: database
+ initCommands:
+ - php artisan config:cache
+ - php artisan route:cache
+ - php artisan migrate --force --isolated
+ - php artisan optimize
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /up
+```
+Let's break down some important parts of this configuration:
+### Environment Variables
+Zerops automatically generates and securely manages various environment variables. For example, `zeropsSubdomain` provides your application's URL, while database credentials `user` and `password` are variables of the `db` service. It is possible to reference any variable or a service by hostname within your project's private network.
+```yaml
+APP_URL: ${zeropsSubdomain} # Automatically set to your app's Zerops URL
+DB_USERNAME: ${db_user} # Database credentials auto-injected
+DB_PASSWORD: ${db_password} # Securely managed by Zerops
+```
+Learn more about [environment variables](/frameworks/laravel/env-variables) for Laravel.
+### Safe Database Migrations
+```yaml
+php artisan migrate --force --isolated
+```
+The `--isolated` flag prevents multiple servers from running migrations simultaneously by using a cache lock, ensuring safe database updates during deployment.
+### Health Checks
+The health check configuration ensures your application is running correctly:
+```yaml
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /up
+ ...
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /up
+```
+By default, latest version of Laravel responds with a 200 OK status on the `/up` endpoint, so no additional configuration is needed.
+## Step 4 — Deploying Your Application
+Now comes the exciting part - deploying your application to Zerops!
+### Deploying Your Code
+Initialize git in your project directory:
+```bash
+git init
+```
+:::note
+Git is required to track changes for deployment. You don't need to commit, but initializing git helps Zerops manage the deployment files.
+:::
+Push your code to Zerops, select your project and service when prompted:
+```bash
+zcli push
+```
+### Monitoring the Deployment
+1. Go to the [Zerops Dashboard](https://app.zerops.io)
+2. In the top-left corner, you'll see a circle with **running process** text
+3. Click it to see the build progress overview
+4. Click **Open pipeline detail** button to view the detailed build process
+You'll see the deployment progress with timing for each step:
+- Initializing build container
+- Running build commands from zerops.yaml
+- Creating app version and upgrading PHP+Apache service
+The entire process usually takes less than a minute to complete.
+## Step 5 — Verifying Your Deployment
+Once the deployment completes, let's verify everything works:
+1. Go to your project's app service
+2. Click on **Public access & internal ports**
+3. Find the **Public Access through zerops.app Subdomain** section
+4. Toggle **Enable Zerops Subdomain Access**
+5. Click the generated URL (e.g., `https://app-xxx.prg1.zerops.app`) to view your application
+:::note
+The Zerops subdomain is perfect for testing and development, but for production, you should [set up your own domain](/features/access#public-access-through-your-domain) under **Public Access through Your Domains**.
+:::
+### Testing Database Connectivity
+Let's create a quick route to test database connectivity. Add this to your `routes/web.php`:
+```php
+Route::get('/db-test', function () {
+ session()->save();
+ return 'Current number of active sessions in database: ' . Illuminate\Support\Facades\DB::table('sessions')->count();
+});
+```
+Deploy this change:
+```bash
+zcli push
+```
+Visit `{your-app-url}/db-test` to verify database connectivity.
+## Accessing Your Database Locally
+Once your application is deployed, you might want to access the database directly from your local machine. Zerops makes this easy with VPN access.
+### Setting up VPN Access
+1. Start the VPN connection:
+```bash
+zcli vpn up
+```
+2. Select your project when prompted
+3. Try http://app.zerops/ to verify connectivity.
+That's it! You now have direct access to all services in your project.
+### Connecting to Database
+To get your database credentials:
+1. Go to the PostgreSQL service in your project
+2. Click **Access details** button
+3. Here you'll find all connection details including hostname, port, user, and password
+Update your local `.env` file with these credentials:
+```ini
+DB_CONNECTION=pgsql
+DB_HOST=db.zerops
+DB_PORT=5432
+DB_DATABASE=db
+DB_USERNAME=db
+DB_PASSWORD=[password from Access details]
+```
+Now you can use your favorite database management tool or run artisan commands while working with the database in Zerops - no local PostgreSQL installation needed!
+## Next Steps
+Now that your Laravel application is running on Zerops, consider:
+1. Setting up a [custom domain](/features/access#public-access-through-your-domain)
+2. Implementing basic CI/CD pipelines with [GitHub](/references/github-integration) or [GitLab](/references/gitlab-integration) integration
+3. Setting up [object storage](/object-storage/overview)
+## Conclusion
+Congratulations! 🎉 You've successfully deployed a Laravel application on Zerops with Apache and PostgreSQL. Your application is now running in a production-ready environment with automated builds and deployments.
+### Additional Resources
+- [Laravel Documentation](https://laravel.com/docs)
+- [Laravel Recipe Repository](https://github.com/zeropsio/recipe-laravel-minimal)
+- [zCLI Documentation](/references/cli)
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Logs
+
+Zerops provides comprehensive logging capabilities for Laravel applications using its distributed logging architecture. This guide shows you how to set up and optimize Laravel logging on Zerops, ensuring your application logs are properly captured and accessible.
+## Accessing Logs
+Learn how to [access and view your logs](/php/how-to/logs) in Zerops.
+## Configuration
+### Zerops Environment Variables
+Laravel logging in Zerops is configured through environment variables, such as:
+- `LOG_CHANNEL`: Specifies which logging channel to use (e.g., 'syslog', 'stack')
+- `LOG_STACK`: When using the stack channel, defines which channels to include
+- `LOG_LEVEL`: Sets the minimum log level to capture (e.g., 'debug', 'info', 'error')
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ run:
+ envVariables:
+ LOG_CHANNEL: syslog
+ LOG_LEVEL: debug
+ LOG_STACK: single
+```
+:::tip Available Log Channels
+Laravel supports several logging channels out of the box:
+- **stack**: Aggregates multiple logging channels into a single channel
+- **single**: Writes logs to a single file (storage/logs/laravel.log)
+- **daily**: Creates daily rotating log files
+- **syslog**: Writes to system log (recommended for Zerops)
+- **stderr**: Writes to PHP's standard error output stream
+- **errorlog**: Uses PHP's error_log function
+- **slack**: Sends log messages to Slack
+- **papertrail**: Sends logs to Papertrail
+- **mongodb**: Stores logs in MongoDB (requires additional package)
+:::
+To use multiple logging channels, [configure](#laravel-configuration) the stack channel:
+```yaml
+LOG_CHANNEL: stack
+LOG_STACK: syslog,daily
+```
+This configuration logs to both syslog (for Zerops) and daily files (for local access).
+:::tip
+Using appropriate log levels makes it easier to filter and find relevant messages in the Zerops GUI.
+:::
+### Laravel Configuration
+While Zerops is configured through environment variables, these variables are interpreted by Laravel's logging system. By default, Laravel includes a logging configuration that works out of the box - you don't need to modify anything.
+If you're curious about the underlying configuration or need to customize it beyond environment variables, here's what Laravel's logging configuration typically looks like:
+
+```php title="config/logging.php"
+ env('LOG_CHANNEL', 'stack'),
+ 'deprecations' => [
+ 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
+ 'trace' => env('LOG_DEPRECATIONS_TRACE', false),
+ ],
+ 'channels' => [
+ 'stack' => [
+ 'driver' => 'stack',
+ 'channels' => explode(',', env('LOG_STACK', 'single')),
+ 'ignore_exceptions' => false,
+ ],
+ 'single' => [
+ 'driver' => 'single',
+ 'path' => storage_path('logs/laravel.log'),
+ 'level' => env('LOG_LEVEL', 'debug'),
+ 'replace_placeholders' => true,
+ ],
+ 'daily' => [
+ 'driver' => 'daily',
+ 'path' => storage_path('logs/laravel.log'),
+ 'level' => env('LOG_LEVEL', 'debug'),
+ 'days' => env('LOG_DAILY_DAYS', 14),
+ 'replace_placeholders' => true,
+ ],
+ 'stderr' => [
+ 'driver' => 'monolog',
+ 'handler' => StreamHandler::class,
+ 'with' => [
+ 'stream' => 'php://stderr',
+ ],
+ 'level' => env('LOG_LEVEL', 'debug'),
+ ],
+ 'syslog' => [
+ 'driver' => 'syslog',
+ 'level' => env('LOG_LEVEL', 'debug'),
+ ],
+ 'errorlog' => [
+ 'driver' => 'errorlog',
+ 'level' => env('LOG_LEVEL', 'debug'),
+ ],
+ ],
+];
+```
+### Using Logs
+Laravel provides several ways to write log messages:
+```php
+// Using facade
+use Illuminate\Support\Facades\Log;
+Log::emergency($message);
+Log::alert($message);
+Log::critical($message);
+Log::error($message);
+Log::warning($message);
+Log::notice($message);
+Log::info($message);
+Log::debug($message);
+// Using helper function
+logger()->info($message);
+logger($message); // defaults to info level
+// With context data
+Log::info('User failed to login.', ['id' => $user->id]);
+```
+
+----------------------------------------
+
+# Frameworks > Laravel > Migrations
+
+Database migrations are **version control** for your database schema, allowing you to evolve your database structure alongside your application versions. Each migration represents a specific version change in your application's database schema, ensuring your database structure stays synchronized with your codebase as your application evolves.
+This guide covers how to implement and manage these version-based database changes on Zerops, focusing on PostgreSQL as the recommended database system.
+## Environment Configuration
+Configure your database connection in your environment variables:
+```yaml
+zerops:
+ - setup: app
+ run:
+ envVariables:
+ DB_CONNECTION: pgsql
+ DB_HOST: ${db_hostname}
+ DB_PORT: 5432
+ DB_DATABASE: myapp
+ DB_USERNAME: ${db_user}
+ DB_PASSWORD: ${db_password}
+```
+:::warning Backup your data
+Before running migrations in production, it's strongly recommended to back up your database. Zerops provides automated daily backups - see our [backup documentation](/features/backup) for details.
+:::
+## Running Migrations
+### Automatic Migrations
+The most reliable way to manage migrations in your deployment pipeline is through automatic execution. Configure this in your `zerops.yaml`:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ run:
+ initCommands:
+ - php artisan migrate --force --isolated
+```
+:::caution
+When running automatic migrations in production, the `--force` flag is necessary to bypass Laravel's safety prompt. Without this flag, Laravel asks for confirmation to help prevent accidental data loss.
+:::
+:::note Migrations in HA mode
+The `--isolated` flag prevents multiple servers from running migrations simultaneously by using a cache lock.
+:::
+### Manual Migrations
+For development and troubleshooting purposes, you can execute migrations manually through SSH:
+```bash
+# Connect to your zerops project
+zcli vpn up
+# SSH into your service using it's hostname (app)
+ssh app
+# For MacOS users
+ssh app.zerops
+```
+## Migration Commands
+Essential migration commands for your workflow:
+```bash
+# Create a new migration file with timestamp
+php artisan make:migration create_users_table
+# Execute all pending migrations
+php artisan migrate
+# Revert the most recent migration operation
+php artisan migrate:rollback
+# Reset and rerun all migrations (warning: destroys existing data)
+php artisan migrate:fresh
+# Display current migration status
+php artisan migrate:status
+```
+## Best Practices
+### Migration Structure
+```php {title="database/migrations/create_users_table.php"}
+id(); // Auto-incrementing primary key
+ $table->string('name'); // User's full name
+ $table->string('email')->unique(); // Unique email address
+ $table->timestamp('email_verified_at')->nullable(); // Email verification timestamp
+ $table->string('password'); // Hashed password
+ $table->rememberToken(); // Remember me token
+ $table->timestamps(); // Created_at and updated_at timestamps
+ });
+ }
+ /**
+ * Reverse the migrations.
+ * Removes the users table completely.
+ */
+ public function down()
+ {
+ Schema::dropIfExists('users');
+ }
+};
+```
+### Safe Migration Practices
+1. **Implement Reversible Changes**
+```php
+public function down()
+{
+ // Always provide a way to undo migration changes
+ Schema::table('users', function (Blueprint $table) {
+ $table->dropColumn('new_column');
+ });
+}
+```
+2. **Use Foreign Key Contraints**
+```php
+public function up()
+{
+ Schema::table('posts', function (Blueprint $table) {
+ // Create relationship with cascading delete
+ $table->foreignId('user_id')
+ ->constrained()
+ ->onDelete('cascade');
+ });
+}
+```
+3. **Handle Large Tables Efficiently**
+```php
+public function up()
+{
+ // Step 1: Add nullable column to prevent blocking operations
+ Schema::table('large_table', function (Blueprint $table) {
+ $table->string('new_column')->nullable();
+ });
+ // Step 2: Update data in manageable chunks
+ DB::table('large_table')
+ ->orderBy('id')
+ ->chunk(1000, function ($records) {
+ foreach ($records as $record) {
+ DB::table('large_table')
+ ->where('id', $record->id)
+ ->update(['new_column' => 'default_value']);
+ }
+ });
+}
+```
+## Testing Migrations
+### Create a Test Database
+Add a testing connection to your `config/database.php`:
+```php
+'testing' => [
+ 'driver' => 'pgsql',
+ 'host' => env('DB_TEST_HOST', '127.0.0.1'),
+ 'database' => env('DB_TEST_DATABASE', 'testing'),
+ 'username' => env('DB_TEST_USERNAME', 'postgres'),
+ 'password' => env('DB_TEST_PASSWORD', ''),
+],
+```
+### Migration Test Example
+Create a test file at `tests/Unit/MigrationTest.php`:
+```php
+/**
+ * Test migration execution and schema verification
+ */
+public function test_migrations_can_be_run()
+{
+ // Execute all migrations
+ Artisan::call('migrate');
+ // Verify table creation
+ $this->assertTrue(Schema::hasTable('users'));
+ // Verify column structure
+ $this->assertTrue(Schema::hasColumns('users', [
+ 'id', 'name', 'email', 'password'
+ ]));
+}
+```
+:::tip Migration Tips
+* Always create a backup before running migrations in production
+* Use database transactions for complex migrations
+* Thoroughly test migrations in development environment
+* Implement seeders for initial data population
+* Monitor execution time for migrations on large tables
+:::
+## Troubleshooting
+Common migration issues and their solutions:
+1. **Migration Timeout** Configure longer timeout in [zerops.yaml](/zerops-yaml/specification):
+```yaml
+zerops:
+ - setup: app
+ run:
+ initCommands:
+ - php artisan migrate --force --isolated --timeout=1000
+```
+2. **Database Lock Timeout** Adjust PDO settings in `config/database.php`:
+```php
+'pgsql' => [
+ // ...
+ 'options' => [
+ PDO::ATTR_LOCK_TIMEOUT => 1000 // Milliseconds
+ ]
+],
+```
+3. **Reset Migration State** Commands:
+```bash
+# Reset all migrations
+php artisan migrate:reset
+# Re-run all migrations
+php artisan migrate
+```
+## Additional Resources
+* [Laravel Migration Documentation](https://laravel.com/docs/11.x/migrations)
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Filament Devel
+
+[Filament](https://filamentphp.com/) is a collection of tools for rapidly building beautiful TALL stack (Tailwind, Alpine, Laravel, Livewire) applications. It provides a powerful admin panel, form builder, table builder, and other components that help you build feature-rich web applications with minimal effort.
+This recipe demonstrates how to effectively integrate Laravel Filament applications with Zerops, providing a fully production-capable setup. While this setup is built for professional deployment, we call it a **development environment** due to its streamlined resource allocation and use of the [Lightweight](/features/infrastructure#project-core) core package, optimizing costs without compromising functionality.
+ Set up a Laravel environment with Filament's admin panel and TALL stack in a development-optimized configuration.
+
+## Environment Overview
+Your newly deployed Laravel Filament environment includes:
+- A fully configured Laravel application service with Filament installed
+- PostgreSQL database integration with migration automation
+- Automated build and deployment pipeline
+- Health and readiness checks
+- Configured Filament admin panel and components
+:::note
+For production environments with high-availability services and enterprise-grade reliability, consider deploying the [production environment recipe](/frameworks/laravel/recipes/minimal-prod).
+:::
+## Application Configuration
+The app has been set up to utilize PostgreSQL service and includes Filament's admin panel and components. Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+- Filament assets compilation
+## Try the build & deploy pipeline in 30 seconds
+While Zerops supports various CI/CD workflows (CLI, GitHub Actions, built-in CI/CD), let's start with the simplest path to get you familiar with the core concepts:
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-laravel-minimal) and clone it locally
+2. Navigate to **Pipelines & CI/CD settings** and connect the service with your new GitHub repository, setting the trigger to **Push to Branch**
+### Test Your Pipeline
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in project detail
+## Integration with Existing Applications
+If you're looking to integrate an existing Laravel Filament application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-laravel-minimal/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel Filament tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel Filament project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Filament Local
+
+[Filament](https://filamentphp.com/) is a collection of tools for rapidly building beautiful TALL stack (Tailwind, Alpine, Laravel, Livewire) applications. It provides a powerful admin panel, form builder, table builder, and other components that help you build feature-rich web applications with minimal effort.
+This recipe provides a comprehensive Filament setup with PostgreSQL database, Redis-compatible store, object storage, and automated deployment pipeline, designed for **local development** This recipe provides a streamlined Laravel setup with PostgreSQL database and automated deployment pipeline, designed for **local development** with cost-efficient resource allocation and the [Lightweight](/features/infrastructure#project-core) core package. This means:
+- Resources are optimized for development workloads
+- Services can be started/stopped as needed during active development
+- Cost-effective configuration suitable for development and testing
+ Set up a Laravel environment with Filament's admin panel and TALL stack components for efficient local development.
+
+## Environment Overview
+Your newly deployed Filament environment includes:
+- A fully configured Laravel application service with Filament
+- PostgreSQL database integration with migration automation
+- Valkey (Redis-compatible KV store) for sessions and cache
+- Built-in object storage for filesystem
+- Mailpit for development SMTP server
+- Automated build and deployment pipeline
+- Health and readiness checks
+:::note
+For production environments with high-availability services and enterprise-grade reliability, consider deploying the [production environment recipe](/frameworks/laravel/recipes/filament-prod).
+:::
+## What to Expect
+The deployment process takes just a few minutes. Once complete, you'll receive:
+- A live URL to access your application
+- Database credentials
+- Access to your project dashboard
+- CLI configuration details for VPN access
+## Setting Up Local Development
+Zerops provides a built-in VPN feature through its CLI tool, enabling seamless local development against remote resources. Here's how to set it up:
+### Prerequisites
+- Install the [Zerops CLI](/references/cli#get-started) and log in with [personal access token](/references/cli#personal-access-tokens)
+- Install [Wireguard](/references/vpn) on your system
+### Setup Steps
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-filament) and clone it locally
+2. **Configure VPN Access**
+ ```bash
+ # Initialize VPN connection using project ID
+ zcli vpn up
+ # Or use interactive mode to select your project
+ zcli vpn up
+ ```
+3. **Set Up Environment**
+ ```bash
+ # Create and configure environment file
+ cp .env.example .env
+ ```
+ Fill in database access details - in Zerops GUI go to the detail of `db` service and open **Access details** in the left menu.
+ ```bash
+ composer install
+ php artisan key:generate
+ npm install
+ npm run dev
+ ```
+4. **Start Development Server**
+ ```bash
+ php artisan serve # or use your preferred setup (Valet, Herd, Sail)
+ ```
+Your local environment is now connected to the Zerops infrastructure, utilizing the database, redis and storage from Zerops while maintaining local development flexibility.
+## Application Configuration
+The app has been set up to utilize:
+- Valkey (Redis-compatible KV store) to handle sessions and cache
+- Built-in object storage for Laravel and Filament-specific filesystem operations
+- Mailpit as a mock SMTP server for development purposes
+Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+## Try the Build & Deploy Pipeline
+Now that you're logged into zcli, deploying your application is straightforward. Simply enter `zcli push` in your terminal from the root of your freshly cloned project.
+### Test Your Pipeline
+The best way to verify your setup is with a quick test:
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in your project dashboard
+### Setting Up Automated CI/CD
+To enable automatic deployments:
+1. Navigate to **Pipelines & CI/CD settings** in your service dashboard
+2. Connect the service with your new GitHub repository
+3. Set the trigger to **Push to Branch**
+## Integration with Existing Applications
+If you're looking to integrate an existing Filament application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-filament/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Filament Prod
+
+[Filament](https://filamentphp.com/) is a collection of tools for rapidly building beautiful TALL stack (Tailwind, Alpine, Laravel, Livewire) applications. It provides a powerful admin panel, form builder, table builder, and other components that help you build feature-rich web applications with minimal effort.
+This recipe demonstrates how to effectively integrate Laravel Filament applications with Zerops, providing a fully production-grade setup. It's built as a **production environment** with high-availability configuration and uses the [Serious](/features/infrastructure#project-core) core package, ensuring enterprise-grade reliability and robust performance.
+ Set up a production-ready Laravel environment with Filament's admin panel and TALL stack, backed by enterprise-grade reliability.
+
+## Environment Overview
+Your newly deployed Laravel Filament environment includes:
+- A fully configured Laravel application service with Filament installed and high availability
+- PostgreSQL database integration with migration automation
+- Automated build and deployment pipeline
+- Health and readiness checks
+- Configured Filament admin panel and components
+:::note
+For development environments with cost-efficient resource allocation, consider deploying the [development environment recipe](/frameworks/laravel/recipes/minimal-devel).
+:::
+## Application Configuration
+The app has been set up to utilize PostgreSQL service and includes Filament's admin panel and components. Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+- Filament assets compilation
+## Try the build & deploy pipeline in 30 seconds
+While Zerops supports various CI/CD workflows (CLI, GitHub Actions, built-in CI/CD), let's start with the simplest path to get you familiar with the core concepts:
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-laravel-minimal) and clone it locally
+2. Navigate to **Pipelines & CI/CD settings** and connect the service with your new GitHub repository, setting the trigger to **Push to Branch**
+### Test Your Pipeline
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in project detail
+## Integration with Existing Applications
+If you're looking to integrate an existing Laravel Filament application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-laravel-minimal/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel Filament tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel Filament project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Jetstream Devel
+
+Laravel Jetstream provides a polished application scaffolding for Laravel, featuring authentication, registration, email verification, two-factor authentication, session management, API support via Laravel Sanctum, and optional team management features. It serves as the perfect starting point for your next Laravel application.
+This recipe demonstrates how to effectively integrate Laravel Jetstream applications with Zerops, providing a fully production-capable setup. While this setup is built for professional deployment, we call it a **development environment** due to its streamlined resource allocation and use of the [Lightweight](/features/infrastructure#project-core) core package, optimizing costs without compromising functionality.
+ Set up a Laravel environment with Jetstream's team features and authentication system in a development-optimized configuration.
+
+## Environment Overview
+Your newly deployed Laravel Jetstream environment includes:
+- A fully configured Laravel application service with Jetstream installed
+- PostgreSQL database integration with migration automation
+- Automated build and deployment pipeline
+- Health and readiness checks
+- Configured Jetstream authentication system
+:::note
+For production environments with high-availability services and enterprise-grade reliability, consider deploying the [production environment recipe](/frameworks/laravel/recipes/minimal-prod).
+:::
+## Application Configuration
+The app has been set up to utilize PostgreSQL service and includes Jetstream's authentication scaffolding. Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+- Jetstream assets compilation
+## Try the build & deploy pipeline in 30 seconds
+While Zerops supports various CI/CD workflows (CLI, GitHub Actions, built-in CI/CD), let's start with the simplest path to get you familiar with the core concepts:
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-laravel-minimal) and clone it locally
+2. Navigate to **Pipelines & CI/CD settings** and connect the service with your new GitHub repository, setting the trigger to **Push to Branch**
+### Test Your Pipeline
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in project detail
+## Integration with Existing Applications
+If you're looking to integrate an existing Laravel Jetstream application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-laravel-minimal/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel Jetstream tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel Jetstream project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Jetstream Local
+
+Laravel Jetstream provides a polished application scaffolding for Laravel, featuring authentication, registration, email verification, two-factor authentication, session management, API support via Laravel Sanctum, and optional team management features. It serves as the perfect starting point for your next Laravel application.
+This recipe provides a comprehensive Laravel Jetstream setup with PostgreSQL database, Redis-compatible store, object storage, and automated deployment pipeline, designed for **local development** with cost-efficient resource allocation and the [Lightweight](/features/infrastructure#project-core) core package. This means:
+- Resources are optimized for development workloads
+- Services can be started/stopped as needed during active development
+- Cost-effective configuration suitable for development and testing
+ Set up a Laravel environment with Jetstream's team features and authentication system for rapid local development.
+
+## Environment Overview
+Your newly deployed Laravel Jetstream environment includes:
+- A fully configured Laravel application service with Jetstream
+- PostgreSQL database integration with migration automation
+- Valkey (Redis-compatible KV store) for sessions and cache
+- Built-in object storage for filesystem
+- Mailpit for development SMTP server
+- Automated build and deployment pipeline
+- Health and readiness checks
+:::note
+For production environments with high-availability services and enterprise-grade reliability, consider deploying the [production environment recipe](/frameworks/laravel/recipes/jetstream-prod).
+:::
+## What to Expect
+The deployment process takes just a few minutes. Once complete, you'll receive:
+- A live URL to access your application
+- Database credentials
+- Access to your project dashboard
+- CLI configuration details for VPN access
+## Setting Up Local Development
+Zerops provides a built-in VPN feature through its CLI tool, enabling seamless local development against remote resources. Here's how to set it up:
+### Prerequisites
+- Install the [Zerops CLI](/references/cli#get-started) and log in with [personal access token](/references/cli#personal-access-tokens)
+- Install [Wireguard](/references/vpn) on your system
+### Setup Steps
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-laravel-jetstream) and clone it locally
+2. **Configure VPN Access**
+ ```bash
+ # Initialize VPN connection using project ID
+ zcli vpn up
+ # Or use interactive mode to select your project
+ zcli vpn up
+ ```
+3. **Set Up Environment**
+ ```bash
+ # Create and configure environment file
+ cp .env.example .env
+ ```
+ Fill in database access details - in Zerops GUI go to the detail of `db` service and open **Access details** in the left menu.
+ ```bash
+ composer install
+ php artisan key:generate
+ npm install
+ npm run dev
+ ```
+4. **Start Development Server**
+ ```bash
+ php artisan serve # or use your preferred setup (Valet, Herd, Sail)
+ ```
+Your local environment is now connected to the Zerops infrastructure, utilizing the database, redis and storage from Zerops while maintaining local development flexibility.
+## Application Configuration
+The app has been set up to utilize:
+- Valkey (Redis-compatible KV store) to handle sessions and cache
+- Built-in S3 object storage for Laravel and Jetstream-specific filesystem operations
+- Mailpit as a mock SMTP server for development purposes
+Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+## Try the Build & Deploy Pipeline
+Now that you're logged into zcli, deploying your application is straightforward. Simply enter `zcli push` in your terminal from the root of your freshly cloned project.
+### Test Your Pipeline
+The best way to verify your setup is with a quick test:
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in your project dashboard
+### Setting Up Automated CI/CD
+To enable automatic deployments:
+1. Navigate to **Pipelines & CI/CD settings** in your service dashboard
+2. Connect the service with your new GitHub repository
+3. Set the trigger to **Push to Branch**
+## Integration with Existing Applications
+If you're looking to integrate an existing Laravel Jetstream application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-laravel-jetstream/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Jetstream Prod
+
+Laravel Jetstream provides a polished application scaffolding for Laravel, featuring authentication, registration, email verification, two-factor authentication, session management, API support via Laravel Sanctum, and optional team management features. It serves as the perfect starting point for your next Laravel application.
+This recipe demonstrates how to effectively integrate Laravel Jetstream applications with Zerops, providing a fully production-grade setup. It's built as a **production environment** with high-availability configuration and uses the [Serious](/features/infrastructure#project-core) core package, ensuring enterprise-grade reliability and robust performance.
+ Set up a production-ready Laravel environment with Jetstream's team features and authentication system, backed by high-availability services.
+
+## Environment Overview
+Your newly deployed Laravel Jetstream environment includes:
+- A fully configured Laravel application service with Jetstream installed and high availability
+- PostgreSQL database integration with migration automation
+- Automated build and deployment pipeline
+- Health and readiness checks
+- Configured Jetstream authentication system
+:::note
+For development environments with cost-efficient resource allocation, consider deploying the [development environment recipe](/frameworks/laravel/recipes/minimal-devel).
+:::
+## Application Configuration
+The app has been set up to utilize PostgreSQL service and includes Jetstream's authentication scaffolding. Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+- Jetstream assets compilation
+## Try the build & deploy pipeline in 30 seconds
+While Zerops supports various CI/CD workflows (CLI, GitHub Actions, built-in CI/CD), let's start with the simplest path to get you familiar with the core concepts:
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-laravel-minimal) and clone it locally
+2. Navigate to **Pipelines & CI/CD settings** and connect the service with your new GitHub repository, setting the trigger to **Push to Branch**
+### Test Your Pipeline
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in project detail
+## Integration with Existing Applications
+If you're looking to integrate an existing Laravel Jetstream application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-laravel-minimal/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel Jetstream tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel Jetstream project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Minimal Devel
+
+This recipe demonstrates how to effectively integrate Laravel applications with Zerops, providing a fully production-capable setup. While it's built for professional deployment, we call it a **development environment** due to its streamlined resource allocation and use of the [Lightweight](/features/infrastructure#project-core) core package, optimizing costs without compromising functionality.
+ Set up a streamlined Laravel environment with development-optimized resources and configurations.
+
+## Environment Overview
+Your newly deployed Laravel environment includes:
+- A fully configured Laravel application service
+- PostgreSQL database integration with migration automation
+- Automated build and deployment pipeline
+- Health and readiness checks
+:::note
+For production environments with high-availability services and enterprise-grade reliability, consider deploying the [production environment recipe](/frameworks/laravel/recipes/minimal-prod).
+:::
+## Application Configuration
+The app has been set up to utilize PostgreSQL service. Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+## Try the build & deploy pipeline in 30 seconds
+While Zerops supports various CI/CD workflows (CLI, GitHub Actions, built-in CI/CD), let's start with the simplest path to get you familiar with the core concepts:
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-laravel-minimal) and clone it locally
+2. Navigate to **Pipelines & CI/CD settings** and connect the service with your new GitHub repository, setting the trigger to **Push to Branch**
+### Test Your Pipeline
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in project detail
+## Integration with Existing Applications
+If you're looking to integrate an existing Laravel application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-laravel-minimal/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Minimal Local
+
+This recipe provides a streamlined Laravel setup with PostgreSQL database and automated deployment pipeline, designed for **local development** with cost-efficient resource allocation and the [Lightweight](/features/infrastructure#project-core) core package. This means:
+- Resources are optimized for development workloads
+- Services can be started/stopped as needed during active development
+- Cost-effective configuration suitable for development and testing
+ Set up a streamlined Laravel environment optimized for local development with this lightweight, cost-efficient configuration.
+
+## Environment Overview
+Your newly deployed Laravel environment includes:
+- A fully configured Laravel application service
+- PostgreSQL database integration with migration automation
+- Automated build and deployment pipeline
+- Health and readiness checks
+:::note
+For production environments with high-availability services and enterprise-grade reliability, consider deploying the [production environment recipe](/frameworks/laravel/recipes/minimal-prod).
+:::
+## What to Expect
+The deployment process takes just a few minutes. Once complete, you'll receive:
+- A live URL to access your application
+- Database credentials
+- Access to your project dashboard
+- CLI configuration details for VPN access
+## Setting Up Local Development
+Zerops provides a built-in VPN feature through its CLI tool, enabling seamless local development against remote resources. Here's how to set it up:
+### Prerequisites
+- Install the [Zerops CLI](/references/cli#get-started) and log in with [personal access token](/references/cli#personal-access-tokens)
+- Install [Wireguard](/references/vpn) on your system
+### Setup Steps
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-laravel-minimal) and clone it locally
+2. **Configure VPN Access**
+ ```bash
+ # Initialize VPN connection using project ID
+ zcli vpn up
+ # Or use interactive mode to select your project
+ zcli vpn up
+ ```
+3. **Set Up Environment**
+ ```bash
+ # Create and configure environment file
+ cp .env.example .env
+ ```
+ Fill in database access details - in Zerops GUI go to the detail of `db` service and open **Access details** in the left menu.
+ ```bash
+ composer install
+ php artisan key:generate
+ ```
+4. **Start Development Server**
+ ```bash
+ php artisan serve # or use your preferred setup (Valet, Herd, Sail)
+ ```
+Your local environment is now connected to the Zerops infrastructure, utilizing the remote PostgreSQL database while maintaining local development flexibility.
+## Application Configuration
+Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+## Try the Build & Deploy Pipeline
+Now that you're logged into zcli, deploying your application is straightforward. Simply enter `zcli push` in your terminal from the root of your freshly cloned project.
+### Test Your Pipeline
+The best way to verify your setup is with a quick test:
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in your project detail
+### Setting Up Automated CI/CD
+To enable automatic deployments:
+1. Navigate to **Pipelines & CI/CD settings** in your service dashboard
+2. Connect the service with your new GitHub repository
+3. Set the trigger to **Push to Branch**
+## Integration with Existing Applications
+If you're looking to integrate an existing Laravel application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-laravel-minimal/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Minimal Prod
+
+This recipe demonstrates how to effectively integrate Laravel applications with Zerops, providing a fully production-grade setup. It's built as a **production environment** with high-availability configuration and uses the [Serious](/features/infrastructure#project-core) core package, ensuring enterprise-grade reliability and robust performance.
+ Set up a production-ready Laravel environment with high-availability services and enterprise-grade reliability.
+
+## Environment Overview
+Your newly deployed Laravel environment includes:
+- A fully configured Laravel application service with high availability
+- PostgreSQL database integration with migration automation
+- Automated build and deployment pipeline
+- Health and readiness checks
+:::note
+For development environments with cost-efficient resource allocation, consider deploying the [development environment recipe](/frameworks/laravel/recipes/minimal-devel).
+:::
+## Application Configuration
+The app has been set up to utilize PostgreSQL service. Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+## Try the build & deploy pipeline in 30 seconds
+While Zerops supports various CI/CD workflows (CLI, GitHub Actions, built-in CI/CD), let's start with the simplest path to get you familiar with the core concepts:
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-laravel-minimal) and clone it locally
+2. Navigate to **Pipelines & CI/CD settings** and connect the service with your new GitHub repository, setting the trigger to **Push to Branch**
+### Test Your Pipeline
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in project detail
+## Integration with Existing Applications
+If you're looking to integrate an existing Laravel application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-laravel-minimal/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Twill Devel
+
+[Twill](https://twillcms.com/) is a flexible CMS toolkit for Laravel that helps you rapidly create a custom administration interface for your application. It provides a robust set of features including content management, media library, block editor, and a powerful publishing workflow system.
+This recipe demonstrates how to effectively integrate Laravel Twill applications with Zerops, providing a fully production-capable setup. While this setup is built for professional deployment, we call it a **development environment** due to its streamlined resource allocation and use of the [Lightweight](/features/infrastructure#project-core) core package, optimizing costs without compromising functionality.
+ Set up a Laravel environment with Twill's CMS framework in a development-optimized configuration.
+
+## Environment Overview
+Your newly deployed Laravel Twill environment includes:
+- A fully configured Laravel application service with Twill CMS installed
+- PostgreSQL database integration with migration automation
+- Automated build and deployment pipeline
+- Health and readiness checks
+- Configured Twill admin interface and media library
+:::note
+For production environments with high-availability services and enterprise-grade reliability, consider deploying the [production environment recipe](/frameworks/laravel/recipes/minimal-prod).
+:::
+## Application Configuration
+The app has been set up to utilize PostgreSQL service and includes Twill's CMS functionality. Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+- Twill assets compilation
+- Media storage configuration
+## Try the build & deploy pipeline in 30 seconds
+While Zerops supports various CI/CD workflows (CLI, GitHub Actions, built-in CI/CD), let's start with the simplest path to get you familiar with the core concepts:
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-laravel-minimal) and clone it locally
+2. Navigate to **Pipelines & CI/CD settings** and connect the service with your new GitHub repository, setting the trigger to **Push to Branch**
+### Test Your Pipeline
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in project detail
+## Integration with Existing Applications
+If you're looking to integrate an existing Laravel Twill application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-laravel-minimal/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel Twill tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel Twill project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Twill Local
+
+[Twill](https://twillcms.com/) is a flexible CMS toolkit for Laravel that helps you rapidly create a custom administration interface for your application. It provides a robust set of features including content management, media library, block editor, and a powerful publishing workflow system.
+This recipe provides a comprehensive Twill CMS setup with PostgreSQL database, Redis-compatible store, object storage, and automated deployment pipeline, designed for **local development** with cost-efficient resource allocation and the [Lightweight](/features/infrastructure#project-core) core package. This means:
+- Resources are optimized for development workloads
+- Services can be started/stopped as needed during active development
+- Cost-effective configuration suitable for development and testing
+ Set up a Laravel environment with Twill's publishing workflow and media management features for local development.
+
+## Environment Overview
+Your newly deployed Twill CMS environment includes:
+- A fully configured Laravel application service with Twill CMS
+- PostgreSQL database integration with migration automation
+- Valkey (Redis-compatible KV store) for sessions and cache
+- Built-in object storage for filesystem
+- Mailpit for development SMTP server
+- Automated build and deployment pipeline
+- Health and readiness checks
+:::note
+For production environments with high-availability services and enterprise-grade reliability, consider deploying the [production environment recipe](/frameworks/laravel/recipes/filament-prod).
+:::
+## What to Expect
+The deployment process takes just a few minutes. Once complete, you'll receive:
+- A live URL to access your application
+- Database credentials
+- Access to your project dashboard
+- CLI configuration details for VPN access
+## Setting Up Local Development
+Zerops provides a built-in VPN feature through its CLI tool, enabling seamless local development against remote resources. Here's how to set it up:
+### Prerequisites
+- Install the [Zerops CLI](/references/cli#get-started) and log in with [personal access token](/references/cli#personal-access-tokens)
+- Install [Wireguard](/references/vpn) on your system
+### Setup Steps
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-filament) and clone it locally
+2. **Configure VPN Access**
+ ```bash
+ # Initialize VPN connection using project ID
+ zcli vpn up
+ # Or use interactive mode to select your project
+ zcli vpn up
+ ```
+3. **Set Up Environment**
+ ```bash
+ # Create and configure environment file
+ cp .env.example .env
+ ```
+ Fill in database access details - in Zerops GUI go to the detail of `db` service and open **Access details** in the left menu.
+ ```bash
+ composer install
+ php artisan key:generate
+ npm install
+ npm run dev
+ ```
+4. **Start Development Server**
+ ```bash
+ php artisan serve # or use your preferred setup (Valet, Herd, Sail)
+ ```
+Your local environment is now connected to the Zerops infrastructure, utilizing the database, redis and storage from Zerops while maintaining local development flexibility.
+## Application Configuration
+The app has been set up to utilize:
+- Valkey (Redis-compatible KV store) to handle sessions and cache
+- Built-in object storage for Laravel and Twill-specific filesystem operations
+- Mailpit as a mock SMTP server for development purposes
+Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+## Try the Build & Deploy Pipeline
+Now that you're logged into zcli, deploying your application is straightforward. Simply enter `zcli push` in your terminal from the root of your freshly cloned project.
+### Test Your Pipeline
+The best way to verify your setup is with a quick test:
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in your project dashboard
+### Setting Up Automated CI/CD
+To enable automatic deployments:
+1. Navigate to **Pipelines & CI/CD settings** in your service dashboard
+2. Connect the service with your new GitHub repository
+3. Set the trigger to **Push to Branch**
+## Integration with Existing Applications
+If you're looking to integrate an existing Twill application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-twill/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Twill Prod
+
+[Twill](https://twillcms.com/) is a flexible CMS toolkit for Laravel that helps you rapidly create a custom administration interface for your application. It provides a robust set of features including content management, media library, block editor, and a powerful publishing workflow system.
+This recipe demonstrates how to effectively integrate Laravel Twill applications with Zerops, providing a fully production-grade setup. It's built as a **production environment** with high-availability configuration and uses the [Serious](/features/infrastructure#project-core) core package, ensuring enterprise-grade reliability and robust performance.
+ Set up a production-ready Laravel environment with Twill's CMS framework, backed by high-availability services and enterprise-grade reliability.
+
+## Environment Overview
+Your newly deployed Laravel Twill environment includes:
+- A fully configured Laravel application service with Twill CMS installed and high availability
+- PostgreSQL database integration with migration automation
+- Automated build and deployment pipeline
+- Health and readiness checks
+- Configured Twill admin interface and media library
+:::note
+For development environments with cost-efficient resource allocation, consider deploying the [development environment recipe](/frameworks/laravel/recipes/minimal-devel).
+:::
+## Application Configuration
+The app has been set up to utilize PostgreSQL service and includes Twill's CMS functionality. Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+- Twill assets compilation
+- Media storage configuration
+## Try the build & deploy pipeline in 30 seconds
+While Zerops supports various CI/CD workflows (CLI, GitHub Actions, built-in CI/CD), let's start with the simplest path to get you familiar with the core concepts:
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-laravel-minimal) and clone it locally
+2. Navigate to **Pipelines & CI/CD settings** and connect the service with your new GitHub repository, setting the trigger to **Push to Branch**
+### Test Your Pipeline
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in project detail
+## Integration with Existing Applications
+If you're looking to integrate an existing Laravel Twill application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-laravel-minimal/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel Twill tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel Twill project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Redis
+
+Redis is a powerful in-memory data structure store serving as a database, cache, message broker, and queue. This guide walks you through Redis integration with your Laravel application on Zerops for high-performance caching, session management, and queue processing.
+Zerops provides [Valkey](https://valkey.io), an open-source Redis alternative that delivers high-performance key/value storage with full Redis compatibility. Valkey supports all common Redis use cases — from caching and message queues to primary database functionality.
+## Adding Redis Service
+To use Valkey (Redis) features with Laravel, first either import Valkey as a service to your Zerops project
+```yaml
+services:
+ - hostname: valkey
+ type: valkey@7.2
+ mode: NON_HA # use HA in production
+```
+or add the Valkey service to your project manually from the Zerops GUI.
+:::tip High Availability Mode
+For production environments, we recommend using `HA` mode. This configuration:
+* Ensures automatic failover during node failures
+* Provides data replication across multiple nodes
+* Improves reliability and uptime
+:::
+## Environment Configuration
+### Basic Redis Settings
+Environment variables control how your Laravel application connects to and uses Redis. Below are the core settings grouped by functionality:
+```yaml
+zerops:
+ - setup: app
+ build:
+ base:
+ - php@8.4
+ os: alpine
+ run:
+ base: php-nginx@8.4
+ os: alpine
+ siteConfigPath: site.conf.tmpl
+ envVariables:
+ # Redis Connection Settings
+ REDIS_CLIENT: phpredis # PHP Redis client for better performance
+ REDIS_HOST: valkey # Internal hostname of Valkey service
+ REDIS_PORT: 6379 # Standard Redis port number
+ # Cache Configuration
+ CACHE_PREFIX: cache # Namespace for cache keys
+ CACHE_STORE: redis # Use Redis as primary cache
+ # Session Configuration
+ SESSION_DRIVER: redis # Store sessions in Redis
+ SESSION_ENCRYPT: false # Disable session encryption
+ SESSION_LIFETIME: 120 # Session timeout in minutes
+ SESSION_PATH: / # Cookie path setting
+ # Queue Configuration
+ QUEUE_CONNECTION: redis # Use Redis for job queues
+ BROADCAST_CONNECTION: redis # Redis for event broadcasting
+```
+## Feature-Specific Configuration
+### Redis Caching
+Laravel's cache system offers a unified API across different cache backends. The following configuration establishes Redis as your primary cache store for fast, reliable data caching:
+```php title="config/cache.php"
+'default' => env('CACHE_STORE', 'database'),
+'stores' => [
+ 'redis' => [
+ 'driver' => 'redis',
+ 'connection' => env('REDIS_CACHE_CONNECTION', 'cache'),
+ 'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'),
+ ],
+],
+'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
+```
+### Session Management with Redis
+Using Redis for session storage provides better performance than file-based sessions and enables seamless session sharing across multiple application servers. You can also set up a custom session connection in the `config/session.php` file.
+```php title="config/session.php"
+'driver' => env('SESSION_DRIVER', 'redis'),
+'lifetime' => env('SESSION_LIFETIME', 120),
+'encrypt' => env('SESSION_ENCRYPT', false),
+```
+### Queue System Configuration
+Redis queues offer a robust solution for handling background jobs in Laravel. This configuration sets up Redis as your queue backend with retry policies and connection settings. You can also set up a custom queue connection in the `config/queue.php` file.
+```php title="config/queue.php"
+'default' => env('QUEUE_CONNECTION', 'redis'),
+'connections' => [
+ 'redis' => [
+ 'driver' => 'redis',
+ 'connection' => 'default',
+ 'queue' => 'default',
+ 'retry_after' => 90, // Retry failed jobs after 90 seconds
+ 'block_for' => null, // Don't block when no jobs available
+ ],
+],
+```
+Consider using [Supervisor](https://laravel.com/docs/5.1/queues#supervisor-configuration) for managing Laravel queues in production.
+### Performance Optimization
+Configure your Redis connection pool for optimal performance:
+```php
+'redis' => [
+ 'client' => env('REDIS_CLIENT', 'phpredis'),
+ 'options' => [
+ 'cluster' => env('REDIS_CLUSTER', 'redis'),
+ 'prefix' => env('REDIS_PREFIX', ''),
+ 'pool' => [
+ 'max_connections' => 50,
+ 'timeout' => 30,
+ ],
+ ],
+],
+```
+## Working with Redis Features
+### Cache Operations Examples
+```php
+// Store items in cache with expiration time
+Cache::put('key', 'value', $seconds);
+// Retrieve cached items with optional default value
+$value = Cache::get('key');
+// Store items indefinitely until manually removed
+Cache::forever('key', 'value');
+```
+### Queue Processing Examples
+```php
+// Dispatch a job to the Redis queue with specific connection
+ProcessPodcast::dispatch($podcast)->onConnection('redis');
+// Start the queue worker process for Redis
+php artisan queue:work redis
+```
+### Session Handling Examples
+```php
+// Store data in the Redis session
+session(['key' => 'value']);
+// Retrieve data from the session with optional default
+$value = session('key');
+```
+
+----------------------------------------
+
+# Frameworks > Laravel > Smtp
+
+# SMTP Configuration for Laravel on Zerops
+:::warning Important Security Note
+By default, SMTP ports are blocked by Zerops firewall for security reasons. To use external SMTP services, please [contact Zerops support](mailto:support@zerops.io) to have the necessary ports opened for your project.
+Include in your request:
+* Detailed explanation of your use case
+* Specific ports and protocols needed
+* Project ID and Organization ID from your Zerops Dashboard
+:::
+## Production Configuration
+### Laravel Mail Configuration
+Laravel comes with a default mail configuration in `config/mail.php`. You typically don't need to modify this file as all settings can be controlled through environment variables.
+The default configuration supports multiple mailer types and reads all sensitive information from your environment. In this example
+
+```php title="config/mail.php"
+return [
+ 'default' => env('MAIL_MAILER', 'smtp'),
+ 'mailers' => [
+ 'smtp' => [
+ 'transport' => 'smtp',
+ 'url' => env('MAIL_URL'),
+ 'host' => env('MAIL_HOST', '127.0.0.1'),
+ 'port' => env('MAIL_PORT', 587),
+ 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
+ 'username' => env('MAIL_USERNAME'),
+ 'password' => env('MAIL_PASSWORD'),
+ 'timeout' => null,
+ 'local_domain' => env('MAIL_EHLO_DOMAIN'),
+ ],
+ 'ses' => [
+ 'transport' => 'ses',
+ ],
+ 'postmark' => [
+ 'transport' => 'postmark',
+ ],
+ 'failover' => [
+ 'transport' => 'failover',
+ 'mailers' => [
+ 'smtp',
+ 'log',
+ ],
+ ],
+ ],
+ 'from' => [
+ 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
+ 'name' => env('MAIL_FROM_NAME', 'Example'),
+ ],
+];
+```
+:::tip Available Mail Transports
+Laravel supports multiple mail transport options:
+- 'smtp' - Standard SMTP server
+- 'sendmail' - Server's sendmail
+- 'mailgun' - Mailgun API
+- 'ses' - Amazon SES
+- 'postmark' - Postmark
+- 'log' - Log messages for testing
+- 'array' - Store in array for testing
+- 'failover' - Fallback to next mailer if one fails
+- 'roundrobin' - Rotate between multiple mailers
+:::
+### Environment Configuration
+Configure your Laravel service with the required mail variables. The following example shows SMTP configuration, but most settings are common across different mail transports:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ run:
+ envVariables:
+ MAIL_MAILER: smtp
+ MAIL_FROM_ADDRESS: noreply@yourdomain.com
+ MAIL_FROM_NAME: YourApp
+ MAIL_HOST: your-smtp-host
+ MAIL_PORT: 587
+ MAIL_USERNAME: your-username
+ MAIL_PASSWORD: your-password
+ MAIL_ENCRYPTION: tls
+```
+If using other mail transports, you might need additional environment variables. Refer to Laravel's Mail documentation for transport-specific configuration.
+## Implementing Email Functionality
+### Creating Mail Classes
+Generate a new mail class using Artisan:
+```bash
+php artisan make:mail WelcomeEmail
+```
+```php title="app/Mail/WelcomeEmail.php"
+view('emails.welcome')
+ ->subject('Welcome to ' . config('app.name'));
+ }
+}
+```
+### Email Template
+Create a blade template for your email content:
+```php title="resources/views/emails/welcome.blade.php"
+# Welcome {{ $user->name }}
+Thanks for joining our application!
+Visit Dashboard
+Thanks,
+{{ config('app.name') }}
+```
+### Sending Emails
+You can send emails either immediately or using a queue:
+```php
+use Illuminate\Support\Facades\Mail;
+use App\Mail\WelcomeEmail;
+// Send immediately
+Mail::to($user->email)->send(new WelcomeEmail($user));
+// Send using queue
+Mail::to($user->email)->queue(new WelcomeEmail($user));
+```
+## Queue Configuration
+For production environments, it's recommended to use a queue system for sending emails to prevent request timeouts and improve application performance. Zerops provides Valkey, an open-source Redis-compatible service that's perfect for handling email queues.
+First, add the Valkey service to your project:
+```yaml
+services:
+ - hostname: redis
+ type: valkey@7.2
+ mode: NON_HA # use HA for high availability in production
+```
+Configure your Laravel service to use Redis for queues:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ run:
+ envVariables:
+ # Queue Configuration
+ QUEUE_CONNECTION: redis
+ REDIS_HOST: redis
+ REDIS_PORT: 6379
+ REDIS_CLIENT: phpredis # PHP Redis client for better performance
+ # Mail Configuration
+ MAIL_MAILER: smtp
+ MAIL_HOST: your-smtp-host.com
+ MAIL_PORT: 587
+ MAIL_USERNAME: your-username
+ MAIL_PASSWORD: your-password
+ MAIL_ENCRYPTION: tls
+ MAIL_FROM_ADDRESS: noreply@yourdomain.com
+ MAIL_FROM_NAME: YourApp
+```
+You can customize the queue behavior in your `config/queue.php`:
+```php title="config/queue.php"
+phpCopy'default' => env('QUEUE_CONNECTION', 'redis'),
+'connections' => [
+ 'redis' => [
+ 'driver' => 'redis',
+ 'connection' => 'default',
+ 'queue' => 'default',
+ 'retry_after' => 90, // Retry failed jobs after 90 seconds
+ 'block_for' => null, // Don't block when no jobs available
+ ],
+],
+```
+## Development Environment
+For local development and testing, Zerops provides a Mailpit service that allows you to catch and inspect all outgoing emails.
+### Setting up Mailpit
+Add this to your project import configuration or import the service separately:
+```yaml
+services:
+ - hostname: mailpit
+ type: go@1
+ buildFromGit: https://github.com/zeropsio/recipe-mailpit
+ enableSubdomainAccess: true
+```
+See [Mailpit recipe repo](https://github.com/zeropsio/recipe-mailpit) for reference.
+Configure your Laravel service to use Mailpit for development:
+```yaml
+zerops:
+ - setup: app
+ run:
+ envVariables:
+ MAIL_MAILER: smtp
+ MAIL_HOST: mailpit
+ MAIL_PORT: 1025
+ MAIL_FROM_ADDRESS: hello@example.com
+ MAIL_FROM_NAME: ZeropsLaravel
+```
+:::tip
+Enable `enableSubdomainAccess` to access the Mailpit web interface where you can view all emails during development.
+:::
+## Best Practices
+- Use queue for sending emails in production to prevent request timeouts
+- Configure proper timeouts for SMTP connections
+- Use environment variables for all mail settings
+- Implement proper error handling for failed email deliveries
+- Test email templates across different email clients
+- Monitor email delivery rates and bounce rates
+- Use Mailpit in development to catch and debug emails
+
+----------------------------------------
+
+# Getting Started
+
+Welcome to Zerops! :star:
+The best way to dive into Zerops is to try it yourself. Pick your favourite technology from the list below and follow the tutorials there:
+### Runtimes, web servers & Linux containers
+### Databases, search engines & message brokers
+
+----------------------------------------
+
+# Gleam > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing Gleam application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](/gleam/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple Gleam web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Gleam > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](/gleam/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](/gleam/how-to/build-pipeline#ports) `3000`, simply use `http://app:3000`
+:::info
+Do not use `https://` when communicating with Gleam from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use Gleam environment variables
+Zerops creates default environment variables for each Gleam service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](/gleam/how-to/env-variables#generated-env-variables) of the Gleam service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](/gleam/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your Gleam application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access Gleam application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/gleam/how-to/env-variables) are available when connected through VPN. To connect to your Gleam application in Zerops set the hostname and [internal port](/gleam/how-to/build-pipeline#ports) e.g. http://app:3000
+:::info
+Do not use `https://` when communicating with Gleam over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your Gleam service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your Gleam service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/gleam/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Gleam > How To > Build Pipeline
+
+Zerops provides a customizable build and runtime environment for your Gleam application.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: gleam@latest
+ # OPTIONAL. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customise the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # REQUIRED. Build your application
+ buildCommands:
+ - npm i
+ - npm run build
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - dist
+ - package.json
+ - node_modules
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ cache: node_modules
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: gleam@latest
+ # OPTIONAL. Sets the internal port(s) your app listens on:
+ ports:
+ # port number
+ - port: 3000
+ # OPTIONAL. Customise the runtime Gleam environment by installing additional
+ # dependencies to the base Gleam runtime environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Gleam application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # REQUIRED. Your Gleam application start command
+ start: npm start
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your Gleam application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Build pipeline configuration
+### base
+_REQUIRED._ Sets the base technology for the build environment.
+Following options are available for Gleam builds:
+```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
+ ...
+```
+ The base build environment contains {data.alpine.default}, the selected
+ major version of Gleam, Zerops command line tool, `npm`, `yarn`, `git` and `npx` tools.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
+```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
+ ...
+```
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
+To customise your build environment use the [prepareCommands](/gleam/how-to/build-pipeline#preparecommands) attribute.
+:::note
+Modifying the base technology will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### os
+_OPTIONAL._ Sets the operating system for the build environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+:::note
+Changing the OS setting will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache behavior.
+:::
+### prepareCommands
+_OPTIONAL._ Customises the build environment by installing additional dependencies or tools to the base build environment.
+The base build environment contains:
+- {data.alpine.default}
+- selected version of Gleam defined in the [base](/gleam/how-to/build-pipeline#base) attribute
+- [Zerops command line tool](/references/cli)
+- `npm`, `yarn`, `git` and `npx` tools
+To install additional packages or tools add one or more prepare commands:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: gleam@latest
+ # OPTIONAL. Customise the build environment by installing additional packages
+ # or tools to the base build environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first build is triggered, Zerops will
+1. create a build container
+2. download your application code from your repository
+3. run the prepare commands in the defined order
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::note
+These commands are skipped when using cached environment. Modifying `prepareCommands` will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache invalidation.
+:::
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/gleam/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all prepare commands are finished, your custom build environment is ready for the build phase.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### buildCommands
+_REQUIRED._ Defines build commands.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: gleam@latest
+ # REQUIRED. Build your application
+ buildCommands:
+ - npm i
+ - npm run build
+ ...
+```
+At least one command is required. Zerops triggers each command in the defined order in a dedicated build container.
+Before the build commands are triggered the build container contains:
+1. base environment defined by the [base](/gleam/how-to/build-pipeline#base) attribute
+2. optional customisation of the base environment defined in the [prepareCommands](/gleam/how-to/build-pipeline#preparecommands) attribute
+3. your application code
+#### Run build commands as a single shell instance
+Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it.
+```yaml
+buildCommands:
+ - |
+ npm i
+ npm run build
+```
+#### Run build commands as a separate shell instances
+When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command.
+```yaml
+buildCommands:
+ - npm i
+ - npm run build
+```
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/gleam/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the --verbose option.
+```yaml
+buildCommands:
+ - npm i --verbose
+ - npm run build
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the deploy phase.
+### deployFiles
+_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
+```yaml
+# REQUIRED. Select which files / folders to deploy after
+# the build has successfully finished
+deployFiles:
+ - dist
+ - package.json
+ - node_modules
+```
+Determines files or folders produced by your build, which should be deployed to your runtime service containers.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Examples
+Deploys a folder, and a file from the project root directory:
+```yaml
+deployFiles:
+ - dist
+ - package.json
+```
+Deploys the whole content of the build container:
+```yaml
+deployFiles: .
+```
+Deploys a folder, and a file in a defined path:
+```yaml
+deployFiles:
+ - ./path/to/file.txt
+ - ./path/to/dir/
+```
+#### How to use a wildcard in the path
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+Deploys all folders that are located in any path that begins with `/path/to/`
+```yaml
+deployFiles: ./path/to/~/
+```
+Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/
+```
+:::note Example
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+:::
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+_OPTIONAL._ Defines which files or folders will be cached for the next build.
+```yaml
+# OPTIONAL. Which files / folders you want to cache for the next build.
+# Next builds will be faster when the cache is used.
+cache: file.txt
+```
+The cache attribute helps optimize build times by preserving specified files between builds.
+The cache attribute supports the [~ wildcard character](#how-to-use-a-wildcard-in-the-path).
+Learn more about the [build cache system](/features/build-cache) in Zerops.
+### envVariables
+_OPTIONAL._ Defines the environment variables for the build environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ base: gleam@latest
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/gleam/how-to/env-variables) in Zerops.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current Gleam version for your runtime.
+Following options are available for Gleam runtimes:
+```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
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the
+ selected major version of Gleam, Zerops command line tool, `npm`, `yarn`, `git` and `npx` tools.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```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
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customise your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a Gleam service with hostname = "app" and port = 3000 from another service of the same project, simply use `app:3000`. Read more about [how to access a Gleam service](/gleam/how-to/access).
+Each port has following attributes:
+| parameter | description |
+| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| port | Defines the port number. You can set any port number between _10_ and _65435_. Ports outside this interval are reserved for internal Zerops systems. |
+| protocol | **Optional.** Defines the protocol. Allowed values are `TCP` or `UDP`. Default value is `TCP`. |
+| httpSupport | **Optional.** `httpSupport = true` is the default setting for TCP protocol. Set `httpSupport = false` if a web server isn't running on the port. Zerops uses this information for the configuration of [public access](/features/access). `httpSupport = true` is available only in combination with the TCP protocol. |
+| httpSupport | **Optional.** `httpSupport = true` is the default setting for TCP protocol. Set `httpSupport = false` if a web server isn't running on the port. Zerops uses this information for the configuration of [public access](/features/access). `httpSupport = true` is available only in combination with the TCP protocol. |
+### prepareCommands
+_OPTIONAL._ Customises the Gleam runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base Gleam environment contains {data.alpine.default} the selected
+ major version of Gleam, Zerops command line tool and `npm`, `yarn`, `git` and `npx` tools. To install
+ additional packages or tools add one or more prepare commands:
+```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 Gleam runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/gleam/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/gleam/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the custom runtime cache go to `yyy`
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.default}, the
+ selected major version of Gleam, Zerops command line tool and `npm`, `yarn`, `git` and `npx` tools.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare: ./runtime-config.yaml
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base Gleam runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Gleam application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your Gleam application is started via the [start command](/gleam/how-to/build-pipeline#start).
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](/gleam/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](/gleam/how-to/build-pipeline#preparecommands-1) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](/gleam/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/gleam/how-to/env-variables) in Zerops.
+### start
+_REQUIRED._ Defines the start command for your Gleam application.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Gleam application start command
+ start: npm start
+```
+We recommend starting your Gleam application using `npm start`.
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Gleam application start command
+ start: npm start
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+| Parameter | Description |
+| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **command** | Defines a local command to be run.
+The command has access to the same [environment variables](/gleam/how-to/create#set-secret-environment-variables) as your Gleam application.
+A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below. |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Gleam application start command
+ start: npm start
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+### crontab
+_OPTIONAL._ Defines cron jobs.
+Setup cron jobs in the following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ crontab:
+ # REQUIRED. Sets the command to execute:
+ - command: ""
+ # REQUIRED. Sets the interval time to execute:
+ timing: "0 * * * *"
+```
+Read more about setting up [cron](/references/cron) in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](/gleam/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](/gleam/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+| Parameter | Description |
+| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **command** | Defines a local command to be run.
+The command has access to the same [environment variables](/gleam/how-to/create#set-secret-environment-variables) as your Gleam application.
+A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below. |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](/gleam/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Gleam > How To > Build Process
+
+
+## Description of the build process
+Zerops starts a temporary build container and performs following actions:
+1. Installs the build environment:
+ - Sets up base system and Go runtime
+ - Restores cached files if available (based on `build.cache` configuration)
+ - Validates cache against current `build.os`, `build.base`, and `build.prepareCommands`
+2. Downloads your application source code from [GitHub ↗](https://www.github.com), [GitLab ↗](https://www.gitlab.com) or via [Zerops CLI](/references/cli)
+3. Optionally [customizes the build environment](#customize-gleam-build-environment)
+4. Runs the build commands
+5. Uploads the application artefact to the internal Zerops storage
+6. Preserves specified files for future builds (based on `build.cache` configuration)
+7. Optionally [customizes the runtime environment](/gleam/how-to/customize-runtime)
+8. [Deploys your application](/gleam/how-to/deploy-process)
+The build container is automatically deleted after the build has finished or failed.
+## Cancel running build
+When you know that the running build is not correct and you want to cancel it, you can do it in Zerops GUI. Go to the service detail, open the list of running processes and click on the **Open pipeline detail** button. Then click on the **Cancel build** button.
+
+:::caution
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+:::
+## Customize Gleam build environment
+The default Gleam build environment contains:
+- {data.alpine.default}
+- selected version of Gleam defined in `zerops.yaml` [build.base](/gleam/how-to/build-pipeline#base) parameter
+- [zCLI](/references/cli), Zerops command line tool
+- `npm`, `yarn`, `git` and `npx` tools
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/gleam/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](/gleam/how-to/build-pipeline#preparecommands) commands to your `zerops.yaml`.
+:::info
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::
+## Gleam build hardware resources
+Build of your Gleam application is run in a separate build container with following resource configuration:
+| HW resource | Minimum | Maximum |
+| ------------- | ------- | ------- |
+| **CPU cores** | 6 | 20 |
+| **RAM** | 8 GB | 8 GB |
+| **Disk** | 1 GB | 100 GB |
+| **Disk** | 1 GB | 100 GB |
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+## Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops will terminate the build pipeline and delete the build container.
+## Troubleshooting build-related problems
+### Failure of a build prepare command
+If any [prepare command](/gleam/how-to/build-pipeline#preparecommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/gleam/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom build environment is ready for the build phase.
+### Invalidate the build cache
+If you encounter unexpected build behavior or dependency issues, the problem might be related to [cached build data](/features/build-cache). While Zerops maintains the build cache to speed up deployments, sometimes you may need to start fresh.
+To invalidate the build cache:
+1. Go to your service detail in Zerops GUI
+2. Choose **Pipelines & CI/CD Settings** from the left menu
+3. Click on the **Invalidate build cache** button
+This will force Zerops to run the next build clean, including all prepare commands, which can help resolve cache-related issues. After invalidation, your next build will also create a fresh cache.
+### Failure of a build command
+If any [build command](/gleam/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/gleam/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `--verbose` option.
+```yaml
+buildCommands:
+ - npm i --verbose
+ - npm run build
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the [deploy](/gleam/how-to/deploy-process) phase.
+
+----------------------------------------
+
+# Gleam > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart Gleam service in Zerops GUI
+To stop the Gleam service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped Gleam service choose the **Start** item from the same menu.
+To restart the Gleam service choose the **Restart** item from the same menu.
+## Stop and start Gleam using zCLI
+zCLI is the Zerops command-line tool. To stop and start the Gleam service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Gleam > How To > Create
+
+Zerops provides a powerful Gleam runtime service with extensive build support. The Gleam runtime is highly scalable and customizable to suit your development and production needs. With just a few clicks or commands, you can have a production-ready Gleam environment up and running in no time.
+## Create a Gleam service using Zerops GUI
+First, set up a project in the Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu under the **Services** section. From there, you can add a new Gleam service:
+### Choose a Gleam version
+Zerops supports the following Gleam versions:
+:::info
+You can easily [upgrade](/gleam/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app", "cache", "gui", etc. Duplicate services with the same name within the same project are not allowed.
+#### Limitations:
+- Maximum 25 characters
+- Must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created and cannot be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as passwords, tokens, salts, certificates, etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting secret environment variables is optional. You can always set them later in the Zerops GUI.
+Read more about the [different types of environment variables](/gleam/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Configure auto scaling
+Zerops automatically scales Gleam services both vertically and horizontally. Vertical scaling adjusts the hardware resources (CPU, RAM, and disk) of a Gleam container, while horizontal scaling adds or removes entire containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. The power your application receives depends on the other applications running on the same CPU core. In the best-case scenario, your application gets 10/10 of the CPU core power, and 1/10 in the worst-case scenario.
+**Dedicated**
+The CPU core is dedicated exclusively to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+You can choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has the following default configuration:
+Gleam services always start with the minimal resources.
+In most cases, the default parameters will work without issues. If you need to limit the cost of the Gleam service, you can lower the maximum resources. Zerops will never scale above the selected maximums.
+If you experience insufficient Gleam performance or capacity, you can increase the minimum resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine-tune](/gleam/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application's needs.
+:::
+:::info
+You can change the vertical auto scaling parameters at any time.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but is already consuming the maximum resources defined for vertical auto scaling, Zerops will add a new container to your Gleam service. When your Gleam service doesn't need as much power and all containers are vertically scaled down such that their CPU allocation is near the minimum resources, Zerops will gradually remove entire containers.
+Horizontal auto scaling has the following default configuration:
+
+ Minimum containers
+
+ 1
+
+ Maximum containers
+
+ 6
+
+Gleam services always start with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](/gleam/how-to/scaling) about Gleam auto scaling in Zerops.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will automatically start a new container and deploy your application. However, the application will be unavailable for a short period. This mode is recommended for non-critical applications or development environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers based on your application's load. An application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed down to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents temporary outages in case any of the Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically, and the broken container will be deleted.
+:::caution
+Make sure your application is designed to run in multiple containers.
+:::
+## Create a Gleam service using zCLI
+zCLI is the Zerops command-line tool. To create a new Gleam service via the command line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/gleam/how-to/create#create-a-project-description-file)
+3. [Create a project with a Gleam and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a YAML format to describe the project infrastructure.
+#### Basic example:
+Create a directory called `my-project`. Inside the `my-project` directory, create a `description.yaml` file with the following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in gleam@{version} format
+ type: gleam@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one Gleam version 20 service with default [auto scaling](/gleam/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/gleam/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Gleam and PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in gleam@{version} format
+ type: gleam@latest
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+ - # second service hostname
+ hostname: db
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain a Gleam service and a [PostgreSQL](/postgresql/overview) service.
+Gleam service with "app" hostname, the internal port(s) the service listens on will be defined later in the [zerops.yaml](/gleam/how-to/build-pipeline#ports). Gleam service will run on version 20 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+| Parameter | Description | Limitations |
+| --------------- | ------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
+| **name** | The name of the new project. Duplicates are allowed. | |
+| **description** | **Optional.** Description of the new project. | Maximum 255 characters. |
+| **tags** | **Optional.** One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects. |
+| **tags** | **Optional.** One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects. |
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains Gleam and PostgreSQL services but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [Gleam service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+ All verticalAutoscaling attributes are optional. Not specified
+ attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers
+ for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value
+ map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add Gleam service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in gleam@{version} format
+ type: gleam@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Gleam service version 20 with default [auto scaling](/gleam/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Gleam > How To > Customize Runtime
+
+
+The default Gleam runtime environment contains:
+- {data.alpine.default}
+- selected version of Gleam selected when the runtime service was created.
+-
+ `zCLI`
+
+ , Zerops command line tool
+- `npm`, `yarn`, `git` and `npx` tools
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/gleam/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more `run.prepareCommands` commands to your `zerops.yaml`.
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/gleam/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `run.prepareCommands` commands in the defined order
+### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/gleam/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+The prepare runtime container is automatically deleted after the prepare runtime phase has finished or failed.
+### Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the `build.addToRunPrepare` and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the custom runtime cache go to `yyy`
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+
+----------------------------------------
+
+# Gleam > How To > Delete
+
+## Delete Gleam service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete Gleam using zCLI
+zCLI is the Zerops command-line tool. To delete the Gleam service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Gleam > How To > Deploy Process
+
+
+## Application artefact
+When the [build phase](/gleam/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](/gleam/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/gleam/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/gleam/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/gleam/how-to/build-pipeline#initcommands)
+4. Starts your application using the [start command](/gleam/how-to/build-pipeline#start)
+5. Optionally waits until the [readiness check](/gleam/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/gleam/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customise the runtime environment](/gleam/how-to/build-pipeline#preparecommands-1).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The Gleam process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready to handle requests right after it is started via the [start command](/gleam/how-to/build-pipeline#start), configure a [readiness check](/gleam/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your Gleam service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/gleam/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Gleam > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+| environment | type | defined in |
+| ----------- | ------ | --------------------------------------------------------------------------------- |
+| build | basic | [zerops.yaml](/gleam/how-to/build-pipeline#envvariables) |
+| runtime | basic | [zerops.yaml](/gleam/how-to/build-pipeline#envvariables-1) |
+| runtime | secret | [Zerops GUI](#set-secret-env-variables-in-zerops-gui) |
+| runtime | secret | [Zerops GUI](#set-secret-env-variables-in-zerops-gui) |
+Use the [secret env variables](/gleam/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](/gleam/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/gleam/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](/gleam/how-to/create) a new Gleam service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made to environment variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The Gleam process running in the container receives the list env variables only when it starts. Update of the env variables while the Gleam process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+These restrictions apply to all [types of env variables](/gleam/how-to/env-variables#types-of-env-variables-in-zerops).
+## Referencing other env variables
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your Gleam runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the Gleam service. The Gleam process running in the container receives the list env variables only when it starts. Update of the env variables while the Gleam process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a Gleam service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your Gleam app
+Zerops passes all environment variables from all project services when your Gleam app is deployed and started.
+To access the local environment variable i.e. the variable set to this Gleam service in your app, use:
+```sh
+process.env.YOUR_VARIABLE_KEY_HERE
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+
+----------------------------------------
+
+# Gleam > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Gleam > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](/gleam/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](/gleam/how-to/build-pipeline#preparecommands-1) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the runtime containers in Zerops CLI use
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## Gleam logging configuration
+Zerops logs all messages sent
+- to the standard error (`stderr`)
+- to the standard output (`stdout`)
+- via the Gleam `console.log` method
+### Severity level
+By default the `console.log` creates a message with the `Informational (6)` severity.
+Add a severity number in the `` format as a prefix to set a custom severity as shown below:
+```js
+console.log('A message with the informational severity ...');
+console.log('Emergency (0) severity > system is unusable.');
+console.log('Alert (1) severity > action must be taken immediately.');
+console.log('Critical (2) severity > critical conditions.');
+console.log('Error (3) severity > error conditions.');
+console.log('Warning (4) severity > warning conditions.');
+console.log('Notice (5) severity > normal, but significant, condition.');
+console.log('Informational (6) severity > informational message.');
+console.log('Debug (7) severity > debug-level message.');
+```
+:::info
+`console.info`, `console.warn`, `console.debug`
+, and `console.error` are just aliases to the `
+ console.log
+` method. They don't set the appropriate severity number. Use the `
+ <N>
+` prefix instead. :::
+
+----------------------------------------
+
+# Gleam > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the Gleam service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Gleam service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Gleam service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Gleam performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Gleam service. When your Gleam service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Gleam service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each Gleam service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the Gleam service.
+### Not enough resources to scale up
+If one of the Gleam containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the Gleam service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor Gleam resources
+Zerops provides information about how much hardware resources the Gleam service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Gleam > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your Gleam service directly when creating a new shared storage service. Just select your Gleam service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the Gleam service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create Gleam service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new Gleam service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/gleam/how-to/shared-storage#create-a-project-description-file)
+3. [Create a project with a Gleam service and a shared storage](/gleam/how-to/shared-storage#create-a-project-with-a-gleam-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](/gleam/how-to/create#create-a-project-description-file) how to define the Gleam service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Gleam and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in gleam@{version} format
+ type: gleam@latest
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the Gleam service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with a Gleam service and a shared storage
+Follow the article [How to create a project based on the description.yaml](/gleam/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Gleam > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](/gleam/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](/gleam/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](/gleam/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Gleam > How To > Upgrade
+
+You can upgrade or downgrade your Gleam service to a different major Gleam version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/gleam/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Gleam version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Gleam version for your runtime.
+If you want to build your application with a different major Gleam version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
+
+----------------------------------------
+
+# Gleam > Overview
+
+[Gleam ↗](https://gleam.org/en) is an asynchronous event-driven JavaScript runtime, which is designed to build scalable network applications.
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-gleam), a **_recipe_**, containing the most simple Gleam web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of Gleam app running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-gleam/blob/main/zerops-project-import.yaml)):
+```yaml
+project:
+ name: recipe-gleam
+ tags:
+ - zerops-recipe
+services:
+ - hostname: api
+ type: gleam@1.5
+ enableSubdomainAccess: true
+ buildFromGit: https://github.com/zeropsio/recipe-gleam
+ - hostname: db
+ type: postgresql@16
+ mode: NON_HA
+ priority: 1
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://api-808-3000.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+{"message":"This is a simple Gleam application running on Zerops.io, each request adds an entry to the PostgreSQL database and returns a count. See the source repository (https://github.com/zeropsio/recipe-gleam) for more information.","newEntry":"e64be640-d6c2-4be8-93ac-d1e40e56fa06","count":1}
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+## How to start
+It doesn't matter whether it's your first curious introduction to Zerops, you have already mastered the basics and are looking for a tiny detail or inspiration. Below, choose a section that fits your needs:
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Go > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing Go application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](/go/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple Go web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Go > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](/go/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](/go/how-to/build-pipeline#ports) `8080`, simply use `http://app:8080`
+:::info
+Do not use `https://` when communicating with Go from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use Go environment variables
+Zerops creates default environment variables for each Go service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](/go/how-to/env-variables#generated-env-variables) of the Go service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](/go/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your Go application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access Go application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/go/how-to/env-variables) are available when connected through VPN. To connect to your Go application in Zerops set the hostname and [internal port](/go/how-to/build-pipeline#ports) e.g. http://app:8080
+:::info
+Do not use `https://` when communicating with Go over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your Go service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your Go service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/go/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Go > How To > Build Pipeline
+
+Zerops provides a customizable build and runtime environment for your Go application.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: go@latest
+ # OPTIONAL. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # REQUIRED. Build your application
+ buildCommands:
+ - go build -o app main.go
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles: app
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ # cache: some_file
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: go@latest
+ # OPTIONAL. Sets the internal port(s) your app listens on:
+ ports:
+ # port number
+ - port: 8080
+ # OPTIONAL. Customize the runtime Go environment by installing additional
+ # dependencies to the base Go runtime environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Go application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # REQUIRED. Your Go application start command
+ start: ./app
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your Go application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Build pipeline configuration
+### base
+_REQUIRED._ Sets the base technology for the build environment.
+Following options are available for Go builds:
+```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
+ ...
+```
+ The base build environment contains {data.alpine.default}, the selected
+ version of Go, Zerops command line tool, `git` and `wget`.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
+```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
+ prepareCommands:
+ - zsc add nodejs@latest
+ ...
+```
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
+To customize your build environment use the [prepareCommands](/go/how-to/build-pipeline#preparecommands) attribute.
+:::note
+Modifying the base technology will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### os
+_OPTIONAL._ Sets the operating system for the build environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customized.
+:::
+:::note
+Changing the OS setting will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache behavior.
+:::
+### prepareCommands
+_OPTIONAL._ Customizes the build environment by installing additional dependencies or tools to the base build environment.
+The base build environment contains:
+- {data.alpine.default}
+- selected version of Go defined in the [base](/go/how-to/build-pipeline#base) attribute
+- [Zerops command line tool](/references/cli)
+- `git` and `wget`
+To install additional packages or tools add one or more prepare commands:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: go@latest
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first build is triggered, Zerops will
+1. create a build container
+2. download your application code from your repository
+3. run the prepare commands in the defined order
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::note
+These commands are skipped when using cached environment. Modifying `prepareCommands` will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache invalidation.
+:::
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/go/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all prepare commands are finished, your custom build environment is ready for the build phase.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### buildCommands
+_REQUIRED._ Defines build commands.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: go@latest
+ # REQUIRED. Build your application
+ buildCommands:
+ - go build -o app main.go
+ ...
+```
+At least one command is required. Zerops triggers each command in the defined order in a dedicated build container.
+Before the build commands are triggered the build container contains:
+1. base environment defined by the [base](/go/how-to/build-pipeline#base) attribute
+2. optional customisation of the base environment defined in the [prepareCommands](/go/how-to/build-pipeline#preparecommands) attribute
+3. your application code
+#### Run build commands as a single shell instance
+Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it. Suppose your `main.go` file is in a `src` directory.
+```yaml
+buildCommands:
+ - |
+ cd src
+ go build -o app main.go
+```
+#### Run build commands as a separate shell instances
+When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command. Suppose your `main.go` file is in a `src` directory.
+```yaml
+buildCommands:
+ - cd src
+ - go build -o app src/main.go
+```
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/go/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the --verbose option.
+```yaml
+buildCommands:
+ - go build -v -o app main.go
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the deploy phase.
+### deployFiles
+_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
+```yaml
+# REQUIRED. Select which files / folders to deploy after
+# the build has successfully finished
+deployFiles:
+ - app
+```
+Determines files or folders produced by your build, which should be deployed to your runtime service containers.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Examples
+Deploys a folder, and a file from the project root directory:
+```yaml
+deployFiles:
+ - app
+ - file.txt
+```
+Deploys the whole content of the build container:
+```yaml
+deployFiles: .
+```
+Deploys a folder, and a file in a defined path:
+```yaml
+deployFiles:
+ - ./path/to/file.txt
+ - ./path/to/dir/
+```
+#### How to use a wildcard in the path
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+Deploys all folders that are located in any path that begins with `/path/to/`
+```yaml
+deployFiles: ./path/to/~/
+```
+Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/
+```
+:::note Example
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+:::
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+_OPTIONAL._ Defines which files or folders will be cached for the next build.
+```yaml
+# OPTIONAL. Which files / folders you want to cache for the next build.
+# Next builds will be faster when the cache is used.
+cache: file.txt
+```
+The cache attribute helps optimize build times by preserving specified files between builds.
+The cache attribute supports the [~ wildcard character](#how-to-use-a-wildcard-in-the-path).
+Learn more about the [build cache system](/features/build-cache) in Zerops.
+### envVariables
+_OPTIONAL._ Defines the environment variables for the build environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ base: go@latest
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ GO_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/go/how-to/env-variables) in Zerops.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current Go version for your runtime.
+Following options are available for Go builds:
+```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
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the
+ selected major version of Go, Zerops command line tool, `git` and `wget`.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```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
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customise your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a Go service with hostname = "app" and port = 8080 from another service of the same project, simply use `app:8080`. Read more about [how to access a Go service](/go/how-to/access).
+Each port has following attributes:
+
+ Parameter
+ Description
+
+ port
+ Defines the port number. You can set any port number between 10 and 65435. Ports outside this interval are reserved for internal Zerops systems.
+
+ protocol
+ Optional. Defines the protocol. Allowed values are TCP or UDP. Default value is TCP.
+
+ httpSupport
+ Optional. httpSupport = true is the default setting for TCP protocol. Set httpSupport = false if a web server isn't running on the port. Zerops uses this information for the configuration of public access. httpSupport = true is available only in combination with the TCP protocol.
+
+### prepareCommands
+_OPTIONAL._ Customises the Go runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base Go environment contains {data.alpine.default}, the selected
+ major version of Go, Zerops command line tool and `git` and `wget`. To install additional packages or tools add one or more prepare commands:
+```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 Go runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/go/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/go/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+When the prepare cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.default}, the
+ selected major version of Go, Zerops command line tool and `git` and `wget`.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare: ./runtime-config.yaml
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base Go runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Go application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your Go application is started via the [start command](/go/how-to/build-pipeline#start).
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](/go/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](/go/how-to/build-pipeline#preparecommands-1) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](/go/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ GO_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/go/how-to/env-variables) in Zerops.
+### start
+_REQUIRED._ Defines the start command for your Go application.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Go application start command
+ start: ./app
+```
+We recommend starting your Go application using `./app`.
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Go application start command
+ start: ./app
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Go application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Go application start command
+ start: ./app
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+### crontab
+_OPTIONAL._ Defines cron jobs.
+Setup cron jobs in the following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ crontab:
+ # REQUIRED. Sets the command to execute:
+ - command: ""
+ # REQUIRED. Sets the interval time to execute:
+ timing: "0 * * * *"
+```
+Read more about setting up [cron](/references/cron) in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](/go/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](/go/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Go application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](/go/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Go > How To > Build Process
+
+
+## Description of the build process
+Zerops starts a temporary build container and performs following actions:
+1. Installs the build environment:
+ - Sets up base system and Go runtime
+ - Restores cached files if available (based on `build.cache` configuration)
+ - Validates cache against current `build.os`, `build.base`, and `build.prepareCommands`
+2. Downloads your application source code from [GitHub ↗](https://www.github.com), [GitLab ↗](https://www.gitlab.com) or via [Zerops CLI](/references/cli)
+3. Optionally [customizes the build environment](#customize-go-build-environment)
+4. Runs the build commands
+5. Uploads the application artefact to the internal Zerops storage
+6. Preserves specified files for future builds (based on `build.cache` configuration)
+7. Optionally [customizes the runtime environment](/go/how-to/customize-runtime)
+8. [Deploys your application](/go/how-to/deploy-process)
+The build container is automatically deleted after the build has finished or failed.
+## Cancel running build
+When you know that the running build is not correct and you want to cancel it, you can do it in Zerops GUI. Go to the service detail, select **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Cancel build** button.
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+## Customize Go build environment
+The default Go build environment contains:
+- {data.alpine.default}
+- selected version of Go defined in `zerops.yaml` [build.base](/go/how-to/build-pipeline#base) parameter
+- [zCLI](/references/cli), Zerops command line tool
+- `git` and `wget`
+:::note
+To use Ubuntu instead of the default Alpine, set the [build.os](/zerops-yaml/specification#os-) attribute.
+Additional packages and tools can be installed using [build.prepareCommands](/zerops-yaml/specification#preparecommands-).
+:::
+:::info
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::
+## Go build hardware resources
+Build of your Go application is run in a separate build container with following resource configuration:
+| HW resource | Minimum | Maximum |
+| ------------- | ------- | ------- |
+| **CPU cores** | 6 | 20 |
+| **RAM** | 8 GB | 8 GB |
+| **Disk** | 1 GB | 100 GB |
+| **Disk** | 1 GB | 100 GB |
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+## Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops will terminate the build pipeline and delete the build container.
+## Troubleshooting build-related problems
+### Failure of a build prepare command
+If any [prepare command](/go/how-to/build-pipeline#preparecommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/go/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom build environment is ready for the build phase.
+### Invalidate the build cache
+If you encounter unexpected build behavior or dependency issues, the problem might be related to [cached build data](/features/build-cache). While Zerops maintains the build cache to speed up deployments, sometimes you may need to start fresh.
+To invalidate the build cache:
+1. Go to your service detail in Zerops GUI
+2. Choose **Pipelines & CI/CD Settings** from the left menu
+3. Click on the **Invalidate build cache** button
+This will force Zerops to run the next build clean, including all prepare commands, which can help resolve cache-related issues. After invalidation, your next build will also create a fresh cache.
+### Failure of a build command
+If any [build command](/go/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/go/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the verbose `-v` option.
+```yaml
+build:
+ - go build -v
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the [deploy](/go/how-to/deploy-process) phase.
+
+----------------------------------------
+
+# Go > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart Go service in Zerops GUI
+To stop the Go service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped Go service choose the **Start** item from the same menu.
+To restart the Go service choose the **Restart** item from the same menu.
+## Stop and start Go using zCLI
+zCLI is the Zerops command-line tool. To stop and start the Go service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and its services to choose from.
+:::
+
+----------------------------------------
+
+# Go > How To > Create
+
+Zerops provides a Go runtime service with extensive build support. Go runtime is highly scalable and customisable to suit both development and production.
+## Create Go service using Zerops GUI
+First, set up a project in Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new Go service:
+### Choose Go version
+Following Go versions are currently supported:
+:::info
+You can [change](/go/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app","cache", "gui" etc. Duplicate services with the same name in the same project are forbidden.
+#### Limitations:
+- maximum 25 characters
+- must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created. It can't be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as password, tokens, salts, certificates etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting the secret environment variables is optional. You can set them later in Zerops GUI.
+Read more about [different types of env variables](/go/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Set auto scaling configuration
+Zerops scales the Go services automatically both vertically and horizontally. Vertical scaling means increasing or decreasing the hardware resources (CPU, RAM and disk) of a Go container. Horizontal scaling adds or removes whole containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Go service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Go service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Go performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/go/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+:::info
+You can change the vertical auto scaling parameters later.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Go service. When your Go service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Go service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](/go/how-to/scaling) about Go auto scaling.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Create Go service using zCLI
+zCLI is the Zerops command-line tool. To create a new Go service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/go/how-to/create#create-a-project-description-file)
+3. [Create a project with a Go and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### Basic example:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in go@{version} format
+ type: go@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one Go version 1 service with default [auto scaling](/go/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/go/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Go and PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in go@{version} format
+ type: go@latest
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create secret env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+ - # second service hostname
+ hostname: db
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain a Go service and a [PostgreSQL](/postgresql/overview) service.
+Go service with "app" hostname, the internal port(s) the service listens on will be defined later in the zerops.yaml. Go service will run on version 1 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ The hostname of the new database will be set to the `hostname` value.
+
+ Limitations:
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [Go service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+
+ All verticalAutoscaling attributes are optional. Not specified attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add Go service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in go@{version} format
+ type: go@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Go service version 1 with default [auto scaling](/go/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Go > How To > Customize Runtime
+
+
+The default Go runtime environment contains:
+- {data.alpine.default}
+- Selected version of Go when the runtime service was created.
+- [zCLI](/references/cli)
+- Git
+:::note
+To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yaml/specification#os--1) attribute.
+Additional packages and tools can be installed using [run.prepareCommands](/zerops-yaml/specification#preparecommands--1).
+:::
+## Runtime Flow
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. Create a prepare runtime container
+2. Optionally: [copy selected folders or files from your build container](/go/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. Run the run.prepareCommands in the defined order
+### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/go/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+The prepare runtime container is automatically deleted after the prepare runtime phase has finished or failed.
+### Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the build.addToRunPrepare and run.prepareCommands attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+
+----------------------------------------
+
+# Go > How To > Delete
+
+## Delete Go service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete Go using zCLI
+zCLI is the Zerops command-line tool. To delete the Go service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Go > How To > Deploy Process
+
+
+## Application artefact
+When the [build phase](/go/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](/go/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/go/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/go/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/go/how-to/build-pipeline#initcommands)
+4. Starts your application using the [start command](/go/how-to/build-pipeline#start)
+5. Optionally waits until the [readiness check](/go/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/go/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customize the runtime environment](/go/how-to/customize-runtime).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The Go process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready to handle requests right after it is started via the [start command](/go/how-to/build-pipeline#start), configure a [readiness check](/go/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your Go service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/go/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Go > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+
+ Type
+ Environment
+ Defined in
+
+ basic
+ build
+ zerops.yaml
+
+ basic
+ runtime
+ zerops.yaml
+
+ secret
+ runtime
+ Zerops GUI
+
+Use the [secret env variables](/go/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](/go/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/go/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](/go/how-to/create) a new Go service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made to environment variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The Go process running in the container receives the list env variables only when it starts. Update of the env variables while the Go process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+These restrictions apply to all [types of env variables](/go/how-to/env-variables#types-of-env-variables-in-zerops).
+## Referencing other env variables
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your Go runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the Go service. The Go process running in the container receives the list env variables only when it starts. Update of the env variables while the Go process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a Go service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your Go app
+Zerops passes all environment variables from all project services when your Go app is deployed and started.
+To access the local environment variable i.e. the variable set to this Go service in your app, use:
+```sh
+os.Getenv("YOUR_VARIABLE_KEY_HERE")
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+
+----------------------------------------
+
+# Go > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Go > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](/go/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](/go/how-to/build-pipeline#preparecommands-1) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the runtime containers in Zerops CLI use
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## Go logging configuration
+Zerops logs all messages sent
+- to the standard error (`stderr`)
+- to the standard output (`stdout`)
+- via the Go `fmt.Println` or `slog.Info` methods etc.
+### Severity level
+By default the `fmt.Println` or `slog` methods create messages with the `Informational (6)` severity.
+Add a severity number in the `` format as a prefix to set a custom severity as shown below:
+```go
+slog.Info("A message with the informational severity ...")
+slog.Info("Emergency (0) severity > system is unusable.")
+slog.Info("Alert (1) severity > action must be taken immediately.")
+slog.Info("Critical (2) severity > critical conditions.")
+slog.Info("Error (3) severity > error conditions.")
+slog.Info("Warning (4) severity > warning conditions.")
+slog.Info("Notice (5) severity > normal, but significant, condition.")
+slog.Info("Informational (6) severity > informational message.")
+slog.Info("Debug (7) severity > debug-level message.")
+```
+:::info
+`slog.Info`, `slog.Debug`, `slog.Warn`, and `
+ slog.Error
+` are just aliases to the `slog.Info` method. They don't set
+the appropriate severity number. Use the `<N>` prefix instead.
+:::
+
+----------------------------------------
+
+# Go > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the Go service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Go service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Go service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Go performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Go service. When your Go service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Go service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each Go service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the Go service.
+### Not enough resources to scale up
+If one of the Go containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the Go service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor Go resources
+Zerops provides information about how much hardware resources the Go service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Go > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your Go service directly when creating a new shared storage service. Just select your Go service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the Go service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create Go service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new Go service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/go/how-to/shared-storage#create-a-project-description-file)
+3. [Create a project with a Go service and a shared storage](/go/how-to/shared-storage#create-a-project-with-a-go-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](/go/how-to/create#create-a-project-description-file) how to define the Go service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Go and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in go@{version} format
+ type: go@latest
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the Go service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with a Go service and a shared storage
+Follow the article [How to create a project based on the description.yaml](/go/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Go > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](/go/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](/go/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](/go/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Go > How To > Upgrade
+
+You can upgrade or downgrade your Go service to a different major Go version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/go/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Go version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Go version for your runtime.
+If you want to build your application with a different major Go version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
+
+----------------------------------------
+
+# Go > Overview
+
+[Go ↗](https://go.dev/) is a statically typed, compiled high-level programming language designed at Google.
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-go-hello-world), a **_recipe_**, containing the most simple Go web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of Go running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-go-hello-world/blob/main/import-project/description.yaml)):
+```yaml
+project:
+ name: my-first-project
+services:
+ - hostname: helloworld
+ type: go@latest
+ minContainers: 1
+ maxContainers: 3
+ buildFromGit: https://github.com/zeropsio/recipe-go-hello-world@main
+ enableSubdomainAccess: true
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://helloworld-24-8080.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+Hello, World!
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+## How to start
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Go > Tutorial > Quickstart
+
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-go-hello-world), a **_recipe_**, containing the most simple Go web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of Go running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-go-hello-world/blob/main/import-project/description.yaml)):
+```yaml
+project:
+ name: my-first-project
+services:
+ - hostname: helloworld
+ type: go@latest
+ minContainers: 1
+ maxContainers: 3
+ buildFromGit: https://github.com/zeropsio/recipe-go-hello-world@main
+ enableSubdomainAccess: true
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://helloworld-24-8080.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+Hello, World!
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Go > Tutorial > Runtime Sql
+
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-onboarding-go), a **_recipe_**, containing a PostgreSQL service with a simple Go application. The repo will be used as a source from which the app will be built.
+:::tip
+Follow the steps below and when everything is working as expected, fork the repo, try making various changes or be bold and connect your own.
+:::
+:::note
+In the detail of each step, you can find a link with more information about the topic.
+:::
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+ 2. Create a project.
+
+ Learn more about projects in Zerops. See how to import a whole project into Zerops.
+
+ 3. In the left menu, click on Import services, copy & paste the contents of the `import-services.yaml` config file from the recipe repository of your choice. Then click on Import service.
+
+ Learn more about services in Zerops and how to import a service to an existing project.
+
+ The yaml file includes a `buildFromGit` directive, which ensures a one-time build from Git repository source. See how to connect a Github or Gitlab repository to be able to trigger automatic builds & deploys.
+
+ 4. Several pipelines are created, one for project creation and the rest for the activation of the services. Wait for all to finish.
+
+ Learn more about how the pipelines can be triggered and about build and deploy processes of a Go application in Zerops.
+Learn more about how to access build log of your Go service in Zerops.
+
+ 5. In the service detail, open the Public access & internal ports section, and Enable Zerops Subdomain.
+
+ Learn more about how to access your Go service in Zerops.
+
+ 6. Once the pipeline has finished, click on the activated subdomain URL. You should see a simple page with
+`Entry added successfully with random data: f47ac10b-58cc-0372-8567-0e02b2c3d479. Total count: 1`
+
+ Congratulations! You have created your first application in Zerops, and we hope to see your own projects soon.
+For now, check out other features, such as environment variables, runtime log and scaling.
+
+ 7. One of the services is `adminer`, a database management tool.
+ See how to access it.
+
+ Learn more about how to use `psql` command-line tool instead or how to import and export data from your database.
+
+8. Feel free to make any changes to your project, fork the repo or connect your own. Also see other Go and PostgreSQL recipes on our Github page.
+
+:::tip
+Have you got any additional question? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Go > Tutorial > Step By Step
+
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-go-hello-world), a **_recipe_**, containing the most simple Go web application. The repo will be used as a source from which the app will be built.
+:::tip
+Follow the steps below and when everything is working as expected, fork the repo, try making various changes or be bold and connect your own.
+:::
+:::note
+In the detail of each step, you can find a link with more information about the topic.
+:::
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+ 2. Create a project.
+
+ Learn more about projects in
+ Zerops. See how to import a whole project into Zerops.
+
+ 3. In the left menu, click on Import services, copy & paste the
+ contents of this yaml file and click on Import service.
+
+ Learn more about services in Zerops and how to import a service to an existing project.
+
+ The yaml file includes a `buildFromGit` directive, which ensures
+ a one-time build from Git repository source. See how to connect a Github or Gitlab repository to be able to
+ trigger automatic builds & deploys.
+
+ 4. Two pipelines are created, one for project creation and one for the service activation. Wait for both to finish.
+
+ Learn more about how the pipelines can be triggered and about build and deploy processes of a Go application in Zerops.
+Learn more about how to access build log of your Go service in Zerops.
+
+ 5. In the service detail, open the Public access & internal ports section, and Enable Zerops Subdomain.
+
+ Learn more about how to access your Go
+ service in Zerops.
+
+ 6. Once the pipeline has finished, click on the activated subdomain URL:
+ You should see a simple page with `Hello World!` printed.
+
+ Congratulations! You have created your first application in Zerops, and we hope to see your own projects soon.
+For now, check out other features, such as environment variables, runtime log and scaling.
+
+7. Feel free to make any changes to your project, fork the repo or connect your own. Also see other Go recipes on our Github page.
+
+:::tip
+Have you got any additional question? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Help > Contacts
+
+:construction: **We apologize for any inconvenience, we are doing our best to finish this documentation ASAP to make your Zerops experience a blast!** :construction:
+In the meantime, if you have any troubles setting up your application, or if you find a specific part of the documentation missing, don't hesitate to contact our team via:
+
+----------------------------------------
+
+# Help > Faq
+
+Get quick answers to your related questions about Zerops from frequently asked questions we get asked.
+### General
+ Question: Where can I find the Zerops Dashboard GUI?
+Answer:
+ You can access the Zerops Dashboard GUI directly at app.zerops.io.
+
+ Question: How much does it cost to get started?
+Answer:
+ It's free to get started, and no credit card is required! However, we
+ recommend visiting our pricing page to explore the options that best suit your needs.
+ We also have a calculator on our pricing page that can help you estimate the cost of your project.
+
+ Question: Where are your servers located?
+Answer:
+ Our infrastructure is hosted in our own high-tier data center in Prague,
+ Czech Republic, running on bare metal servers managed by vshosting's senior
+ admin team. The project was originally started in vshosting.eu, one of the largest providers of managed hosting
+ in Europe.
+
+ We are actively working on expanding to multiple regions to provide better
+ global coverage - stay tuned for updates on our Discord server and checkout our roadmap!
+
+ Question: Why should I use Zerops over Self-Hosted PaaS?
+Answer:
+ We have a detailed article discussing whether you should go for a Self-hosted PaaS → [The rise of self-hosted PaaS — is $5 VPS all you need?](https://zerops.io/article/the-rise-of-self-hosted-paa-s-is-5-vps-all-you-need).
+
+ Question: How do I change my email?
+Answer:
+ Navigate to the main menu in the Zerop GUI (with your icon) and add a new user with the selected email to your team.
+
+ Question: I have more questions. Where can I reach out to get help?
+Answer:
+ You can reach us on our Discord server for support. For additional contact options, please visit our contacts page.
+
+
+----------------------------------------
+
+# Homepage
+
+export const runtimes = [
+ { name: "Node.js", link: "/nodejs/overview", icon: },
+ { name: "PHP", link: "/php/overview", icon: },
+ { name: "Python", link: "/python/overview", icon: },
+ { name: "Go", link: "/go/overview", icon: },
+ { name: ".NET", link: "/dotnet/overview", icon: },
+ { name: "Rust", link: "/rust/overview", icon: },
+ { name: "Java", link: "/java/overview", icon: },
+ { name: "Deno", link: "/deno/overview", icon: },
+ { name: "Bun", link: "/bun/overview", icon: },
+ { name: "Elixir", link: "/elixir/overview", icon: },
+ { name: "Gleam", link: "/gleam/overview", icon: },
+ { name: "Nginx", link: "/nginx/overview", icon: },
+ { name: "Static", link: "/static/overview", icon: },
+]
+export const containers = [
+ { name: "Docker", link: "/docker/overview", icon: },
+ { name: "Alpine", icon: },
+ { name: "Ubuntu", icon: },
+]
+export const databases = [
+ { name: "PostgreSQL", link: "/postgresql/overview", icon: },
+ { name: "MariaDB", link: "/mariadb/overview", icon: },
+ { name: "Valkey", link: "/valkey/overview", icon: },
+ { name: "Elasticsearch", link: "/elasticsearch/overview", icon: },
+ { name: "Typesense", link: "/typesense/overview", icon: },
+ { name: "Meilisearch", link: "/meilisearch/overview", icon: },
+ { name: "Qdrant", link: "/qdrant/overview", icon: },
+ { name: "NATS", link: "/nats/overview", icon: },
+ { name: "KeyDB", link: "/keydb/overview", icon: },
+ { name: "Kafka", icon: },
+]
+export const storages = [
+ { name: "Object storage", link: "/object-storage/overview", icon: },
+ { name: "Shared storage", link: "/shared-storage/overview", icon: },
+]
+Zerops is a **developer-first Platform-as-a-Service**, running on bare metal, with every part built from scratch. Zerops aims to be the perfect mix of **developer experience**, **flexibility**, **scalability** and **affordability**, making it a great fit for applications of any size, complexity and traffic.
+## Natively supported services
+### Runtimes & web servers
+For these services Zerops provides pre-prepared build and runtime images and flexible pipeline that allows you to modify them and build your applications.
+### Linux containers & VMs
+These services can be deployed either as plain Linux containers or using Docker images, giving you flexibility to run any application or service.
+### Databases, search engines & message brokers
+These services are fully managed by Zerops and offered in highly available and single container modes.
+### Storages
+Fully managed S3 compatible storage running on a separate infrastructure and persistent disk that can be mounted to multiple services.
+## Quicklinks
+## Feature highlights
+Four concepts that play together to make Zerops developer-first and live up to the claim "no matter the size or environment".
+### ➡️ Custom dedicated infrastructure deployed with each project
+Zerops is made of three levels: **project** -> **service** -> **container**. For each project Zerops deploys dedicated **core services**, these consist of:
+- **L3 balancer** with a firewall and unique IP addresses assigned to it, this serves as the main entry point from the internet,
+- **Logger** and **Statistics** containers that gather logs and resource metrics from all services inside the project and allow for log forwarding
+- **L7 load balancer** that handles and routes http traffic, SSL termination and SSL certificates
+User services (which consist of one or more containers) inside the project share a private network created with VXLAN, have resources isolated with cgroups and can securely communicate with each other simply by using the hostname and ports and read and reference each other's environment variables.
+:::tip[**What does this mean for you?**]
+You get a fully managed, professional infrastructure setup that will scale no matter how much traffic you get and deals with all the networking, balancing and security stuff, so you can just focus on your actual applications.
+Read more about the project infrastructure
+:::
+### ➡️ Granular resource configuration, autoscaling and high availability of services
+Zerops has fully automatic horizontal and vertical scaling with configuration steps as small as 0.125 GB RAM and 1 CPU core. Your runtime services can go from a single container with 0.25 RAM and 1 CPU core to 10 containers each with 32 GB RAM and 10 CPU cores and then back in a matter of minutes. At the same time, all database and storage services are offered in well-crafted setups that go through performance optimizations while scaling and are available in both non-HA (single container) and high availability (multiple containers and balancers) modes.
+:::tip[**What does this mean for you?**]
+You won't ever overprovision or underprovision your resources and your services will always have the exact resources they need. There won't be any cutting corners like sharing too few CPU cores between too many services. You will be able to rely on professional, reliable and highly available database setups with auto-repairing abilities that will scale along with your applications.
+Read more about autoscaling and high availability
+:::
+### ➡️ Full Linux OS containers with a powerful, flexible build and deploy pipeline
+Zerops uses Incus to create containers, which means that you get a full Linux OS, either Ubuntu or Alpine, depending on your choices. This provides the perfect middle ground between a containerized process (Docker) and a full-fledged VM (Proxmox). Zerops provides build and runtime bases for all the popular runtime technologies and a powerful and flexible pipeline that allows you to modify and cache both the build and runtime images. This circumvents the need for Docker registries. The pipeline can be triggered either automatically, by connecting the service with GitHub or GitLab repositories, or manually using our CLI - either for triggering from your machine, or from any existing CI/CD process.
+:::tip[**What does this mean for you?**]
+You get a built-in powerful and flexible pipeline to modify build and runtime images and deploy your code, without any downtime. It can be used standalone or easily plugged into any existing CI/CD process.
+Read more about the build and deploy pipeline
+:::
+### ➡️ Pricing model that doesn't get in the way of good development practices
+"Simple and predictable pricing"... is what others say and what we actually do. In Zerops, cost per hardware resource (CPU, RAM, Disk) is 3-5x cheaper than with popular alternatives. And there are no plans, no feature tiers, no fees for seats. PaaS is just hardware with a cherry and bow on top, so why would we charge you for anything else but hardware resources?
+:::tip[**What does this mean for you?**]
+You get a powerful managed platform with all the best features unlocked for a price that's nearly on par with VPS. You can create as many environments as you need, even one for each developer working on a project, all with the same infrastructure as production, so they can utilize Zerops for their local development. No more "but it works on my machine".
+Read more about our developer first approach
+:::
+
+----------------------------------------
+
+# Java > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing Java application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](/java/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple Java web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Java > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](/java/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](/java/how-to/build-pipeline#ports) `8080`, simply use `http://app:8080`
+:::info
+Do not use `https://` when communicating with Java from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use Java environment variables
+Zerops creates default environment variables for each Java service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](/java/how-to/env-variables#generated-env-variables) of the Java service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](/java/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your Java application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access Java application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/java/how-to/env-variables) are available when connected through VPN. To connect to your Java application in Zerops set the hostname and [internal port](/java/how-to/build-pipeline#ports) e.g. http://app:8080
+:::info
+Do not use `https://` when communicating with Java over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your Java service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your Java service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/java/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Java > How To > Build Pipeline
+
+Zerops provides a customizable build and runtime environment for your Java application.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: java@latest
+ # OPTIONAL. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # REQUIRED. Build your application
+ buildCommands:
+ - ./mvnw clean install
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles: target/app.jar
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ # cache: some_file
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: java@latest
+ # OPTIONAL. Sets the internal port(s) your app listens on:
+ ports:
+ # port number
+ - port: 8080
+ # OPTIONAL. Customize the runtime Java environment by installing additional
+ # dependencies to the base Java runtime environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Java application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # REQUIRED. Your Java application start command
+ start: java -jar target/app.jar
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your Java application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Build pipeline configuration
+### base
+_REQUIRED._ Sets the base technology for the build environment.
+Following options are available for Java builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: java@latest
+ ...
+```
+ The base build environment contains {data.alpine.default}, the selected version
+ of Java, Zerops command line tool, `git` and
+ `wget`.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base:
+ - java@latest
+ prepareCommands:
+ - zsc add nodejs@latest
+ ...
+```
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
+To customize your build environment use the [prepareCommands](/java/how-to/build-pipeline#preparecommands) attribute.
+:::note
+Modifying the base technology will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### os
+_OPTIONAL._ Sets the operating system for the build environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customized.
+:::
+:::note
+Changing the OS setting will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache behavior.
+:::
+### prepareCommands
+_OPTIONAL._ Customizes the build environment by installing additional dependencies or tools to the base build environment.
+The base build environment contains:
+- {data.alpine.default}
+- selected version of Java defined in the [base](/java/how-to/build-pipeline#base) attribute
+- [Zerops command line tool](/references/cli)
+- `git` and `wget`
+To install additional packages or tools add one or more prepare commands:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: java@latest
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first build is triggered, Zerops will
+1. create a build container
+2. download your application code from your repository
+3. run the prepare commands in the defined order
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::note
+These commands are skipped when using cached environment. Modifying `prepareCommands` will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache invalidation.
+:::
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/java/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all prepare commands are finished, your custom build environment is ready for the build phase.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### buildCommands
+_REQUIRED._ Defines build commands.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: java@latest
+ # REQUIRED. Build your application
+ buildCommands:
+ - ./mvnw clean install
+ ...
+```
+At least one command is required. Zerops triggers each command in the defined order in a dedicated build container.
+Before the build commands are triggered the build container contains:
+1. base environment defined by the [base](/java/how-to/build-pipeline#base) attribute
+2. optional customisation of the base environment defined in the [prepareCommands](/java/how-to/build-pipeline#preparecommands) attribute
+3. your application code
+#### Run build commands as a single shell instance
+Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it. Suppose your `mvnw` executable file is in a `cmd` directory.
+```yaml
+buildCommands:
+ - |
+ cd cmd
+ ./mvnw clean install
+```
+#### Run build commands as a separate shell instances
+When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command. Suppose your `mvnw` executable file is in a `cmd` directory.
+```yaml
+buildCommands:
+ - cd cmd
+ - ./cmd/mvnw clean install
+```
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/java/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `-X` debug option.
+```yaml
+buildCommands:
+ - ./mvnw -X clean install
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the deploy phase.
+### deployFiles
+_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
+```yaml
+# REQUIRED. Select which files / folders to deploy after
+# the build has successfully finished
+deployFiles:
+ - app.jar
+```
+Determines files or folders produced by your build, which should be deployed to your runtime service containers.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Examples
+Deploys a folder, and a file from the project root directory:
+```yaml
+deployFiles:
+ - api
+ - app.jar
+```
+Deploys the whole content of the build container:
+```yaml
+deployFiles: .
+```
+Deploys a folder, and a file in a defined path:
+```yaml
+deployFiles:
+ - ./path/to/file.txt
+ - ./path/to/dir/
+```
+#### How to use a wildcard in the path
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+Deploys all folders that are located in any path that begins with `/path/to/`
+```yaml
+deployFiles: ./path/to/~/
+```
+Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/
+```
+:::note Example
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+:::
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+_OPTIONAL._ Defines which files or folders will be cached for the next build.
+```yaml
+# OPTIONAL. Which files / folders you want to cache for the next build.
+# Next builds will be faster when the cache is used.
+cache: file.txt
+```
+The cache attribute helps optimize build times by preserving specified files between builds.
+The cache attribute supports the [~ wildcard character](#how-to-use-a-wildcard-in-the-path).
+Learn more about the [build cache system](/features/build-cache) in Zerops.
+### envVariables
+_OPTIONAL._ Defines the environment variables for the build environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ base: java@latest
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/java/how-to/env-variables) in Zerops.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current Java version for your runtime.
+Following options are available for Java builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: java@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: java@latest
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the selected major
+ version of Java, Zerops command line tool, git` and `wget`.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: java@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base:
+ - java@latest
+ prepareCommands:
+ - zsc add nodejs@latest
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customize your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customized.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a Java service with hostname = "app" and port = 8080 from another service of the same project, simply use `app:8080`. Read more about [how to access a Java service](/java/how-to/access).
+Each port has following attributes:
+
+ Parameter
+ Description
+
+ port
+ Defines the port number. You can set any port number between 10 and 65435. Ports outside this interval are reserved for internal Zerops systems.
+
+ protocol
+ Optional. Defines the protocol. Allowed values are TCP or UDP. Default value is TCP.
+
+ httpSupport
+ Optional. httpSupport = true is the default setting for TCP protocol. Set httpSupport = false if a web server isn't running on the port. Zerops uses this information for the configuration of public access. httpSupport = true is available only in combination with the TCP protocol.
+
+### prepareCommands
+_OPTIONAL._ Customizes the Java runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base Java environment contains {data.alpine.default}, the selected major
+ version of Java, Zerops command line tool and
+ `git` and `wget`. To install additional packages or tools add one or more
+ prepare commands:
+```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 Java runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/java/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/java/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+When the prepare cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.default}, the selected
+ major version of Java, Zerops command line tool and `git` and `wget`.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare: ./runtime-config.yaml
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base Java runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Java application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your Java application is started via the [start command](/java/how-to/build-pipeline#start).
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](/java/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](/java/how-to/build-pipeline#preparecommands-1) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](/java/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/java/how-to/env-variables) in Zerops.
+### start
+_REQUIRED._ Defines the start command for your Java application.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Java application start command
+ start: java -jar target/app.jar
+```
+We recommend starting your Java application using `java -jar target/app.jar`.
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Java application start command
+ start: java -jar target/app.jar
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Java application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Java application start command
+ start: java -jar target/app.jar
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+### crontab
+_OPTIONAL._ Defines cron jobs.
+Setup cron jobs in the following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ crontab:
+ # REQUIRED. Sets the command to execute:
+ - command: ""
+ # REQUIRED. Sets the interval time to execute:
+ timing: "0 * * * *"
+```
+Read more about setting up [cron](/references/cron) in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](/java/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](/java/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Java application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](/java/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Java > How To > Build Process
+
+
+## Customize Java build environment
+The default Java build environment contains:
+- {data.alpine.default}
+- Selected version of Java when the runtime service was created.
+- [zCLI](/references/cli)
+- Git
+:::note
+To use Ubuntu instead of the default Alpine, set the [build.os](/zerops-yaml/specification#os-) attribute.
+Additional packages and tools can be installed using [build.prepareCommands](/zerops-yaml/specification#preparecommands-).
+:::
+## Description of the build process
+Zerops starts a temporary build container and performs following actions:
+1. Installs the build environment:
+ - Sets up base system and Go runtime
+ - Restores cached files if available (based on `build.cache` configuration)
+ - Validates cache against current `build.os`, `build.base`, and `build.prepareCommands`
+2. Downloads your application source code from [GitHub ↗](https://www.github.com), [GitLab ↗](https://www.gitlab.com) or via [Zerops CLI](/references/cli)
+3. Optionally [customizes the build environment](#customize-java-build-environment)
+4. Runs the build commands
+5. Uploads the application artefact to the internal Zerops storage
+6. Preserves specified files for future builds (based on `build.cache` configuration)
+7. Optionally [customizes the runtime environment](/java/how-to/customize-runtime)
+8. [Deploys your application](/java/how-to/deploy-process)
+The build container is automatically deleted after the build has finished or failed.
+## Cancel running build
+When you know that the running build is not correct and you want to cancel it, you can do it in Zerops GUI. Go to the service detail, select **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Cancel build** button.
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+## Customize Java build environment
+The default Java build environment contains:
+- {data.alpine.default}
+- selected version of Java defined in `zerops.yaml` [build.base](/java/how-to/build-pipeline#base) parameter
+- [zCLI](/references/cli), Zerops command line tool
+- `git` and `wget`
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/java/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](/java/how-to/build-pipeline#preparecommands) commands to your `zerops.yaml`.
+:::info
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::
+## Java build hardware resources
+Build of your Java application is run in a separate build container with following resource configuration:
+| HW resource | Minimum | Maximum |
+| ------------- | ------- | ------- |
+| **CPU cores** | 6 | 20 |
+| **RAM** | 8 GB | 8 GB |
+| **Disk** | 1 GB | 100 GB |
+| **Disk** | 1 GB | 100 GB |
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+## Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops will terminate the build pipeline and delete the build container.
+## Troubleshooting build-related problems
+### Failure of a build prepare command
+If any [prepare command](/java/how-to/build-pipeline#preparecommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/java/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom build environment is ready for the build phase.
+### Invalidate the build cache
+If you encounter unexpected build behavior or dependency issues, the problem might be related to [cached build data](/features/build-cache). While Zerops maintains the build cache to speed up deployments, sometimes you may need to start fresh.
+To invalidate the build cache:
+1. Go to your service detail in Zerops GUI
+2. Choose **Pipelines & CI/CD Settings** from the left menu
+3. Click on the **Invalidate build cache** button
+This will force Zerops to run the next build clean, including all prepare commands, which can help resolve cache-related issues. After invalidation, your next build will also create a fresh cache.
+### Failure of a build command
+If any [build command](/java/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/java/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the verbose `-X` debug option.
+```yaml
+build:
+ - ./mvnw -X clean install
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the [deploy](/java/how-to/deploy-process) phase.
+
+----------------------------------------
+
+# Java > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart Java service in Zerops GUI
+To stop the Java service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped Java service choose the **Start** item from the same menu.
+To restart the Java service choose the **Restart** item from the same menu.
+## Stop and start Java using zCLI
+zCLI is the Zerops command-line tool. To stop and start the Java service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and its services to choose from.
+:::
+
+----------------------------------------
+
+# Java > How To > Create
+
+Zerops provides a Java runtime service with extensive build support. Java runtime is highly scalable and customisable to suit both development and production.
+## Create Java service using Zerops GUI
+First, set up a project in Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new Java service:
+### Choose Java version
+Following Java versions are currently supported:
+:::info
+You can [change](/java/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app","cache", "gui" etc. Duplicate services with the same name in the same project are forbidden.
+#### Limitations:
+- maximum 25 characters
+- must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created. It can't be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as password, tokens, salts, certificates etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting the secret environment variables is optional. You can set them later in Zerops GUI.
+Read more about [different types of env variables](/java/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Set auto scaling configuration
+Zerops scales the Java services automatically both vertically and horizontally. Vertical scaling means increasing or decreasing the hardware resources (CPU, RAM and disk) of a Java container. Horizontal scaling adds or removes whole containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Java service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Java service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Java performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/java/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+:::info
+You can change the vertical auto scaling parameters later.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Java service. When your Java service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Java service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](/java/how-to/scaling) about Java auto scaling.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Create Java service using zCLI
+zCLI is the Zerops command-line tool. To create a new Java service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/java/how-to/create#create-a-project-description-file)
+3. [Create a project with a Java and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### Basic example:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in java@{version} format
+ type: java@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one Java version 1 service with default [auto scaling](/java/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/java/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Java and PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in java@{version} format
+ type: java@latest
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create secret env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+ - # second service hostname
+ hostname: db
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain a Java service and a [PostgreSQL](/postgresql/overview) service.
+Java service with "app" hostname, the internal port(s) the service listens on will be defined later in the zerops.yaml. Java service will run on version 1 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ The hostname of the new database will be set to the `hostname` value.
+
+ Limitations:
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [Java service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+
+ All verticalAutoscaling attributes are optional. Not specified attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add Java service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in java@{version} format
+ type: java@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Java service version 1 with default [auto scaling](/java/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Java > How To > Customize Runtime
+
+
+The default Java runtime environment contains:
+- {data.alpine.default}
+- Selected version of Java when the runtime service was created.
+- [zCLI](/references/cli)
+- Git
+:::note
+To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yaml/specification#os--1) attribute.
+Additional packages and tools can be installed using [run.prepareCommands](/zerops-yaml/specification#preparecommands--1).
+:::
+## Runtime Flow
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. Create a prepare runtime container
+2. Optionally: [copy selected folders or files from your build container](/java/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. Run the run.prepareCommands in the defined order
+### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/java/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+The prepare runtime container is automatically deleted after the prepare runtime phase has finished or failed.
+### Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the build.addToRunPrepare and run.prepareCommands attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+
+----------------------------------------
+
+# Java > How To > Delete
+
+## Delete Java service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete Java using zCLI
+zCLI is the Zerops command-line tool. To delete the Java service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Java > How To > Deploy Process
+
+
+## Application artefact
+When the [build phase](/java/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](/java/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/java/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/java/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/java/how-to/build-pipeline#initcommands)
+4. Starts your application using the [start command](/java/how-to/build-pipeline#start)
+5. Optionally waits until the [readiness check](/java/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/java/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customize the runtime environment](/java/how-to/customize-runtime).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The Java process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready to handle requests right after it is started via the [start command](/java/how-to/build-pipeline#start), configure a [readiness check](/java/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your Java service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/java/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Java > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+
+ Type
+ Environment
+ Defined in
+
+ basic
+ build
+ zerops.yaml
+
+ basic
+ runtime
+ zerops.yaml
+
+ secret
+ runtime
+ Zerops GUI
+
+Use the [secret env variables](/java/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](/java/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/java/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](/java/how-to/create) a new Java service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made to environment variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The Java process running in the container receives the list env variables only when it starts. Update of the env variables while the Java process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+These restrictions apply to all [types of env variables](/java/how-to/env-variables#types-of-env-variables-in-zerops).
+## Referencing other env variables
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your Java runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the Java service. The Java process running in the container receives the list env variables only when it starts. Update of the env variables while the Java process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a Java service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your Java app
+Zerops passes all environment variables from all project services when your Java app is deployed and started.
+To access the local environment variable i.e. the variable set to this Java service in your app, use:
+```sh
+os.Getenv("YOUR_VARIABLE_KEY_HERE")
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+
+----------------------------------------
+
+# Java > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Java > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](/java/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](/java/how-to/build-pipeline#preparecommands-1) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the runtime containers in Zerops CLI use
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## Java logging configuration
+Zerops logs all messages sent
+- to the standard error (`stderr`)
+- to the standard output (`stdout`)
+- via the Apache `log4j` package etc.
+### Severity level
+By default the `log4j` methods create messages with the `Informational (6)` severity.
+Add a severity number in the `` format as a prefix to set a custom severity as shown below:
+```java
+import org.apache.log4j.*;
+public class LogClass {
+ private static org.apache.log4j.Logger log = Logger.getLogger(LogClass.class);
+ public static void main(String[] args) {
+ log.info("A message with the informational severity ...")
+ log.info("Emergency (0) severity > system is unusable.")
+ log.info("Alert (1) severity > action must be taken immediately.")
+ log.info("Critical (2) severity > critical conditions.")
+ log.info("Error (3) severity > error conditions.")
+ log.info("Warning (4) severity > warning conditions.")
+ log.info("Notice (5) severity > normal, but significant, condition.")
+ log.info("Informational (6) severity > informational message.")
+ log.info("Debug (7) severity > debug-level message.")
+ }
+}
+```
+:::info
+`log.trace`, `log.info`, `log.debug`,
+`log.warn`,`log.error`, and `log.fatal` are
+just aliases to the `log.Info` method. They don't set the appropriate
+severity number. Use the `<N>` prefix instead. :::
+
+----------------------------------------
+
+# Java > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the Java service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Java service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Java service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Java performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Java service. When your Java service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Java service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each Java service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the Java service.
+### Not enough resources to scale up
+If one of the Java containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the Java service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor Java resources
+Zerops provides information about how much hardware resources the Java service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Java > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your Java service directly when creating a new shared storage service. Just select your Java service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the Java service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create Java service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new Java service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/java/how-to/shared-storage#create-a-project-description-file)
+3. [Create a project with a Java service and a shared storage](/java/how-to/shared-storage#create-a-project-with-a-java-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](/java/how-to/create#create-a-project-description-file) how to define the Java service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Java and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in java@{version} format
+ type: java@latest
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the Java service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with a Java service and a shared storage
+Follow the article [How to create a project based on the description.yaml](/java/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Java > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](/java/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](/java/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](/java/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Java > How To > Upgrade
+
+You can upgrade or downgrade your Java service to a different major Java version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/java/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Java version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Java version for your runtime.
+If you want to build your application with a different major Java version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
+
+----------------------------------------
+
+# Java > Overview
+
+# Java overview
+[Java ↗](https://www.java.com/en/) is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible.
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-java-hello-world), a **_recipe_**, containing the most simple Java web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of Java running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-java-hello-world/blob/main/import-project/description.yaml)):
+```yaml
+project:
+ name: my-first-project
+services:
+ - hostname: helloworld
+ type: java@latest
+ minContainers: 1
+ maxContainers: 3
+ buildFromGit: https://github.com/zeropsio/recipe-java-hello-world@main
+ enableSubdomainAccess: true
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://helloworld-24-8080.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+Hello, World!
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+## How to start
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Keydb > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops by running a predefined application consisting of a KeyDB service and a runtime service that handles the SQL queries.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own KeyDB service, feel free to head straight to the [How to](/keydb/how-to/create) section.
+## Guides
+We have created repositories, _recipes_, containing a simple web application and a KeyDB service, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Keydb > How To > Connect
+
+## Copy access details from Zerops GUI
+You will find the KeyDB access details under the **Access details** button in the project dashboard page.
+The same information is available in the service detail page in the left menu under the **Peek access details** button.
+### KeyDB access parameters:
+| Parameter | Description |
+| --------------------- | -------------------------------------------------------------------------------- |
+| **Hostname** | The service hostname specified when the KeyDB service was created. |
+| **Hostname** | The service hostname specified when the KeyDB service was created. |
+| **Port** | **6379**
+This port is fixed for all KeyDB services and cannot be customized. |
+| **Connection string** | The connection string for KeyDB service is:
+`redis://{hostname}:6379` |
+## Connect to KeyDB from runtime services of the same project
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+#### Example
+To connect to KeyDB `database1` service, set
+```
+host = database1
+```
+You will find the password under the [**Access details**](#copy-access-details-from-zerops-gui) button in Zerops GUI.
+:::caution
+Do not use SSL/TLS protocols when connecting to KeyDB from other runtime services in the same project. Zerops KeyDB is not configured to support these protocols. The security is assured by the project private network. Due to security reasons Zerops doesn't allow exposing KeyDB service to the internet.
+:::
+## Use KeyDB environment variables
+Zerops creates default environment variables for each KeyDB service to help you with connection from runtime services in the same project. To avoid the need to copy database access parameters manually, use environment variables in your [runtime service].
+### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example
+To access the `connectionString` env variable of the `keydb1` service, use `keudb1_connectionString` as the env variable key.
+### KeyDB environment variables
+List of service environment variables is available in Zerops GUI. Go to a KeyDB service detail and choose **Environment variables** in the left menu.
+Zerops creates following environment variables when the KeyDB service is created:
+| Variable | Description |
+| --------------------- | -------------------------------------------------------------------------------- |
+| **Hostname** | The service hostname specified when the KeyDB service was created. |
+| **Hostname** | The service hostname specified when the KeyDB service was created. |
+| **Port** | **5432**
+This port is fixed for all KeyDB services and cannot be customized. |
+| **projectId** | ID of the project. Generated by Zerops. |
+| **serviceId** | ID of the KeyDB service. Generated by Zerops. |
+| **Connection string** | The connection string for KeyDB service is:
+`redis://{hostname}:6379` |
+You can create own custom [environment variables](/features/env-variables) for the KeyDB service in Zerops GUI and use them in the same way as the default variables.
+## Connect to KeyDB in Zerops remotely
+:::caution
+Due to security reasons Zerops doesn't allow exposing KeyDB service directly to the internet.
+:::
+### Start VPN connection
+You can securely connect to KeyDB from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access KeyDB through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](#use-keydb-environment-variables) are available when connected through VPN. To connect to KeyDB in Zerops you have to copy the [access details](#copy-access-details-from-zerops-gui) manually from Zerops GUI.
+:::caution
+Do not use SSL/TLS protocols when connecting to KeyDB over VPN. Zerops KeyDB is not configured to support these protocols. The security is assured by the VPN.
+:::
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+### Connect to KeyDB from another Zerops project
+All services of the same project share a **dedicated private network**. You can use the service hostname to connect from one service to another within the same project.
+Different Zerops projects have no special connection. They can communicate with each other only via the internet. If you need to connect to a KeyDB service in a Zerops project from a runtime service in another project, you need to use the [Zerops VPN](#access-keydb-through-vpn). Due to security reasons Zerops doesn't allow exposing KeyDB service directly to the internet.
+
+----------------------------------------
+
+# Keydb > How To > Control
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart KeyDB service in Zerops GUI
+To stop the KeyDB service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped KeyDB service choose the **Start** item from the same menu.
+To restart the KeyDB service choose the **Restart** item from the same menu.
+## Stop and start KeyDB using zCLI
+zCLI is the Zerops command-line tool. To stop and start the KeyDB service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and its services to choose from.
+:::
+
+----------------------------------------
+
+# Keydb > How To > Create
+
+[KeyDB ↗](https://docs.keydb.dev/) is a fully open source database, backed by Snap, and a faster drop in alternative to Redis.
+## Create KeyDB using Zerops GUI
+First, set up a project in Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new KeyDB service:
+
+ Parameter
+ Description
+ Limitations
+
+ hostname
+ A unique service identifier like `keydb`, `db` etc.
+
+- duplicate services with the same name in the same project are forbidden
+
+- maximum 25 characters
+
+- must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+:::caution
+The hostname is fixed after the service is created. It can't be changed later.
+:::
+### Choose KeyDB service mode
+Zerops provides KeyDB service in two modes: **Highly available** and **Single container**.
+
+#### Highly available
+Creates a KeyDB cluster with **2 database containers**.
+This mode is suited for production.
+Zerops always keeps the 2 database containers on different physical machines. All your data is stored redundantly in 2 identical copies. In case of a failure of a container or the underlying physical machine, Zerops automatically disconnects the failed container from the cluster, creates a new container and syncs all data from the remaining copy. Finally the broken container is automatically deleted.
+[Learn more] about specific behaviour and technical limitations of the KeyDB cluster.
+#### Single container
+A KeyDB database installed in a single container is created. Useful for non-essential data or dev environments.
+:::caution
+Your data is stored only in a single container. If the container or the underlying physical machine fails, your data since the last backup are lost. Zerops doesn't provide any automatic repairs of single node KeyDB services.
+:::
+:::info
+The KeyDB service mode is fixed after the service is created. It can't be changed later.
+:::
+### Choose KeyDB version
+Following KeyDB versions are currently supported:
+### Set auto scaling configuration
+Zerops scales the KeyDB services automatically by raising or lowering the hardware resources of each database container.
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+For most cases, the default parameters will work without issues. If you need to limit the cost of the KeyDB service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient KeyDB performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/keydb/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+:::info
+You can change the auto scaling parameters later.
+:::
+:::tip
+[Learn more](/keydb/how-to/scale) about KeyDB auto scaling.
+:::
+## Create KeyDB using zCLI
+zCLI is the Zerops command-line tool. To create a new KeyDB service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](#create-a-project-description-file)
+3. Create a project and a KeyDB service
+### Create a project description file
+Zerops uses a yaml format file to describe the project infrastructure.
+#### Basic example
+Create a directory `my-project`. Create a `description.yaml` file inside the directory with the following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: keydb1
+ # service type and version number in keydb@6 format
+ type: keydb@6
+ # mode of operation "HA"/"NON_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain one KeyDB service in the [single container](#single-container) mode with default [auto scaling](/keydb/how-to/scale) configuration. Hostname will be set to `keydb1`.
+#### Full example
+Create a directory `my-project`. Create a `description.yaml` file inside the directory with the following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a KeyDB database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # first service hostname
+ hostname: keydb1
+ # service type and version number in keydb@6 format
+ type: keydb@6
+ # mode of operation "HA"/"NON_HA"
+ mode: HA
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ - # second service hostname
+ hostname: keydb2
+ # service type and version number in keydb@6 format
+ type: keydb@6
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain two KeyDB services.
+The hostname of the first service will be set to `keydb1`. The [high availability](#highly-available) mode will be chosen and the custom [auto scaling configuration](/keydb/how-to/scale) will be set.
+The hostname of the second service will be set to `keydb2`. The [single container](#single-container) mode will be chosen and the default [auto scaling configuration](/keydb/how-to/scale) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+ Limitations
+
+ name
+ The name of the new project. Duplicates are allowed.
+
+ description
+ Optional. Description of the new project.
+ Maximum 255 characters.
+
+ tags
+ Optional. One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects.
+
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains only KeyDB services but you can create a `description.yaml` with [different types] of services.
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ The hostname of the new database will be set to the `hostname` value.
+
+ Limitations:
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [KeyDB service types](/references/import-yaml/type-list#database-services) are currently supported.
+
+ mode
+
+ Defines the operation mode of KeyDB service.
+
+ HA
+
+ Creates a KeyDB cluster with 2 database containers. This mode is suited for production.
+
+ Zerops always keeps the 2 database containers on different physical machines. All your data is stored redundantly in 2 identical copies. In case of a failure of a container or the underlying physical machine, Zerops automatically disconnects the failed container from the cluster, creates a new container and syncs all data from the remaining copy. Finally the broken container is automatically deleted.
+
+ NON_HA
+
+ Zerops will create a KeyDB database installed in a single container. Useful for non-essential data or dev environments.
+
+ Your data is stored only in a single container. If the container or the underlying physical machine fails, your data since the last backup are lost. Zerops doesn't provide any automatic repairs of single node KeyDB services.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+
+ All verticalAutoscaling attributes are optional. Not specified attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+:::caution
+The KeyDB service **hostname** and **mode** are fixed after the service is created. They can't be changed later.
+:::
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add KeyDB service to an existing project
+#### Example
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```bash
+# array of project services
+services:
+ -
+ # service name
+ hostname: keydb1
+ # service type and version number in keydb@6 format
+ type: keydb@6
+ # mode of operation "HA"/"NON_HA"
+ mode: NON_HA
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one KeyDB service in the [single container mode](#single-container) with default [auto scaling](/keydb/how-to/scale) configuration will be added to your project. Hostname of the new service will be set to `keydb1`.
+The content of the `services:` section of `import.yaml` is identical to the [project description file](#create-a-project-description-file). The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the `import.yaml` file is 100 kB.
+
+----------------------------------------
+
+# Keydb > How To > Delete
+
+## Delete KeyDB service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete KeyDB using zCLI
+zCLI is the Zerops command-line tool. To delete the KeyDB service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Keydb > How To > Manage
+
+## How to use a database management tool on your workstation
+Do you already use a database management tool that supports KeyDB on your workstation? Connect it securely to KeyDB from your local workspace via Zerops VPN.
+Zerops VPN client is included into zCLI, the Zerops command-line tool. To start the VPN connection, read [how to connect to KeyDB remotely](/keydb/how-to/connect#connect-to-keydb-in-zerops-remotely).
+:::caution
+Do not use SSL/TLS protocols when connecting to KeyDB over VPN. Zerops KeyDB is not configured to support these protocols. The security is assured by the VPN.
+:::
+## How to use KeyDB Client CLI on your workstation
+If you use the [keydb-cli ↗](https://docs.keydb.dev/docs/keydbcli/) command-line client to manage your KeyDB on your local workspace, you can connect it securely to KeyDB via Zerops VPN.
+Zerops VPN client is included into zCLI, the Zerops command-line tool. To start the VPN connection, read [how to connect to KeyDB remotely](/keydb/how-to/connect#connect-to-keydb-in-zerops-remotely).
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/keydb/how-to/connect#connect-to-keydb-in-zerops-remotely) are available when connected through VPN. To connect to KeyDB in Zerops you have to copy the [access details](/keydb/how-to/connect#connect-to-keydb-in-zerops-remotely) manually from Zerops GUI.
+Use `keydb-cli` command to connect to KeyDB in Zerops:
+```sh
+keydb-cli -h [hostname]
+```
+:::caution
+Do not use SSL/TLS protocols when connecting to KeyDB over VPN. Zerops KeyDB is not configured to support these protocols. The security is assured by the VPN.
+:::
+
+----------------------------------------
+
+# Keydb > How To > Scale
+
+Zerops performs an automated scaling of hardware resources required to run your database based on its usage. If the current use of your database does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your database is under heavy load or needs to store more data, then auto scaling increases the resources for the database to make sure it runs smoothly.
+## Configure auto scaling
+To change the auto scaling settings go to the KeyDB service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU Mode
+**Shared**
+Your database gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your database gets is depended on other applications running on the same CPU core. At best case scenario your database gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your database.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+For most cases, the default parameters will work without issues. If you need to limit the cost of the KeyDB service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient KeyDB performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/keydb/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your database needs.
+:::
+:::tip
+[Learn more](/keydb/how-to/scale) about KeyDB auto scaling.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your database starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your database.
+
+If your database doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+The default minimum free RAM is preset according to the database type and version. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your database need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 62.5 MB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the database is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each KeyDB service. Zerops will never scale above the entered values. If your database is in [highly available mode], maximal resources are identical for all containers of the KeyDB service.
+### Not enough resources to scale up
+Zerops moves a container between physical machines only if there are not enough resources on the current physical machine to scale the container up. When this happens the behaviour is different for [highly available](/keydb/how-to/create#highly-available) and [single container](/keydb/how-to/create#single-container) mode.
+### Automatic scale down
+When the database no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the database from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal scaling
+Zerops provides KeyDB service in two modes: [Highly available](/keydb/how-to/create#highly-available) and [Single container](/keydb/how-to/create#single-container). The KeyDB service mode is chosen when creating a new service and cannot be changed later.
+Zerops doesn't scale KeyDB service horizontally, it means no containers are added or removed from the database cluster. Only in case of a failure of a container or the underlying physical machine, Zerops automatically replaces the broken container with a new one.
+## Monitor database resources
+Zerops provides information about how much hardware resources the KeyDB service is currently using. Go to KeyDB service detail in Zerops GUI and select **Service dashboard & database containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Keydb > Overview
+
+[KeyDB ↗](https://docs.keydb.dev/) is a fully open source database, a faster drop-in alternative to Redis. It offers enhanced performance, multithreading capabilities, and maintains full compatibility with Redis clients and APIs.
+:::important
+While KeyDB is available on Zerops, please note that KeyDB development has not been very active recently. For new Redis-compatible deployments, we recommend considering [Valkey](/valkey/overview) as the preferred alternative due to its active development and ongoing support.
+:::
+## Feature Highlights
+### Connect to KeyDB service
+## Popular Guides
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Mariadb > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops by running a predefined application consisting of a MariaDB service and a runtime service that handles the SQL queries.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own MariaDB service, feel free to head straight to the [How to](/mariadb/how-to/create) section.
+## Guides
+We have created repositories, _recipes_, containing a simple web application and a MariaDB service, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Mariadb > How To > Backup
+
+Zerops provides data backup for certain services, including MariaDB. The data is stored in S3 storage.
+## Frequency and volume
+By default, your data is backed up automatically **every day** at 00:00:00 UTC, unless you update your settings:
+### In GUI
+Following changes are available in Zerops GUI. Go to the service detail and choose **Backups List & Configuration** section in the left menu.
+- do a one-time backup of your data
+- change time of your automatic backup
+- turn off backing up your data completely
+- view all of your backups
+- download a backup
+- delete a backup
+### Via API
+- do a one-time backup of your data
+- change time of your automatic backup
+### Limits
+- Each backup is stored for a maximum period of **1 month**.
+- For each **service** a maximum of **100 backups** is stored.
+- For each **project** a maximum of **25 GiB** of backup volume is stored. Only full backups are stored, the backup that exceeds the limit by its part is not stored.
+#### Examples
+1. If you backup your data every day, and the total volume is less than 25 GiB, the maximum number of backups is ~30 for the last month. A new backup is stored every day (with the oldest one being deleted), unless you exceed the 25 GiB limit.
+2. If you backup your data every hour, and the total volume is less than 25 GiB, the total number of backups is 100 for the last 100 hours. A new backup is stored every hour (with the oldest one being deleted), unless you exceed the 25 GiB limit.
+3. If you backup your data every hour, and your backups exceed 25 GiB after 50 hours, the total number of backups is 50, unless you delete some of your backups or wait the oldest one is older than 1 month.
+## Persistence
+When deleting a service or a project:
+* Project deletion affects backups of **all** services within that project
+* Backups remain accessible for 7 days
+* After 7 days, all backups are permanently removed
+## Security
+All backups are stored in a separate S3 instance, isolated from the instance accessible by users.
+A unique encryption key is created for every project and each backup of the project is encrypted with this key.
+
+----------------------------------------
+
+# Mariadb > How To > Connect
+
+## Default MariaDB database and user
+Zerops creates a default database and a default user automatically when a new MariaDB service is [created](/mariadb/how-to/create).
+#### Database
+The default database name is identical to the service hostname. The default encoding is set to `utf8mb4`.
+#### DB user
+Default user name is identical to the service hostname. Default user password is generated randomly. You will find the password in [Zerops GUI](/mariadb/how-to/connect#copy-access-details-from-zerops-gui) or you can use the [environment variable](#use-mariadb-environment-variables).
+:::info
+Zerops creates a second DB user: `zps` for maintenance reasons with full privileges. Do not delete, change the password or remove privileges from this user, it will disrupt Zerops ability to maintain the database cluster.
+:::
+## Copy access details from Zerops GUI
+You will find the MariaDB access details under the **Access details** button in the project dashboard page.
+The same information is available in the service detail page in the left menu under the **Peek access details** button.
+### MariaDB access parameters:
+| Parameter | Description |
+| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
+| **Hostname** | The service hostname specified when the MariaDB service was created. |
+| **Hostname** | The service hostname specified when the MariaDB service was created. |
+| **Port** | **3306**
+This port is fixed for all MariaDB services and cannot be customized. |
+| **User** | Zerops creates a database user automatically when the service is created. The user name is always identical to the service hostname. |
+| **Password** | Zerops sets a random password when the service is created. |
+| **Connection string** | The connection string for MariaDB service is:
+`mysql://${user}:${password}@{hostname}:3306` |
+## Connect to MariaDB from runtime services of the same project
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+#### Example
+To connect to MariaDB `database1` service, set
+```
+host = database1
+user = database1
+password = **********
+```
+You will find the password under the [**Access details**](/mariadb/how-to/connect#copy-access-details-from-zerops-gui) button in Zerops GUI.
+:::caution
+Do not use SSL/TLS protocols when connecting to MariaDB from other runtime services in the same project. Zerops MariaDB is not configured to support these protocols. The security is assured by the project private network. Due to security reasons Zerops doesn't allow exposing MariaDB service to the internet.
+:::
+## Use MariaDB environment variables
+Zerops creates default environment variables for each MariaDB service to help you with connection from runtime services in the same project. To avoid the need to copy database access parameters manually, use environment variables in your [runtime service].
+### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+### MariaDB environment variables
+List of service environment variables is available in Zerops GUI. Go to a MariaDB service detail and choose **Environment variables** in the left menu.
+Zerops creates following environment variables when the MariaDB service is created:
+| Variable | Description |
+| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **Hostname** | The service hostname specified when the MariaDB service was created. |
+| **Hostname** | The service hostname specified when the MariaDB service was created. |
+| **Port** | **3306**
+This port is fixed for all MariaDB services and cannot be customized. |
+| **projectId** | ID of the project. Generated by Zerops. |
+| **serviceId** | ID of the MariaDB service. Generated by Zerops. |
+| **Connection string** | The connection string for MariaDB service is:
+`mysql://${user}:${password}@{hostname}:3306`
+Connection string contains [references](/mariadb/how-to/connect#mariadb-access-parameters) to `user` and `password` variables. Each time the `user` or `password` variable is updated, the `connectionString` variable is automatically updated as well. |
+| **User** | Zerops creates a database user automatically when the service is created. The user name is always identical to the service hostname. |
+| **Password** | Zerops sets a random password when the service is created. |
+:::caution
+When you change the value of the password env variable, only the env variable is updated, not the actual password of the MariaDB user. You have to update the password of the database user manually.
+:::
+:::caution
+When you change the password of the default MariaDB user in the database, the new password is not synchronised to the password env variable. You have to update the `password` env variable manually.
+:::
+You can create own custom [environment variables](/features/env-variables) for the MariaDB service in Zerops GUI and use them in the same way as the default variables.
+## Connect to MariaDB in Zerops remotely
+:::caution
+Due to security reasons Zerops doesn't allow exposing MariaDB service directly to the internet.
+:::
+### Start VPN connection
+You can securely connect to MariaDB from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access MariaDB through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](#use-mariadb-environment-variables) are available when connected through VPN. To connect to MariaDB in Zerops you have to copy the [access details](#copy-access-details-from-zerops-gui) manually from Zerops GUI.
+:::caution
+Do not use SSL/TLS protocols when connecting to MariaDB over VPN. Zerops MariaDB is not configured to support these protocols. The security is assured by the VPN.
+:::
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+### Connect to MariaDB from another Zerops project
+All services of the same project share a **dedicated private network**. You can use the service hostname to connect from one service to another within the same project.
+Different Zerops projects have no special connection. They can communicate with each other only via the internet. If you need to connect to a MariaDB service in a Zerops project from a runtime service in another project, you need to use the [Zerops VPN](#access-mariadb-through-vpn). Due to security reasons Zerops doesn't allow exposing MariaDB service directly to the internet.
+
+----------------------------------------
+
+# Mariadb > How To > Control
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart MariaDB service in Zerops GUI
+To stop the MariaDB service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped MariaDB service choose the **Start** item from the same menu.
+To restart the MariaDB service choose the **Restart** item from the same menu.
+## Stop and start MariaDB using zCLI
+zCLI is the Zerops command-line tool. To stop and start the MariaDB service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Mariadb > How To > Create
+
+MariaDB is the open source relational database loved by developers all over the world. Created by MySQL’s original developers, MariaDB is compatible with MySQL and guaranteed to stay open source forever.
+Zerops provides the MariaDB Community Server edition as a managed database service.
+## Create MariaDB using Zerops GUI
+First, set up a project in Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new MariaDB service:
+
+ Parameter
+ Description
+ Limitations
+
+ hostname
+ A unique service identifier like `mariadb`,`sql`, `db` etc.
+
+- duplicate services with the same name in the same project are forbidden
+
+- maximum 25 characters
+
+- must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+:::caution
+The hostname is fixed after the service is created. It can't be changed later.
+:::
+### Choose MariaDB service mode
+Zerops provides MariaDB service in two modes: **Highly available** and **Single container**.
+
+#### Highly available
+Creates a MariaDB cluster with **3 database containers** and **2 free database proxies**.
+This mode is suited for production.
+Zerops always keeps the 3 database containers on different physical machines. All your data is stored redundantly in 3 identical copies. In case of a failure of a container or the underlying physical machine, Zerops automatically disconnects the failed container from the cluster, creates a new container and syncs all data from the remaining 2 copies. Finally the broken container is automatically deleted.
+[Learn more](/mariadb/tech-details/cluster) about specific behaviour and technical limitations of the MariaDB cluster.
+#### Single container
+A MariaDB database installed in a single container is created. Useful for non-essential data or dev environments.
+:::caution
+Your data is stored only in a single container. If the container or the underlying physical machine fails, your data since the last backup are lost. Zerops doesn't provide any automatic repairs of single node MariaDB services.
+:::
+:::info
+The MariaDB service mode is fixed after the service is created. It can't be changed later.
+:::
+### Choose MariaDB version
+Following MariaDB versions are currently supported:
+### Set auto scaling configuration
+Zerops scales the MariaDB services automatically by raising or lowering the hardware resources of each database container.
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+
+ Resources Type
+ Minimum resource
+ Maximum resource
+
+ CPU cores
+ 1
+ 5
+
+ RAM
+ 0.5 GB
+ 32 GB
+
+ Disk
+ 1 GB
+ 100 GB
+
+For most cases, the default parameters will work without issues. If you need to limit the cost of the MariaDB service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient MariaDB performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/mariadb/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+:::info
+You can change the auto scaling parameters later.
+:::
+:::tip
+[Learn more](/mariadb/how-to/scale) about MariaDB auto scaling.
+:::
+## Create MariaDB using zCLI
+zCLI is the Zerops command-line tool. To create a new MariaDB service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](#create-a-project-description-file)
+3. Create a project and a MariaDB service
+### Create a project description file
+Zerops uses a yaml format file to describe the project infrastructure.
+#### Basic example
+Create a directory `my-project`. Create a `description.yaml` file inside the directory with the following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: mariadb1
+ # service type and version number in mariadb@{version} format
+ type: mariadb@10.4
+ # mode of operation "HA"/"NON_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain one MariaDB 10.4 service in the [single container](#single-container) mode with default [auto scaling](/mariadb/how-to/scale) configuration. Hostname will be set to `mariadb1`.
+#### Full example
+Create a directory `my-project`. Create a `description.yaml` file inside the directory with the following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a MariaDB database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # first service hostname
+ hostname: mariadb1
+ # service type and version number in mariadb@{version} format
+ type: mariadb@10.4
+ # mode of operation "HA"/"NON_HA"
+ mode: HA
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ - # second service hostname
+ hostname: mariadb2
+ # service type and version number in mariadb@{version} format
+ type: mariadb@10.4
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain two MariaDB 10.4 services.
+The hostname of the first service will be set to `mariadb1`. The [high availability](#highly-available) mode will be chosen and the custom [auto scaling configuration](/mariadb/how-to/scale) will be set.
+The hostname of the second service will be set to `mariadb2`. The [single container](#single-container) mode will be chosen and the default [auto scaling configuration](/mariadb/how-to/scale) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+ Limitations
+
+ name
+ The name of the new project. Duplicates are allowed.
+
+ description
+ Optional. Description of the new project.
+ Maximum 255 characters.
+
+ tags
+ Optional. One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects.
+
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains only MariaDB services but you can create a `description.yaml` with [different types] of services.
+
+ Parameter
+ Description
+ Limitations
+
+ hostname
+ A unique service identifier like `mariadb`,`sql`, `db` etc.
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+ Specifies the service type and version.
+
+ See what [MariaDB service types](/references/import-yaml/type-list#database-services) are currently supported.
+
+ mode
+ Defines the operation mode of MariaDB service.
+
+ HA
+
+ Zerops will create a MariaDB cluster with 3 database containers and 2
+ free database proxies. This mode is suited for production.
+
+ Zerops always keep the 3 database containers on different physical
+ machines. All your data is stored redundantly in 3 copies. In case of a
+ failure of a container or the underlying physical machine, Zerops
+ automatically disconnects the failed container from the cluster, creates
+ a new container and syncs all data from the remaining 2 copies. Finally
+ the broken container is automatically deleted.
+
+ NON_HA
+
+ Zerops will create a MariaDB database installed in a single container.
+ Useful for non-essential data or dev environments.
+
+ Your data is stored only in a single container. If the container or the
+ underlying physical machine fails, your data since the last backup are
+ lost. Zerops doesn't provide any automatic repairs of single node
+ MariaDB services.
+
+ verticalAutoscaling
+ Defines custom vertical auto scaling parameters
+
+ All verticalAutoscaling attributes are optional. Not specified
+ attributes will be set to their default values.
+
+ - cpuMode
+ Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+ Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+ Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+ Set the minDisk or maxDisk in GB (float).
+
+:::caution
+The MariaDB service **hostname** and **mode** are fixed after the service is created. They can't be changed later.
+:::
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add MariaDB service to an existing project
+#### Example
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```bash
+# array of project services
+services:
+ -
+ # service name
+ hostname: mariadb1
+ # service type and version number in mariadb@{version} format
+ type: mariadb@10.4
+ # mode of operation "HA"/"NON_HA"
+ mode: NON_HA
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one MariaDB 10.4 service in the [single container mode](#single-container) with default [auto scaling](/mariadb/how-to/scale) configuration will be added to your project. Hostname of the new service will be set to `mariadb1`.
+The content of the `services:` section of `import.yaml` is identical to the [project description file](#create-a-project-description-file). The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the `import.yaml` file is 100 kB.
+
+----------------------------------------
+
+# Mariadb > How To > Delete
+
+## Delete MariaDB service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete MariaDB using zCLI
+zCLI is the Zerops command-line tool. To delete the MariaDB service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Mariadb > How To > Export Import Data
+
+## Use Adminer to export or import data
+[Adminer ↗](https://www.adminer.org) is an open source full-featured database management tool written in PHP.
+1. [Install Adminer to Zerops](/mariadb/how-to/manage#how-to-install-adminer-to-zerops)
+2. Use Adminer standard export or import functions
+## Use phpMyAdmin to export or import data
+[phpMyAdmin ↗](https://www.phpmyadmin.net) is a free software tool written in PHP, intended to handle the administration of MariaDB over the Web.
+1. [Install phpMyAdmin to Zerops](/mariadb/how-to/manage#how-to-install-phpmyadmin-to-zerops)
+2. Use phpMyAdmin standard export or import functions
+## Use a database management tool on your workstation to export or import data
+Do you already use a database management tool that supports MariaDB on your workstation? Connect it securely to MariaDB from your local workspace via Zerops VPN.
+Zerops VPN client is included into zCLI, the Zerops command-line tool. To start the VPN connection, read [how to connect to MariaDB remotely](/mariadb/how-to/connect#connect-to-mariadb-in-zerops-remotely).
+:::caution
+Do not use SSL/TLS protocols when connecting to MariaDB over VPN. Zerops MariaDB is not configured to support these protocols. The security is assured by the VPN.
+:::
+Once the connection to MariaDB is established, use the standard export or import functions of your favourite management tool.
+## Use mysql CLI to export or import data
+If you are using the [mysql ↗](https://dev.mysql.com/doc/refman/8.1/en/mysql.html) command-line client to manage your MariaDB on your local workspace, you can connect it securely to MariaDB via Zerops VPN.
+Zerops VPN client is included into zCLI, the Zerops command-line tool. To start the VPN connection, read [how to connect to MariaDB remotely](/mariadb/how-to/connect#connect-to-mariadb-in-zerops-remotely).
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/mariadb/how-to/connect#use-mariadb-environment-variables) are available when connected through VPN. To connect to MariaDB in Zerops you have to copy the [access details](/mariadb/how-to/connect#connect-to-mariadb-in-zerops-remotely) manually from Zerops GUI.
+Use [mysql ↗](https://dev.mysql.com/doc/refman/8.1/en/mysql.html) command to connect to MariaDB in Zerops:
+```sh
+mysql -h [hostname] -u [user] -p [password] [database_name]
+```
+:::caution
+Do not use SSL/TLS protocols when connecting to MariaDB over VPN. Zerops MariaDB is not configured to support these protocols. The security is assured by the VPN.
+:::
+To export your database data and structure, use the [mysqldump ↗](https://dev.mysql.com/doc/refman/8.1/en/mysqldump.html) command.
+```sh
+mysqldump -h [hostname] -u [user] –p [password] [database_name] > dumpfilename.sql
+```
+To import your database data and structure, use the `mysql` command.
+```sh
+mysql -h [hostname] -u [user] –p [password] [database_name] < dumpfilename.sql
+```
+
+----------------------------------------
+
+# Mariadb > How To > Manage
+
+## Default database and user
+Zerops creates a default database and a default user automatically when a new MariaDB service is [created](/mariadb/how-to/create).
+#### Database
+The default database name is identical to the service hostname. The default encoding is set to `utf8mb4`.
+#### DB user
+Default user name is identical to the service hostname. Default user password is generated randomly. You will find the password in [Zerops GUI](/mariadb/how-to/connect#copy-access-details-from-zerops-gui) or you can use the [environment variable](/mariadb/how-to/connect#use-mariadb-environment-variables).
+:::info
+Zerops creates a second DB user: `zps` for maintenance reasons with full privileges. Do not delete, change the password or remove privileges from this user, it will disrupt Zerops ability to maintain the database cluster.
+:::
+## How to install Adminer to Zerops
+[Adminer ↗](https://www.adminer.org) is a open source full-featured database management tool written in PHP.
+### Single-click installation
+To install Adminer into your project, open your project in Zerops GUI and select **import services** in the left menu.
+Copy the following yaml file into the text area and start the import:
+```yaml
+services:
+ - # Service will be accessible through zCLI VPN under: http://adminer
+ hostname: adminer
+ # Type and version of service used.
+ type: php-apache@8.0+2.4
+ # Whether the service will be run on one or multiple containers.
+ # Since this is a utility service, using a single container is fine.
+ minContainers: 1
+ maxContainers: 1
+ # Folder name used as the root of the publicly accessible web server content.
+ documentRoot: public
+ # Link to Zerops repository that contains Adminer code with Zerops build and deploy instructions.
+ buildFromGit: https://github.com/zeropsio/recipe-adminer@main
+```
+When the import is finished, Adminer will be running as a PHP service in your project.
+## How to access Adminer
+### Use Zerops VPN
+By default Adminer service is private and is accessible from your local workstation over VPN.
+You can securely connect to MariaDB from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn)
+3. Type `http://adminer` into your browser
+:::caution
+Do not use https when connecting to Adminer via VPN.
+:::
+### Enable public access
+You can enable the public access to the Adminer service via the [Zerops subdomain].
+Or you can configure the [Public routing] on the Adminer service to make it accessible on your own domain.
+## How to install phpMyAdmin to Zerops
+[phpMyAdmin ↗](https://www.phpmyadmin.net) is a free software tool written in PHP, intended to handle the administration of MariaDB over the Web.
+### Single-click installation
+To install phpMyAdmin into your project, open your project in Zerops GUI and select **import services** in the left menu.
+Copy the following yaml file into the text area and start the import:
+```yaml
+services:
+ - # Service will be accessible through zCLI VPN under: http://phpmyadmin
+ hostname: phpmyadmin
+ # Type and version of service used.
+ type: php-apache@8.1+2.4
+ # Whether the service will be run on one or multiple containers.
+ # Since this is a utility service, using a single container is fine.
+ minContainers: 1
+ maxContainers: 1
+ # Folder name used as the root of the publicly accessible web server content.
+ documentRoot: public
+ # Link to Zerops repository that contains Adminer code with Zerops build and deploy instructions.
+ buildFromGit: https://github.com/zeropsio/recipe-phpmyadmin@main
+```
+When the import is finished, phpMyAdmin will be running as a PHP service in your project.
+## How to access phpMyAdmin
+### Use Zerops VPN
+By default phpMyAdmin service is private and is accessible from your local workstation over VPN.
+You can securely connect to MariaDB from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn)
+3. Type `http://phpmyadmin` into your browser
+:::caution
+Do not use https when connecting to phpMyAdmin via VPN.
+:::
+### Enable public access
+You can enable the public access to the phpMyAdmin service via the [Zerops subdomain].
+Or you can configure the [Public routing] on the phpMyAdmin service to make it accessible on your own domain.
+## How to use a database management tool on your workstation
+Do you already use a database management tool that supports MariaDB on your workstation? Connect it securely to MariaDB from your local workspace via Zerops VPN.
+Zerops VPN client is included into zCLI, the Zerops command-line tool. To start the VPN connection, read [how to connect to MariaDB remotely](/mariadb/how-to/connect#connect-to-mariadb-in-zerops-remotely).
+:::caution
+Do not use SSL/TLS protocols when connecting to MariaDB over VPN. Zerops MariaDB is not configured to support these protocols. The security is assured by the VPN.
+:::
+## How to use mysql CLI on your workstation
+If you use the [mysql ↗](https://dev.mysql.com/doc/refman/8.1/en/mysql.html) command-line client to manage your MariaDB on your local workspace, you can connect it securely to MariaDB via Zerops VPN.
+Zerops VPN client is included into zCLI, the Zerops command-line tool. To start the VPN connection, read [how to connect to MariaDB remotely](/mariadb/how-to/connect#connect-to-mariadb-in-zerops-remotely).
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/mariadb/how-to/connect#connect-to-mariadb-in-zerops-remotely) are available when connected through VPN. To connect to MariaDB in Zerops you have to copy the [access details](/mariadb/how-to/connect#connect-to-mariadb-in-zerops-remotely) manually from Zerops GUI.
+Use `mysql` command to connect to MariaDB in Zerops:
+```sh
+mysql -h [hostname] -u [user] -p [password] [database_name]
+```
+:::caution
+Do not use SSL/TLS protocols when connecting to MariaDB over VPN. Zerops MariaDB is not configured to support these protocols. The security is assured by the VPN.
+:::
+
+----------------------------------------
+
+# Mariadb > How To > Scale
+
+Zerops performs an automated scaling of hardware resources required to run your database based on its usage. If the current use of your database does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your database is under heavy load or needs to store more data, then auto scaling increases the resources for the database to make sure it runs smoothly.
+## Configure auto scaling
+To change the auto scaling settings go to the MariaDB service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU Mode
+**Shared**
+Your database gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your database gets is depended on other applications running on the same CPU core. At best case scenario your database gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your database.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+For most cases, the default parameters will work without issues. If you need to limit the cost of the MariaDB service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient MariaDB performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/mariadb/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your database needs.
+:::
+:::tip
+[Learn more](/mariadb/how-to/scale) about MariaDB auto scaling.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your database starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your database.
+
+If your database doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+The default minimum free RAM is preset according to the database type and version. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your database need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the database is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each MariaDB service. Zerops will never scale above the entered values. If your database is in [highly available mode], maximal resources are identical for all containers of the MariaDB service.
+### Not enough resources to scale up
+Zerops moves a container between physical machines only if there are not enough resources on the current physical machine to scale the container up. When this happens the behaviour is different for [highly available](/mariadb/how-to/create#highly-available) and [single container](/mariadb/how-to/create#single-container) mode.
+### Automatic scale down
+When the database no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the database from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal scaling
+Zerops provides MariaDB service in two modes: [Highly available](/mariadb/how-to/create#highly-available) and [Single container](/mariadb/how-to/create#single-container). The MariaDB service mode is chosen when creating a new service and cannot be changed later.
+Zerops doesn't scale MariaDB service horizontally, it means no containers are added or removed from the database cluster. Only in case of a failure of a container or the underlying physical machine, Zerops automatically replaces the broken container with a new one.
+## Monitor database resources
+Zerops provides information about how much hardware resources the MariaDB service is currently using. Go to MariaDB service detail in Zerops GUI and select **Service dashboard & database containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Mariadb > Overview
+
+[MariaDB ↗](https://mariadb.org/) is one of the most popular open source relational databases. It’s made by the original developers of MySQL and guaranteed to stay open source.
+## Feature Highlights
+### Connect to MariaDB service
+### Others
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Mariadb > Tech Details > Cluster
+
+The following description applies only to the [highly available mode](/mariadb/how-to/create#highly-available) of the MariaDB service.
+## Description of MariaDB cluster
+MariaDB cluster in highly available mode contains 3 database containers and 2 free database proxies.
+#### 1 write node + 2 read nodes
+Zerops always keeps the 3 database containers on different physical machines. A MariaDB cluster node is installed in each database container. First a writer node is started followed by 2 read nodes. All your data is stored redundantly in 3 identical copies.
+If the container with one of the reader nodes fails, Zerops disconnects it from the MariaDB cluster. Zerops then creates a new container with a MariaDB read node inside, connects it to the cluster and starts the synchronisation of the data to the new node. Finally the broken container is deleted.
+If the container with the writer node fails, Zerops disconnects it from the MariaDB cluster and one of the read nodes is automatically promoted to the writer node. Zerops creates a new container with a MariaDB read node inside, connects it to the cluster and starts the synchronisation of the data to the new node. Finally the broken container is deleted.
+#### 2 database proxies
+Zerops uses [MaxScale 2.5 ↗](https://mariadb.com/kb/en/maxscale/), this database proxy is optimised specifically for MariaDB. MaxScale database proxy understands the mysql protocol. It forwards all **write requests** to the writer node and all **read requests** to read nodes.
+Zerops creates 2 containers with MaxScale database proxy and connects them to the database cluster in the highly available infrastructure. Zerops always keep the 2 database proxies on different physical machines.
+If a container with the database proxy fails, Zerops starts a new container automatically. Database proxy doesn't contain any data therefore the start of the new database proxy is fast.
+## Synchronous vs. Asynchronous replication
+#### Synchronous replication
+Synchronous replication guarantees that when a change happens on the write node, it is replicated on the read nodes synchronously. Synchronous replication uses a distributed locking which proved to be very slow. The data replication from the write node to the read nodes takes some time and the write transactions must wait until the changed data is successfully replicated to all database nodes. In case one of the database nodes is overloaded, the whole cluster becomes very slow.
+#### Asynchronous replication
+Asynchronous replication gives no guarantees about the delay between applying changes on the write node and the propagation of changes to all read nodes. The delay is usually very short but when one of the read containers is overloaded the delay can be longer. The main benefit of the asynchronous replication is the performance. Write transaction is completed when the write node successfully commits the transaction locally and writes it to the write-ahead log that prevents the loss of data.
+The downside of the asynchronous replication is no guarantee that the read nodes will always return the current data. In some cases a `SELECT` query that quickly follows the previous `COMMIT` may return old data. As mentioned above, the database proxy forwards all read requests to read nodes. When the read node processes the `SELECT` query before the replication of the previous transaction is finished, old data is returned.
+Zerops uses the asynchronous replication in MariaDB cluster.
+## How to deal with situations when old data is returned
+#### Use explicit transactions
+MariaDB cluster returns old data most often when you use the `SELECT` query right after the `COMMIT` in the same algorithm. This problem can be solved by moving the `SELECT` query into the transaction. All queries inside a `BEGIN..COMMIT` transaction are always executed against the write node.
+#### Enable synchronous checks for SELECT queries
+For a critical read that must have the most up-to-date data use the `wsrep_sync_wait` option:
+```sh
+SET SESSION wsrep_sync_wait=1;
+SELECT ...;
+SET SESSION wsrep_sync_wait=0;
+```
+When the `wsrep_sync_wait=1` option is used, the read node will synchronise data from the write node before executing the query. The read node will wait until all updates from the write node that were committed before the `SELECT` query was received and only then executes the query.
+
+----------------------------------------
+
+# Mariadb > Tech Details > Limitations
+
+The following description applies only to the [highly available mode](/mariadb/how-to/create#highly-available) of the MariaDB service.
+#### InnoDB only
+Only the InnoDB storage engine is supported.
+#### Mandatory table primary key
+All database tables should have a primary key. A multi-column primary key can also be used. `DELETE` operations are unsupported on tables without a primary key. Also, rows in tables without a primary key may appear in a different order on different nodes.
+#### Limited locks support
+No support for explicit locks, including `LOCK TABLES`, `FLUSH TABLES {explicit table list} WITH READ LOCK`, `GET_LOCK`, `RELEASE_LOCK`. These limitations can be overcome using transactions. Global locking operators like `FLUSH TABLES WITH READ LOCK` are supported.
+#### Do not use local exports
+Do not use `SELECT INTO OUTFILE` or `SELECT INTO DUMPFILE` commands. It will create a file on one of the database containers that will receive the request. Zerops doesn't support direct access into the MariaDB database containers so you won't be able to access the file. Learn more about [how to export and import MariaDB data](/mariadb/how-to/export-import-data).
+[Full list of MariaDB cluster limitations ↗](https://mariadb.com/kb/en/mariadb-galera-cluster-known-limitations/)
+
+----------------------------------------
+
+# Mariadb > Tutorial > Quickstart
+
+As said, there is no need for coding yet, we have created multiple repositories, **_recipes_**, containing a PostgreSQL service with a simple web application. The repo will be used as a source from which the app will be built.
+ Ghost is an open source blogging platform that can be used as a headless CMS.
+ This recipe showcases how to properly setup and run Ghost on Zerops.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. Choose a recipe based on your desired technology and copy the content of the yaml config in a `README` file
+3. In Zerops GUI, in the **Projects** box click on **Import a project** and paste the config.
+4. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://golang1-24-8080.prg1.zerops.app`.
+2. Click on the `subdomain` URL to open it in a browser and you should see:
+```
+Entry added successfully with random data: f47ac10b-58cc-0372-8567-0e02b2c3d479. Total count: 1
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation, and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Mariadb > Tutorial > Step By Step
+
+Choose from the technologies below and follow the guide:
+:::tip
+Have you got any additional question? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Meilisearch > Overview
+
+Deploy and manage Meilisearch on a fully managed infrastructure. Get instant access to fast, typo-tolerant search with zero operational overhead.
+## Supported Versions
+Currently supported Meilisearch versions:
+Import configuration version:
+## Service Configuration
+Our Meilisearch implementation runs as a **single-node** setup, as Meilisearch does not currently support cluster configurations.
+### Environment Modes
+:::note
+Environment mode affects the availability of certain features and can impact your application's security. Choose carefully based on your use case.
+:::
+#### Production Mode (Default)
+- Optimized for performance and security
+- Search Preview (Mini-dashboard) disabled
+- Recommended for production deployments
+#### Development Mode
+- Includes Search Preview (Mini-dashboard)
+- Enhanced debugging capabilities
+- Suitable for development and testing
+To switch between modes:
+1. Navigate to the **Environment variables** section in the Meilisearch service detail and scroll to the **Generated Variables**
+2. Set the `environment` variable to either:
+ - `production` - for production mode (default)
+ - `development` - for development mode with Mini-dashboard
+3. Restart the service to apply changes
+### API Key Management
+The service provides three pre-configured API keys, each with specific access levels:
+#### `masterKey`
+- Root access to your Meilisearch instance
+- Use only for initial setup and key management
+- **Never expose in application code or frontend**
+#### `defaultSearchKey`
+- Read-only search operations across all indices
+- Safe for frontend implementations
+- **Can be exposed in client-side code**
+#### `defaultAdminKey`
+- Full administrative access to all indices
+- For backend operations and index management
+- **Keep secure in backend services only**
+[Custom API keys](https://www.meilisearch.com/docs/reference/api/keys) provide fine-grained access control for specific use cases. For example, you might create:
+- Search-only keys for specific indices
+- Temporary keys with expiration dates
+- Keys with restricted actions for third-party integrations
+## Network Architecture & Access
+### Access Methods
+#### Public HTTPS Access
+When enabled, access via [Zerops subdomain](/features/access#public-access-through-zerops-subdomain).
+#### Internal Project Access
+Services within the same project can reach Meilisearch directly:
+```
+http://{hostname}:7700
+```
+## Quick Start Example
+Here's a minimal example of implementing search in a React application:
+```javascript
+const MEILISEARCH_URL = process.env.zeropsSubdomain;
+const SEARCH_KEY = process.env.defaultSearchKey;
+function SearchComponent() {
+ const [results, setResults] = useState([]);
+ const handleSearch = async (query) => {
+ const response = await fetch(`${MEILISEARCH_URL}/indexes/products/search`, {
+ method: 'POST',
+ headers: {
+ 'Authorization': `Bearer ${SEARCH_KEY}`,
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify({
+ q: query,
+ limit: 10
+ })
+ });
+ const data = await response.json();
+ setResults(data.hits);
+ };
+ return (
+
+ handleSearch(e.target.value)}
+ placeholder="Search products..."
+ />
+
+ {results.map(hit => (
+ {hit.name}
+ ))}
+
+ );
+}
+```
+## Best Practices
+#### Security
+- Store sensitive keys (`masterKey`, `defaultAdminKey`) securely in backend services
+- Use `defaultSearchKey` or custom keys with minimal permissions for frontend
+- Rotate custom keys periodically
+#### Performance
+- Implement debouncing for search inputs
+- Cache frequently accessed search results
+- Monitor response times and adjust index settings
+- Use appropriate batch sizes for bulk operations
+#### Error Handling
+- Implement retry logic for temporary failures
+- Set appropriate timeout values for your use case
+- Handle rate limiting gracefully
+## Troubleshooting
+### Common Issues
+#### Connection Problems
+- Check if your instance is in the correct environment mode
+- Ensure your API keys have the necessary permissions
+- Confirm your service is running and healthy in the Zerops dashboard
+#### Search Performance
+- Review your index settings for optimal search performance
+- Monitor your instance's resource usage
+- Consider implementing client-side caching for frequent searches
+#### API Key Issues
+- Verify you're using the correct key type for your operation (search vs. admin)
+- Check key permissions match your intended operations
+- Ensure keys are properly formatted in your Authorization header
+- Remember that master and admin keys should never be used in frontend code
+## Learn More
+- [Official Meilisearch Documentation](https://www.meilisearch.com/docs) - Comprehensive guide to all Meilisearch features and capabilities
+- [API Reference](https://www.meilisearch.com/docs/reference/api/overview) - Detailed API specifications and usage examples
+## Support
+For advanced configurations or custom requirements:
+- Join our [Discord community](https://discord.gg/zeropsio)
+- Contact support via [email](mailto:support@zerops.io)
+
+----------------------------------------
+
+# Nats > Overview
+
+Zerops provides a fully managed [NATS](https://nats.io/) messaging system with automated scaling and zero infrastructure overhead, letting developers focus entirely on development.
+## Supported Versions
+Currently supported NATS version:
+Import configuration version:
+## Service Configuration
+Our NATS implementation features optimized default settings designed for common use cases.
+**Key configuration aspects** include:
+- Standard protocol port `4222` for client connections
+- HTTP monitoring interface `8222` for management
+- Secure authentication with automatically generated credentials
+- Optimized settings for performance and reliability
+You can fine-tune your NATS service by adjusting **environment variables**:
+### Available Configuration Options
+:::note
+If certain variables are not visible in your configuration, they may have been introduced after your service was created. Simply add them as [secret variables](/features/env-variables#2-secret-variables) to access the functionality.
+:::
+
+ Variable
+ Description
+
+ MAX_PAYLOAD
+ Defines the maximum allowed message size for all NATS traffic. Default: 8MB, Maximum: 64MB. See NATS limits documentation for details.
+
+ JET_STREAM_ENABLED
+ Controls whether JetStream functionality is enabled. Default: 1 (enabled), Set to 0 to disable. See JetStream Configuration section below for more details.
+
+:::important
+Configuration changes require a service **restart** to take effect. While NATS itself supports configuration hot-reload, this feature will be implemented in a future Zerops update.
+:::
+After restarting, check your service logs to confirm the changes were applied successfully.
+### JetStream Configuration
+The service includes [JetStream](https://docs.nats.io/nats-concepts/jetstream) functionality **enabled by default**, providing persistent storage capabilities for your messaging workloads:
+- **Memory store**: Up to 40GB for high-performance message caching
+- **File store**: Up to 250GB for persistent storage
+- **Regular sync intervals**: Ensures data durability and consistency
+:::note
+In HA deployments, data persistence is further enhanced with 1-minute sync intervals across all nodes, ensuring robust data durability and high availability.
+:::
+This configuration provides a robust foundation for message persistence while balancing performance and reliability.
+:::tip
+Disabling JetStream can reduce resource utilization for applications that don't require message persistence.
+:::
+### Deployment Modes
+:::warning
+Deployment mode is selected during service creation and cannot be changed later.
+:::
+#### Non-HA Mode
+- Suitable for development and testing
+- Data persistence not guaranteed during node failures
+- Lower resource requirements
+#### HA Mode
+- Creates a multi-node NATS cluster
+- Configures routes between cluster nodes automatically
+- Implements [NATS clustering](https://docs.nats.io/running-a-nats-service/configuration/clustering) for high availability
+- Provides improved reliability compared to non-HA deployments
+### Authentication Management
+Authentication credentials are automatically generated and managed by the platform. The system creates a default user (`zerops`) with a secure 16-character password. You can access these credentials through:
+- The service access details in the Zerops GUI
+- Environment variables in your service configuration:
+ - `user` - Username for authentication (default: "zerops")
+ - `password` - Generated secure password
+ - `connectionString` - Complete connection string in the format `nats://${dbUser}:${dbPassword}@${hostname}:${port}`
+## Health Monitoring
+Zerops continuously monitors your NATS service health using built-in health checks:
+- **HTTP Health Check**: The system checks the `/healthz` endpoint at port 8222
+- **Self-Healing**: The platform automatically recovers unhealthy nodes when issues are detected
+### Health Status
+You can check the health status of your NATS service:
+1. Through the Zerops GUI dashboard
+2. By accessing the management interface at port `8222`
+## Backup and Recovery
+Zerops provides built-in backup functionality for your NATS JetStream data, ensuring your message streams and configurations can be safely preserved and restored when needed.
+### Backup Process
+Backups are created in `.tar.gz` format using the `nats` backup command. They are saved to local disk, compressed, streamed to backup storage, and then deleted locally.
+For general information about backup frequency and storage limits, see our [Backup documentation](/features/backup).
+## Support
+For advanced configurations or custom requirements:
+- Join our [Discord community](https://discord.gg/zerops)
+- Contact support via [email](mailto:support@zerops.io)
+
+----------------------------------------
+
+# Nginx > Faq
+
+ Question: How do I enable SEO optimization with prerender.io?
+Answer:
+ Zerops provides built-in prerender.io support. Simply set the `PRERENDER_TOKEN` environment variable with your prerender.io service token. See our [prerender.io documentation](/nginx/how-to/env-variables#prerenderio-support) for details.
+
+
+----------------------------------------
+
+# Nginx > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing Nginx application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](/nginx/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple Nginx web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Nginx > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](/nginx/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](/nginx/how-to/build-pipeline#ports) `80`, simply use `http://app:80`
+:::info
+Do not use `https://` when communicating with Nginx from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use Nginx environment variables
+Zerops creates default environment variables for each Nginx static service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](/nginx/how-to/env-variables#generated-env-variables) of the Nginx static service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](/nginx/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your Nginx application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access Nginx application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/nginx/how-to/env-variables) are available when connected through VPN. To connect to your Nginx application in Zerops set the hostname and [internal port](/nginx/how-to/build-pipeline#ports) e.g. http://app:80
+:::info
+Do not use `https://` when communicating with Nginx over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your Nginx static service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your Nginx static service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/nginx/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Nginx > How To > Build Pipeline
+
+export const languages = [
+ { name: "Node.js", link: "/nodejs/how-to/build-pipeline" },
+ { name: "PHP", link: "/php/how-to/build-pipeline" },
+ { name: "Python", link: "/python/how-to/build-pipeline" },
+ { name: "Go", link: "/go/how-to/build-pipeline" },
+ { name: ".NET", link: "/dotnet/how-to/build-pipeline" },
+ { name: "Rust", link: "/rust/how-to/build-pipeline" },
+ { name: "Java", link: "/java/how-to/build-pipeline" },
+]
+Zerops provides a customizable build and runtime environment for your static content.
+Zerops supports different build environments:
+If you just need to deploy your static content, use the [manual deploy](/nginx/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) via Zerops CLI.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: nodejs@latest
+ # OPTIONAL. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # REQUIRED. Build your application
+ buildCommands:
+ - npm i
+ - npm run build
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - dist
+ - package.json
+ - node_modules
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ cache: node_modules
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: nginx@latest
+ # OPTIONAL. Customize the runtime Nginx environment by installing additional
+ # dependencies to the base Nginx runtime environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Nginx application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # OPTIONAL. Customize the folder that will be used as the root of the publicly
+ # accessible web server content. Enter the path relative to the /var/www folder.
+ documentRoot: public
+ # OPTIONAL. Sets the custom Nginx configuration. The file must be deployed in
+ # the runtime container. Enter the path to the file relative to the /var/www folder
+ siteConfigPath: site_config.tmpl
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your Nginx application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current Nginx version for your runtime.
+Following options are available for Nginx builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. 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
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the
+ selected major version of Nginx, Zerops command line tool and `composer`, `git` and `wget`.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. 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
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customize your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customized.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+:::info
+If no ports are specified, Zerops adds the port TCP 80 automatically.
+:::
+:::caution
+If you want the web server to listen on other port(s) than `:80`, you must [customize](/nginx/how-to/customize-web-server) your web server configuration as well.
+:::
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a Nginx static service with hostname = "app" and port = 80 from another service of the same project, simply use `app:80`. Read more about [how to access a Nginx static service](/nginx/how-to/access).
+:::info
+Do not use the port **:443**. All the incoming traffic is terminated on the Zerops internal balancer where the SSL certificate is installed and the request is forwarded to your Nginx static service as a **http://** on the port **:80**.
+:::
+Each port has following attributes:
+
+ Parameter
+ Description
+
+ port
+ Defines the port number. You can set any port number between 10 and 65435. Ports outside this interval are reserved for internal Zerops systems.
+
+ protocol
+ Optional. Defines the protocol. Allowed values are TCP or UDP. Default value is TCP.
+
+ httpSupport
+ Optional. httpSupport = true is the default setting for TCP protocol. Set httpSupport = false if a web server isn't running on the port. Zerops uses this information for the configuration of public access. httpSupport = true is available only in combination with the TCP protocol.
+
+### prepareCommands
+_OPTIONAL._ Customizes the Nginx runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base Nginx environment contains {data.alpine.default}, the selected
+ major version of Nginx, Zerops command line tool and `composer`, `git` and `wget`. To install
+ additional packages or tools add one or more prepare commands:
+```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 Nginx runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/nginx/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/nginx/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+
+When the prepare cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances.
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.default}, the
+ selected major version of Nginx, Zerops command line tool and `composer`, `git` and `wget`.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the build section of your chosen technology.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare: ./runtime-config.yaml
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base Nginx runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Nginx application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your Nginx application is started.
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](/nginx/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](/nginx/how-to/build-pipeline#preparecommands) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](/nginx/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances.
+### documentRoot
+_OPTIONAL._ Customizes the folder that will be used as the root of the publicly accessible web server content.
+:::info
+By default, the document root is configured to `/var/www`.
+:::
+Customize the folder that will be used as the root of the publicly accessible web server content. Enter the path relative to the `/var/www` folder.
+E.g. `documentRoot: public` will set the web server document root to `/var/www/public`.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the folder that will be used as the root of the publicly
+ # accessible web server content. Enter the path relative to the /var/www folder.
+ documentRoot: public
+```
+### siteConfigPath
+_OPTIONAL._ Sets the custom Nginx configuration.
+:::info
+If you don't set your custom configuration Zerops applies the [default](/nginx/how-to/customize-web-server#default-nginx-configuration) configuration.
+:::
+The file must be deployed in the runtime container. Enter the path to the file relative to the `/var/www` folder.
+Read more about the [web server customization](/nginx/how-to/customize-web-server).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/nginx/how-to/env-variables) in Zerops.
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the folder that will be used as the root of the publicly
+ # accessible web server content. Enter the path relative to the /var/www folder.
+ documentRoot: public
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Nginx application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the folder that will be used as the root of the publicly
+ # accessible web server content. Enter the path relative to the /var/www folder.
+ documentRoot: public
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](/nginx/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](/nginx/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Nginx application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](/nginx/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Nginx > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart Nginx static service in Zerops GUI
+To stop the Nginx static service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped Nginx static service choose the **Start** item from the same menu.
+To restart the Nginx static service choose the **Restart** item from the same menu.
+## Stop and start Nginx using zCLI
+zCLI is the Zerops command-line tool. To stop and start the Nginx static service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Nginx > How To > Create
+
+The Nginx static service contains the Nginx web server optimized for your static content. Nginx static service is highly scalable and customisable to suit both development and production.
+## Create Nginx static service using Zerops GUI
+First, set up a project in Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new Nginx static service:
+### Choose Nginx version
+Following Nginx versions are currently supported:
+:::info
+You can [change](/nginx/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app","cache", "gui" etc. Duplicate services with the same name in the same project are forbidden.
+#### Limitations:
+- maximum 25 characters
+- must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created. It can't be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as password, tokens, salts, certificates etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting the secret environment variables is optional. You can set them later in Zerops GUI.
+Read more about [different types of env variables](/nginx/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Set auto scaling configuration
+Zerops scales the Nginx static services automatically both vertically and horizontally. Vertical scaling means increasing or decreasing the hardware resources (CPU, RAM and disk) of a Nginx container. Horizontal scaling adds or removes whole containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Nginx static service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Nginx static service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Nginx performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/nginx/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+:::info
+You can change the vertical auto scaling parameters later.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Nginx static service. When your Nginx static service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Nginx static service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](/nginx/how-to/scaling) about Nginx auto scaling.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Create Nginx static service using zCLI
+zCLI is the Zerops command-line tool. To create a new Nginx static service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/nginx/how-to/create#create-a-project-description-file)
+3. [Create a project with a Nginx and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### Basic example:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in nginx@{version} format
+ type: nginx@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one Nginx version 8.1 service with default [auto scaling](/nginx/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/nginx/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Nginx static service
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in nginx@{version} format
+ type: nginx@latest
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create secret env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain an Nginx static service with `app` hostname. The internal port(s) the service listens on will be defined later in the [zerops.yaml](/nginx/how-to/build-pipeline#ports). Nginx static service will run on version 1.22 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+ Limitations
+
+ name
+ The name of the new project. Duplicates are allowed.
+
+ description
+ Optional. Description of the new project.
+ Maximum 255 characters.
+
+ tags
+ Optional. One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects.
+
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains an Nginx static service but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [nginx service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+ All verticalAutoscaling attributes are optional. Not specified
+ attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers
+ for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value
+ map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add Nginx static service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in nginx@{version} format
+ type: nginx@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Nginx static service version 1.22 with default [auto scaling](/nginx/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Nginx > How To > Customize Runtime
+
+
+The default Nginx runtime environment contains:
+- {data.alpine.default}
+- Selected version of Nginx when the runtime service was created.
+- [zCLI](/references/cli)
+- Git and Composer
+:::note
+To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yaml/specification#os--1) attribute.
+Additional packages and tools can be installed using [run.prepareCommands](/zerops-yaml/specification#preparecommands--1).
+:::
+### Runtime Flow
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/nginx/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the run.prepareCommands commands in the defined order
+### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/nginx/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+The prepare runtime container is automatically deleted after the prepare runtime phase has finished or failed.
+### Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the build.addToRunPrepare and run.prepareCommands attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+
+----------------------------------------
+
+# Nginx > How To > Customize Web Server
+
+## Default Nginx configuration
+The default Nginx static service has following configuration:
+```
+server {
+ listen 80 default_server;
+ listen [::]:80 default_server;
+ server_name _;
+ root {{.DocumentRoot}};
+ location / {
+ try_files $uri $uri/ /index.html;
+ }
+ access_log syslog:server=unix:/dev/log,facility=local1,tag=nginx,severity=info default_short;
+ error_log syslog:server=unix:/dev/log,facility=local1,tag=nginx,severity=error;
+}
+```
+The configuration contains 2 variables:
+- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yaml`. If the attribute is not specified, the default value `/var/www` is used.
+## Customize Nginx configuration
+Follow these steps to customize the Nginx configuration in Nginx static service:
+1. Create a **.tmpl** file with the Nginx configuration in your repository.
+2. Optionally use following variables:
+- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yaml`. If the attribute is not specified, the default value `/var/www` is used.
+Example:
+```
+root {{.DocumentRoot}};
+```
+- **`{{.Environment.ENV_NAME}}`** is replaced by the [env variable](/nginx/how-to/env-variables) value. The env variable must be either defined in [run.envVariables](/nginx/how-to/build-pipeline#envvariables) in `zerops.yaml` or set as a [secret](/nginx/how-to/env-variables#set-secret-env-variables-in-zerops-gui) or [generated](/nginx/how-to/env-variables#generated-env-variables) env variable in Zerops GUI.
+:::caution
+Use the **.tmpl** file extension to make Zerops interpret the file as a template. Zerops will replace the supported variables listed above.
+:::
+3. Check that your Nginx configuration is consistent with Zerops requirements:
+- Do not use IP addresses in the `listen` directive
+- If you use other ports than `:80` in the `listen` directive, add them to the `run.ports` in your `zerops.yaml` as well.
+- Do not use the port **:443**. All the incoming `https://` traffic is terminated on the Zerops internal balancer where the SSL certificate is installed and the request is forwarded to your Nginx static service as a **http://** on the port **:80**.
+4. Add the `siteConfigPath` to the run section of your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: nodejs@latest
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - vendor
+ - public
+ # ==== how to run your application ====
+ run:
+ documentRoot: public
+ # OPTIONAL. Sets the custom Nginx or Apache configuration. The file must be deployed in the runtime container. Enter the path to the file relative to the /var/www folder
+ siteConfigPath: site_config.tmpl
+```
+5. Ensure that the `build.deployFiles` contains the folder with the `siteConfigPath` or add the path to the Nginx config file to the `deployFiles` list. Zerops will deploy the file to the runtime container(s).
+6. [Trigger](/nginx/how-to/trigger-pipeline) the build & deploy pipeline.
+### Built-in Prerender.io Support
+The default Nginx configuration includes automatic prerender.io support for SEO optimization. When `PRERENDER_TOKEN` is set, Nginx will automatically serve pre-rendered content to search engines and social media crawlers.
+See [environment variables](/nginx/how-to/env-variables#prerenderio-support) for configuration details.
+
+----------------------------------------
+
+# Nginx > How To > Delete
+
+## Delete Nginx static service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete Nginx using zCLI
+zCLI is the Zerops command-line tool. To delete the Nginx static service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Nginx > How To > Deploy Process
+
+
+## Application artefact
+If you triggered the deploy pipeline [manually](/nginx/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/nginx/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/nginx/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/nginx/how-to/build-pipeline#initcommands)
+4. Starts your application
+5. Optionally waits until the [readiness check](/nginx/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/nginx/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customize the runtime environment](/nginx/how-to/customize-runtime).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The Nginx process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready as soon as it is started, configure a [readiness check](/nginx/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your Nginx static service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/nginx/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Nginx > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+
+ Type
+ Environment
+ Defined in
+
+ basic
+ build
+ zerops.yaml
+
+ basic
+ runtime
+ zerops.yaml
+
+ secret
+ runtime
+ Zerops GUI
+
+Use the [secret env variables](/nginx/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](/nginx/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/nginx/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](/nginx/how-to/create) a new Nginx static service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made to environment variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The Nginx process running in the container receives the list env variables only when it starts. Update of the env variables while the Nginx process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+These restrictions apply to all [types of env variables](/nginx/how-to/env-variables#types-of-env-variables-in-zerops).
+## Referencing other env variables
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your Nginx runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the Nginx static service. The Nginx process running in the container receives the list env variables only when it starts. Update of the env variables while the Nginx process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a Nginx static service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your Nginx app
+Zerops passes all environment variables from all project services when your Nginx app is deployed and started.
+To access the local environment variable i.e. the variable set to this Nginx static service in your app, use:
+```sh
+getenv('YOUR_VARIABLE_KEY_HERE');
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+## Prerender.io Support
+Zerops provides built-in prerender.io support for SEO optimization. Configure it using these environment variables:
+
+ Variable
+ Required
+ Description
+ Default
+
+ PRERENDER_TOKEN
+ Yes
+ Your prerender.io service token
+ -
+
+ PRERENDER_HOST
+ No
+ Prerender service host
+ service.prerender.io
+
+:::tip
+Set `PRERENDER_TOKEN` as a secret environment variable in Zerops GUI for security.
+:::
+Example in zerops.yaml:
+```yaml
+zerops:
+ - setup: app
+ run:
+ envVariables:
+ PRERENDER_HOST: "custom.prerender.host"
+```
+
+----------------------------------------
+
+# Nginx > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Nginx > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](/nginx/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](/nginx/how-to/build-pipeline#preparecommands) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the runtime containers in Zerops CLI use
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## Nginx logging configuration
+By default Nginx static containers logs the content of Nginx access log and error log to syslog:
+```
+ access_log syslog:server=unix:/dev/log,facility=local1,tag=nginx,severity=info default_short;
+ error_log syslog:server=unix:/dev/log,facility=local1,tag=nginx,severity=error;
+```
+The syslog messages are stored and are accessible as a runtime log in Zerops GUI or zCLI.
+
+----------------------------------------
+
+# Nginx > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the Nginx static service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Nginx static service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Nginx static service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient performance or capacity of Nginx static service, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Nginx static service. When your Nginx static service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Nginx static service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 62.5 MB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each Nginx static service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the Nginx static service.
+### Not enough resources to scale up
+If one of the Nginx containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the Nginx static service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor Nginx resources
+Zerops provides information about how much hardware resources the Nginx static service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Nginx > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your Nginx static service directly when creating a new shared storage service. Just select your Nginx static service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the Nginx static service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create Nginx static service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new Nginx static service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](#create-a-project-description-file)
+3. [Create a project with a Nginx static service and a shared storage](#create-a-project-with-nginx-static-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](/nginx/how-to/create#create-a-project-description-file) how to define the Nginx static service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Nginx and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in nginx@{version} or nginx@latest format
+ type: nginx@latest
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the Nginx static service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with Nginx static service and a shared storage
+Follow the article [How to create a project based on the description.yaml](/nginx/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Nginx > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](/nginx/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](/nginx/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](/nginx/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Nginx > How To > Upgrade
+
+You can upgrade or downgrade your Nginx static service to a different major Nginx version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/nginx/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Nginx version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Nginx version for your runtime.
+
+----------------------------------------
+
+# Nginx > Overview
+
+The Nginx static service contains the [Nginx ↗](https://nginx.org/) web server optimized for your static content.
+## How to start
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Nginx > Tutorial > Quickstart
+
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-php-hello-world), a **_recipe_**, containing the most simple Nginx web application. The repo will be used as a source from which the app will be built.
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-php-hello-world/blob/main/import-project/description.yaml)):
+```yaml
+project:
+ name: my-first-project
+services:
+ - hostname: helloworld
+ type: php-apache@8.1+2.4
+ minContainers: 1
+ maxContainers: 3
+ buildFromGit: https://github.com/zeropsio/recipe-php-hello-world@main
+ enableSubdomainAccess: true
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://helloworld-24-8080.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+Hello, World!
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Nginx > Tutorial > Runtime Sql
+
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-onboarding-php), a **_recipe_**, containing a PostgreSQL service with a simple Nginx application. The repo will be used as a source from which the app will be built.
+:::tip
+Follow the steps below and when everything is working as expected, fork the repo, try making various changes or be bold and connect your own.
+:::
+:::note
+In the detail of each step, you can find a link with more information about the topic.
+:::
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+ 2. Create a project.
+
+ Learn more about projects in Zerops. See how to
+ import a whole project into Zerops.
+
+ 3. In the left menu, click on Import services, copy & paste the
+ contents of the `import-services.yaml` config file from the recipe
+ repository of your choice. Then click on Import service.
+
+ Learn more about services in
+ Zerops and how to import a service to an existing project.
+
+ The yaml file includes a `buildFromGit` directive, which ensures
+ a one-time build from Git repository source. See how to connect a Github or Gitlab repository to be able to
+ trigger automatic builds & deploys.
+
+ 4. Several pipelines are created, one for project creation and the rest for the activation of the services. Wait for all to finish.
+
+ Learn more about how the pipelines can be triggered and about build and deploy processes of a Nginx application in Zerops.
+Learn more about how to access build log of your Nginx static service in Zerops.
+
+ 5. In the service detail, open the Public access & internal ports section, and Enable Zerops Subdomain.
+
+ Learn more about how to access your Nginx
+ static service in Zerops.
+
+ 6. Once the pipeline has finished, click on the activated subdomain URL. You should see a simple page with
+`Entry added successfully with random data: f47ac10b-58cc-0372-8567-0e02b2c3d479. Total count: 1`
+
+ Congratulations! You have created your first application in Zerops, and we hope to see your own projects soon.
+For now, check out other features, such as environment variables, runtime log and scaling.
+
+ 7. One of the services is `adminer`, a database management tool.
+ See how to access it.
+
+ Learn more about how to use `psql` command-line tool instead or how to import and export data from your database.
+
+8. Feel free to make any changes to your project, fork the repo or connect your own. Also see other Nginx and PostgreSQL recipes on our Github page.
+
+:::tip
+Have you got any additional question? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Nginx > Tutorial > Step By Step
+
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-php-hello-world), a **_recipe_**, containing the most simple Nginx web application. The repo will be used as a source from which the app will be built.
+:::tip
+Follow the steps below and when everything is working as expected, fork the repo, try making various changes or be bold and connect your own.
+:::
+:::note
+In the detail of each step, you can find a link with more information about the topic.
+:::
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+ 2. Create a project.
+
+ Learn more about projects in
+ Zerops. See how to import a whole project into Zerops.
+
+ 3. In the left menu, click on Import services, copy & paste the
+ contents of this yaml file and click on Import service.
+
+ Learn more about services in Zerops and how to import a service to an existing project.
+
+ The yaml file includes a `buildFromGit` directive, which ensures
+ a one-time build from Git repository source. See how to connect a Github or Gitlab repository to be able to
+ trigger automatic builds & deploys.
+
+ 4. Two pipelines are created, one for project creation and one for the service activation. Wait for both to finish.
+
+ Learn more about how the pipelines can be triggered and about build and deploy processes of a Nginx application in Zerops.
+Learn more about how to access build log of your Nginx static service in Zerops.
+
+ 5. In the service detail, open the Public access & internal ports section, and Enable Zerops Subdomain.
+
+ Learn more about how to access your Nginx
+ static service in Zerops.
+
+ 6. Once the pipeline has finished, click on the activated subdomain URL:
+ You should see a simple page with `Hello World!` printed.
+
+ Congratulations! You have created your first application in Zerops, and we hope to see your own projects soon.
+For now, check out other features, such as environment variables, runtime log and scaling.
+
+7. Feel free to make any changes to your project, fork the repo or connect your own. Also see other Nginx recipes on our Github page.
+
+:::tip
+Have you got any additional question? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Nodejs > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing Node.js application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](/nodejs/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple Node.js web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Nodejs > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](/nodejs/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](/nodejs/how-to/build-pipeline#ports) `3000`, simply use `http://app:3000`
+:::info
+Do not use `https://` when communicating with Node.js from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use Node.js environment variables
+Zerops creates default environment variables for each Node.js service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](/nodejs/how-to/env-variables#generated-env-variables) of the Node.js service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](/nodejs/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your Node.js application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access Node.js application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/nodejs/how-to/env-variables) are available when connected through VPN. To connect to your Node.js application in Zerops set the hostname and [internal port](/nodejs/how-to/build-pipeline#ports) e.g. http://app:3000
+:::info
+Do not use `https://` when communicating with Node.js over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your Node.js service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your Node.js service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/nodejs/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Nodejs > How To > Build Pipeline
+
+Zerops provides a customizable build and runtime environment for your Node.js application.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: nodejs@latest
+ # OPTIONAL. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # REQUIRED. Build your application
+ buildCommands:
+ - npm i
+ - npm run build
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - dist
+ - package.json
+ - node_modules
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ cache: node_modules
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: nodejs@latest
+ # OPTIONAL. Sets the internal port(s) your app listens on:
+ ports:
+ # port number
+ - port: 3000
+ # OPTIONAL. Customize the runtime Node.js environment by installing additional
+ # dependencies to the base Node.js runtime environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Node.js application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # REQUIRED. Your Node.js application start command
+ start: npm start
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your Node.js application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Build pipeline configuration
+### base
+_REQUIRED._ Sets the base technology for the build environment.
+Following options are available for Node.js builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: nodejs@latest
+ ...
+```
+ The base build environment contains {data.alpine.default}, the selected
+ major version of Node.js, Zerops command line tool, `npm`, `yarn`, `git` and `npx` tools.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base:
+ - nodejs@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
+To customize your build environment use the [prepareCommands](/nodejs/how-to/build-pipeline#preparecommands) attribute.
+:::note
+Modifying the base technology will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### os
+_OPTIONAL._ Sets the operating system for the build environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customized.
+:::
+:::note
+Changing the OS setting will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache behavior.
+:::
+### prepareCommands
+_OPTIONAL._ Customizes the build environment by installing additional dependencies or tools to the base build environment.
+The base build environment contains:
+- {data.alpine.default}
+- selected version of Node.js defined in the [base](/nodejs/how-to/build-pipeline#base) attribute
+- [Zerops command line tool](/references/cli)
+- `npm`, `yarn`, `git` and `npx` tools
+To install additional packages or tools add one or more prepare commands:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: nodejs@latest
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first build is triggered, Zerops will
+1. create a build container
+2. download your application code from your repository
+3. run the prepare commands in the defined order
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::note
+These commands are skipped when using cached environment. Modifying `prepareCommands` will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache invalidation.
+:::
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/nodejs/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all prepare commands are finished, your custom build environment is ready for the build phase.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### buildCommands
+_REQUIRED._ Defines build commands.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: nodejs@latest
+ # REQUIRED. Build your application
+ buildCommands:
+ - npm i
+ - npm run build
+ ...
+```
+At least one command is required. Zerops triggers each command in the defined order in a dedicated build container.
+Before the build commands are triggered the build container contains:
+1. base environment defined by the [base](/nodejs/how-to/build-pipeline#base) attribute
+2. optional customisation of the base environment defined in the [prepareCommands](/nodejs/how-to/build-pipeline#preparecommands) attribute
+3. your application code
+#### Run build commands as a single shell instance
+Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it.
+```yaml
+buildCommands:
+ - |
+ npm i
+ npm run build
+```
+#### Run build commands as a separate shell instances
+When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command.
+```yaml
+buildCommands:
+ - npm i
+ - npm run build
+```
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/nodejs/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the --verbose option.
+```yaml
+buildCommands:
+ - npm i --verbose
+ - npm run build
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the deploy phase.
+### deployFiles
+_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
+```yaml
+# REQUIRED. Select which files / folders to deploy after
+# the build has successfully finished
+deployFiles:
+ - dist
+ - package.json
+ - node_modules
+```
+Determines files or folders produced by your build, which should be deployed to your runtime service containers.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Examples
+Deploys a folder, and a file from the project root directory:
+```yaml
+deployFiles:
+ - dist
+ - package.json
+```
+Deploys the whole content of the build container:
+```yaml
+deployFiles: .
+```
+Deploys a folder, and a file in a defined path:
+```yaml
+deployFiles:
+ - ./path/to/file.txt
+ - ./path/to/dir/
+```
+#### How to use a wildcard in the path
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+Deploys all folders that are located in any path that begins with `/path/to/`
+```yaml
+deployFiles: ./path/to/~/
+```
+Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/
+```
+:::note Example
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+:::
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+_OPTIONAL._ Defines which files or folders will be cached for the next build.
+```yaml
+# OPTIONAL. Which files / folders you want to cache for the next build.
+# Next builds will be faster when the cache is used.
+cache: file.txt
+```
+The cache attribute helps optimize build times by preserving specified files between builds.
+The cache attribute supports the [~ wildcard character](#how-to-use-a-wildcard-in-the-path).
+Learn more about the [build cache system](/features/build-cache) in Zerops.
+### envVariables
+_OPTIONAL._ Defines the environment variables for the build environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ base: nodejs@latest
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/nodejs/how-to/env-variables) in Zerops.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current Node.js version for your runtime.
+Following options are available for Node.js builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. 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: nodejs@latest
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the
+ selected major version of Node.js, Zerops command line tool, `npm`, `yarn`, `git` and `npx` tools.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. 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:
+ - nodejs@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customize your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customized.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a Node.js service with hostname = "app" and port = 3000 from another service of the same project, simply use `app:3000`. Read more about [how to access a Node.js service](/nodejs/how-to/access).
+Each port has following attributes:
+
+ Parameter
+ Description
+
+ port
+ Defines the port number. You can set any port number between 10 and 65435. Ports outside this interval are reserved for internal Zerops systems.
+
+ protocol
+ Optional. Defines the protocol. Allowed values are TCP or UDP. Default value is TCP.
+
+ httpSupport
+ Optional. httpSupport = true is the default setting for TCP protocol. Set httpSupport = false if a web server isn't running on the port. Zerops uses this information for the configuration of public access. httpSupport = true is available only in combination with the TCP protocol.
+
+### prepareCommands
+_OPTIONAL._ Customises the Node.js runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base Node.js environment contains {data.alpine.current} the selected
+ major version of Node.js, Zerops command line tool and `npm`, `yarn`, `git` and `npx` tools. To install
+ additional packages or tools add one or more prepare commands:
+```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 Node.js runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/nodejs/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/nodejs/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.current}, the
+ selected major version of Node.js, Zerops command line tool and `npm`, `yarn`, `git` and `npx` tools.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare: ./runtime-config.yaml
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base Node.js runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Node.js application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your Node.js application is started via the [start command](/nodejs/how-to/build-pipeline#start).
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](/nodejs/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](/nodejs/how-to/build-pipeline#preparecommands-1) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](/nodejs/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/nodejs/how-to/env-variables) in Zerops.
+### start
+_REQUIRED._ Defines the start command for your Node.js application.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Node.js application start command
+ start: npm start
+```
+We recommend starting your Node.js application using `npm start`.
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Node.js application start command
+ start: npm start
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Node.js application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Node.js application start command
+ start: npm start
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+### crontab
+_OPTIONAL._ Defines cron jobs.
+Setup cron jobs in the following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ crontab:
+ # REQUIRED. Sets the command to execute:
+ - command: ""
+ # REQUIRED. Sets the interval time to execute:
+ timing: "0 * * * *"
+```
+Read more about setting up [cron](/references/cron) in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](/nodejs/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](/nodejs/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Node.js application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](/nodejs/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Nodejs > How To > Build Process
+
+
+## Customize NodeJS build environment
+The default NodeJS build environment contains:
+- {data.alpine.default}
+- Selected version of Node.js when the runtime service was created.
+- [zCLI](/references/cli)
+- NPM, Yarn, Git and NPX tools
+:::note
+To use Ubuntu instead of the default Alpine, set the [build.os](/zerops-yaml/specification#os-) attribute.
+Additional packages and tools can be installed using [build.prepareCommands](/zerops-yaml/specification#preparecommands-).
+:::
+## Description of the build process
+Zerops starts a temporary build container and performs following actions:
+1. Installs the build environment:
+ - Sets up base system and Go runtime
+ - Restores cached files if available (based on `build.cache` configuration)
+ - Validates cache against current `build.os`, `build.base`, and `build.prepareCommands`
+2. Downloads your application source code from [GitHub ↗](https://www.github.com), [GitLab ↗](https://www.gitlab.com) or via [Zerops CLI](/references/cli)
+3. Optionally [customizes the build environment](#customize-nodejs-build-environment)
+4. Runs the build commands
+5. Uploads the application artefact to the internal Zerops storage
+6. Preserves specified files for future builds (based on `build.cache` configuration)
+7. Optionally [customizes the runtime environment](/nodejs/how-to/customize-runtime)
+8. [Deploys your application](/nodejs/how-to/deploy-process)
+The build container is automatically deleted after the build has finished or failed.
+## Cancel running build
+When you know that the running build is not correct and you want to cancel it, you can do it in Zerops GUI. Go to the service detail, open the list of running processes and click on the **Open pipeline detail** button. Then click on the **Cancel build** button.
+
+:::caution
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+:::
+## Customize Node.js build environment
+The default Node.js build environment contains:
+- {data.alpine.default}
+- selected version of Node.js defined in `zerops.yaml` [build.base](/nodejs/how-to/build-pipeline#base) parameter
+- [zCLI](/references/cli), Zerops command line tool
+- `npm`, `yarn`, `git` and `npx` tools
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/nodejs/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](/nodejs/how-to/build-pipeline#preparecommands) commands to your `zerops.yaml`.
+:::info
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::
+## Node.js build hardware resources
+Build of your Node.js application is run in a separate build container with following resource configuration:
+| HW resource | Minimum | Maximum |
+| ------------- | ------- | ------- |
+| **CPU cores** | 6 | 20 |
+| **RAM** | 8 GB | 8 GB |
+| **Disk** | 1 GB | 100 GB |
+| **Disk** | 1 GB | 100 GB |
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+## Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops will terminate the build pipeline and delete the build container.
+## Troubleshooting build-related problems
+### Failure of a build prepare command
+If any [prepare command](/nodejs/how-to/build-pipeline#preparecommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/nodejs/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom build environment is ready for the build phase.
+### Invalidate the build cache
+If you encounter unexpected build behavior or dependency issues, the problem might be related to [cached build data](/features/build-cache). While Zerops maintains the build cache to speed up deployments, sometimes you may need to start fresh.
+To invalidate the build cache:
+1. Go to your service detail in Zerops GUI
+2. Choose **Pipelines & CI/CD Settings** from the left menu
+3. Click on the **Invalidate build cache** button
+This will force Zerops to run the next build clean, including all prepare commands, which can help resolve cache-related issues. After invalidation, your next build will also create a fresh cache.
+### Failure of a build command
+If any [build command](/nodejs/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/nodejs/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `--verbose` option.
+```yaml
+buildCommands:
+ - npm i --verbose
+ - npm run build
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the [deploy](/nodejs/how-to/deploy-process) phase.
+
+----------------------------------------
+
+# Nodejs > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart Node.js service in Zerops GUI
+To stop the Node.js service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped Node.js service choose the **Start** item from the same menu.
+To restart the Node.js service choose the **Restart** item from the same menu.
+## Stop and start Node.js using zCLI
+zCLI is the Zerops command-line tool. To stop and start the Node.js service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Nodejs > How To > Create
+
+Zerops provides a powerful Node.js runtime service with extensive build support. The Node.js runtime is highly scalable and customizable to suit your development and production needs. With just a few clicks or commands, you can have a production-ready Node.js environment up and running in no time.
+## Create a Node.js service using Zerops GUI
+First, set up a project in the Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu under the **Services** section. From there, you can add a new Node.js service:
+### Choose a Node.js version
+Zerops supports the following Node.js versions:
+:::info
+You can easily [upgrade](/nodejs/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app", "cache", "gui", etc. Duplicate services with the same name within the same project are not allowed.
+#### Limitations:
+- Maximum 25 characters
+- Must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created and cannot be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as passwords, tokens, salts, certificates, etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting secret environment variables is optional. You can always set them later in the Zerops GUI.
+Read more about the [different types of environment variables](/nodejs/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Configure auto scaling
+Zerops automatically scales Node.js services both vertically and horizontally. Vertical scaling adjusts the hardware resources (CPU, RAM, and disk) of a Node.js container, while horizontal scaling adds or removes entire containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. The power your application receives depends on the other applications running on the same CPU core. In the best-case scenario, your application gets 10/10 of the CPU core power, and 1/10 in the worst-case scenario.
+**Dedicated**
+The CPU core is dedicated exclusively to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+You can choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has the following default configuration:
+Node.js services always start with the minimal resources.
+In most cases, the default parameters will work without issues. If you need to limit the cost of the Node.js service, you can lower the maximum resources. Zerops will never scale above the selected maximums.
+If you experience insufficient Node.js performance or capacity, you can increase the minimum resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine-tune](/nodejs/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application's needs.
+:::
+:::info
+You can change the vertical auto scaling parameters at any time.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but is already consuming the maximum resources defined for vertical auto scaling, Zerops will add a new container to your Node.js service. When your Node.js service doesn't need as much power and all containers are vertically scaled down such that their CPU allocation is near the minimum resources, Zerops will gradually remove entire containers.
+Horizontal auto scaling has the following default configuration:
+
+ Parameter
+ Value
+
+ Minimum containers
+ 1
+
+ Maximum containers
+ 6
+
+Node.js services always start with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](/nodejs/how-to/scaling) about Node.js auto scaling in Zerops.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will automatically start a new container and deploy your application. However, the application will be unavailable for a short period. This mode is recommended for non-critical applications or development environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers based on your application's load. An application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed down to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents temporary outages in case any of the Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically, and the broken container will be deleted.
+:::caution
+Make sure your application is designed to run in multiple containers.
+:::
+## Create a Node.js service using zCLI
+zCLI is the Zerops command-line tool. To create a new Node.js service via the command line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/nodejs/how-to/create#create-a-project-description-file)
+3. [Create a project with a Node.js and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a YAML format to describe the project infrastructure.
+#### Basic example:
+Create a directory called `my-project`. Inside the `my-project` directory, create a `description.yaml` file with the following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in nodejs@{version} format
+ type: nodejs@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one Node.js version 20 service with default [auto scaling](/nodejs/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/nodejs/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Node.js and PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in nodejs@{version} format
+ type: nodejs@latest
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+ - # second service hostname
+ hostname: db
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain a Node.js service and a [PostgreSQL](/postgresql/overview) service.
+Node.js service with "app" hostname, the internal port(s) the service listens on will be defined later in the [zerops.yaml](/nodejs/how-to/build-pipeline#ports). Node.js service will run on version 20 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+ Limitations
+
+ name
+ The name of the new project. Duplicates are allowed.
+
+ description
+ Optional. Description of the new project.
+ Maximum 255 characters.
+
+ tags
+ Optional. One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects.
+
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains Node.js and PostgreSQL services but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ The hostname of the new database will be set to the `hostname` value.
+
+ Limitations:
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [Node.js service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+
+ All verticalAutoscaling attributes are optional. Not specified attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add Node.js service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in nodejs@{version} format
+ type: nodejs@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Node.js service version 20 with default [auto scaling](/nodejs/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Nodejs > How To > Customize Runtime
+
+
+### Runtime Environment
+The default Node.js runtime environment contains:
+- {data.alpine.default}
+- Selected version of Node.js when the runtime service was created.
+- [zCLI](/references/cli)
+- NPM, Yarn, Git and NPX tools
+:::note
+To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yaml/specification#os--1) attribute.
+Additional packages and tools can be installed using [run.prepareCommands](/zerops-yaml/specification#preparecommands--1).
+:::
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. Create a prepare runtime container
+2. Optionally: [copy selected folders or files from your build container](/nodejs/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. Run the run.prepareCommands in the defined order
+### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/nodejs/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+The prepare runtime container is automatically deleted after the prepare runtime phase has finished or failed.
+### Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the build.addToRunPrepare and run.prepareCommands attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+
+----------------------------------------
+
+# Nodejs > How To > Delete
+
+## Delete Node.js service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete Node.js using zCLI
+zCLI is the Zerops command-line tool. To delete the Node.js service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Nodejs > How To > Deploy Process
+
+
+## Application artefact
+When the [build phase](/nodejs/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](/nodejs/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/nodejs/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/nodejs/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/nodejs/how-to/build-pipeline#initcommands)
+4. Starts your application using the [start command](/nodejs/how-to/build-pipeline#start)
+5. Optionally waits until the [readiness check](/nodejs/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/nodejs/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customize the runtime environment](/nodejs/how-to/build-pipeline#preparecommands-1).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The Node.js process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready to handle requests right after it is started via the [start command](/nodejs/how-to/build-pipeline#start), configure a [readiness check](/nodejs/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your Node.js service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/nodejs/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Nodejs > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+
+ Type
+ Environment
+ Defined in
+
+ basic
+ build
+ zerops.yaml
+
+ basic
+ runtime
+ zerops.yaml
+
+ secret
+ runtime
+ Zerops GUI
+
+Use the [secret env variables](/nodejs/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](/nodejs/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/nodejs/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](/nodejs/how-to/create) a new Node.js service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made to environment variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The Node.js process running in the container receives the list env variables only when it starts. Update of the env variables while the Node.js process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+These restrictions apply to all [types of env variables](/nodejs/how-to/env-variables#types-of-env-variables-in-zerops).
+## Referencing other env variables
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your Node.js runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the Node.js service. The Node.js process running in the container receives the list env variables only when it starts. Update of the env variables while the Node.js process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a Node.js service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your Node.js app
+Zerops passes all environment variables from all project services when your Node.js app is deployed and started.
+To access the local environment variable i.e. the variable set to this Node.js service in your app, use:
+```sh
+process.env.YOUR_VARIABLE_KEY_HERE
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+
+----------------------------------------
+
+# Nodejs > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Nodejs > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](/nodejs/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](/nodejs/how-to/build-pipeline#preparecommands-1) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the runtime containers in Zerops CLI use
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## Node.js logging configuration
+Zerops logs all messages sent
+- to the standard error (`stderr`)
+- to the standard output (`stdout`)
+- via the Node.js `console.log` method
+### Severity level
+By default the `console.log` creates a message with the `Informational (6)` severity.
+Add a severity number in the `` format as a prefix to set a custom severity as shown below:
+```js
+console.log('A message with the informational severity ...');
+console.log('Emergency (0) severity > system is unusable.');
+console.log('Alert (1) severity > action must be taken immediately.');
+console.log('Critical (2) severity > critical conditions.');
+console.log('Error (3) severity > error conditions.');
+console.log('Warning (4) severity > warning conditions.');
+console.log('Notice (5) severity > normal, but significant, condition.');
+console.log('Informational (6) severity > informational message.');
+console.log('Debug (7) severity > debug-level message.');
+```
+:::info
+`console.info`, `console.warn`, `console.debug`
+, and `console.error` are just aliases to the `
+ console.log
+` method. They don't set the appropriate severity number. Use the `
+ <N>
+` prefix instead. :::
+
+----------------------------------------
+
+# Nodejs > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the Node.js service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Node.js service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Node.js service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Node.js performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Node.js service. When your Node.js service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Node.js service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each Node.js service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the Node.js service.
+### Not enough resources to scale up
+If one of the Node.js containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the Node.js service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor Node.js resources
+Zerops provides information about how much hardware resources the Node.js service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Nodejs > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your Node.js service directly when creating a new shared storage service. Just select your Node.js service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the Node.js service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create Node.js service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new Node.js service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/nodejs/how-to/shared-storage#create-a-project-description-file)
+3. [Create a project with a Node.js service and a shared storage](/nodejs/how-to/shared-storage#create-a-project-with-a-nodejs-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](/nodejs/how-to/create#create-a-project-description-file) how to define the Node.js service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Node.js and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in nodejs@{version} format
+ type: nodejs@latest
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the Node.js service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with a Node.js service and a shared storage
+Follow the article [How to create a project based on the description.yaml](/nodejs/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Nodejs > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](/nodejs/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](/nodejs/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](/nodejs/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Nodejs > How To > Upgrade
+
+You can upgrade or downgrade your Node.js service to a different major Node.js version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/nodejs/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Node.js version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Node.js version for your runtime.
+If you want to build your application with a different major Node.js version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
+
+----------------------------------------
+
+# Nodejs > Overview
+
+[Node.js ↗](https://nodejs.org/en) is an asynchronous event-driven JavaScript runtime, which is designed to build scalable network applications.
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-nodejs), a **_recipe_**, containing the most simple Node.js web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of Node.js app running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-nodejs/blob/main/zerops-project-import.yaml)):
+```yaml
+project:
+ name: recipe-nodejs
+ tags:
+ - zerops-recipe
+services:
+ - hostname: api
+ type: nodejs@20
+ enableSubdomainAccess: true
+ buildFromGit: https://github.com/zeropsio/recipe-nodejs
+ - hostname: db
+ type: postgresql@16
+ mode: NON_HA
+ priority: 1
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://helloworld-24-8080.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+Hello, World!
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+## How to start
+It doesn't matter whether it's your first curious introduction to Zerops, you have already mastered the basics and are looking for a tiny detail or inspiration. Below, choose a section that fits your needs:
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Object Storage > How To > Access
+
+Zerops Object storage is powered by [MinIO](https://min,io), a high-performance, S3 compatible object store. Object storage services are operated on an independent infrastructure separated from your other project services. You can access the object storage from any service hosted in Zerops or remotely over the internet.
+## Object storage bucket
+Zerops creates one bucket automatically for each new Object storage service.
+:::note
+Each Object storage service can only contain one bucket. If your application needs multiple buckets, add more Object storage services.
+:::
+#### Name
+Bucket is created with a name based on the selected service name and a random prefix. The name of the bucket cannot be changed later.
+#### Access policy
+The bucket's access policy was defined when the Object storage service was created. You can [change it] later in Zerops GUI.
+#### Quota
+The bucket quota size was defined when the Object storage service was created. You can [change it] later in Zerops GUI.
+## Copy access details from Zerops GUI
+You will find the Object storage access details under the **Access details** button in the project dashboard page.
+The same information is available in the service detail page under the **Access & bucket details** menu.
+
+### Object storage access parameters
+| Parameter | Description |
+| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **API URL** | URL of the Object storage service |
+| **Bucket Name** | Bucket is created with a name based on the selected service name and a random prefix. The name of the bucket is fixed and cannot be changed later. |
+| **Access Key ID** | The S3 Access Key ID |
+| **Secret Key** | The S3 Secret Key |
+| **Secret Key** | The S3 Secret Key |
+## Use Object storage environment variables
+Zerops creates default environment variables for each Object storage service to help you with connection from any runtime services in the same project. To avoid the need to copy Object storage access parameters manually, use environment variables in your runtime service.
+### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service name and underscore.
+#### Example
+To access the `bucketName` env variable of the `upload` service, use `upload_bucketName` as the env variable key. To access the `secretAccessKey` env variable of the `storage` service, use `storage_secretAccessKey` as the env variable key.
+### Object storage environment variables
+List of service environment variables is available in Zerops GUI. Go to an Object storage service detail and choose **Environment variables** in the left menu.
+
+Zerops creates following environment variables when the Object storage service is created:
+| Variable | Description |
+| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **apiUrl** | URL of the Object storage service |
+| **accessKeyId** | The S3 Access Key ID |
+| **secretAccessKey** | The S3 Secret Key |
+| **bucketName** | Bucket is created with a name based on the selected service name and a random prefix. The name of the bucket is fixed and cannot be changed later. |
+| **quotaGBytes** | The bucket quota in GB. |
+| **projectId** | ID of the project. Generated by Zerops. |
+| **serviceId** | ID of the Object storage service. Generated by Zerops. |
+| **hostname** | The name of the Object storage service. |
+| **hostname** | The name of the Object storage service. |
+
+----------------------------------------
+
+# Object Storage > How To > Create
+
+Zerops provides a S3 compatible Object storage service to store your files. Zerops Object storage is powered by [MinIO](https://min.io), a high-performance, S3 compatible object store. MinIO is built for large scale AI/ML, data lake and database workloads.
+## Create Object storage service using Zerops GUI
+First, set up a project in Zerops GUI and add a runtime service. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new Object storage service:
+### Set a name
+Enter a unique service identifier like `storage`,`s3` etc. Duplicate services with the same name in the same project are forbidden.
+#### Limitations:
+maximum 25 characters
+must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::note
+The name is fixed after the service is created. It can't be changed later.
+:::
+### Object storage bucket
+Zerops creates one bucket automatically for each new Object storage service.
+:::note
+Each Object storage service can only contain one bucket. If your application needs multiple buckets, add more Object storage services.
+:::
+#### Name
+Bucket will be created with a name based on the given service name and a random prefix. The name of the bucket cannot be changed later.
+#### Access policy
+Select one of the basic policy templates:
+
+ Template
+ Description
+
+ Public read
+
+ Allows anyone:
+
+ to read the bucket's location `(s3:GetBucketLocation)`
+ to list all bucket's objects `(s3:ListBucket)`
+ to get any object of the bucket `(s3:GetObject)`
+
+ Public objects read
+
+ Allows anyone:
+
+ to read the bucket's location `(s3:GetBucketLocation)`
+ to get any object of the bucket `(s3:GetObject)`
+
+ Public read write
+
+ Allows anyone:
+
+ to read the bucket's location `(s3:GetBucketLocation)`
+ to list all bucket's objects `(s3:ListBucket)`
+ to get any object of the bucket `(s3:GetObject)`
+ to create a new object in the bucket `(s3:PutObject,s3:ListMultipartUploadParts, s3:AbortMultipartUpload, s3:ListBucketMultipartUploads)`
+ to delete any object of the bucket `(s3:DeleteObject)`
+
+ Public write
+ Allows anyone to create objects in the bucket `(PutObject action)`
+
+ Private
+ Denies the access to unauthenticated users.
+
+Or you can set your own access policy in the [IAM Policy JSON format](https://min.io/docs/minio/linux/administration/identity-access-management/policy-based-access-control.html#policy-document-structure).
+#### Example:
+```yaml
+{
+ 'Version': '2012-10-17',
+ 'Statement':
+ [
+ {
+ 'Effect': 'Allow',
+ 'Principal': { 'AWS': ['*'] },
+ 'Action': ['s3:GetBucketLocation', 's3:ListBucket'],
+ 'Resource': ['arn:aws:s3:::{{.BucketName}}'],
+ },
+ {
+ 'Effect': 'Allow',
+ 'Principal': { 'AWS': ['*'] },
+ 'Action': ['s3:GetObject'],
+ 'Resource': ['arn:aws:s3:::{{.BucketName}}/*'],
+ },
+ ],
+}
+```
+:::tip
+The `{{ .BucketName }}` variable will be replaced by the bucket name.
+:::
+The bucket's policy can be changed later in Zerops GUI.
+#### Quota
+Set the bucket quota size in GB. The quota must be set manually. It can be changed later in Zerops GUI. Zerops doesn't support Object storage autoscaling. You can set the bucket quota from 1 to 100 GB.
+
+## Create Object storage using zCLI
+zCLI is the Zerops command-line tool. To create a new Object storage service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](#create-a-project-description-file)
+3. Create a project and an Object storage service
+### Create a project description file
+Zerops uses a yaml format file to describe the project infrastructure.
+#### Example
+Create a directory `my-project`. Create a `description.yaml` file inside the directory with the following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with an Object storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: upload
+ # service type
+ type: objectstorage
+ # Object storage size in GB
+ objectStorageSize: 73
+ # Choose object storage policy from a predefined list
+ objectStoragePolicy: public-write
+ # Or define a custom policy
+ objectStorageRawPolicy:
+```
+The yaml file describes your future project infrastructure. The project will contain one Object storage service named `upload`. The bucket quota will be set to 73 GB and the bucket access policy will be set to `public-write`.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+ Limitations
+
+ name
+ The name of the new project. Duplicates are allowed.
+ Maximum 255 characters
+
+ description
+ Optional. Description of the new project.
+
+ tags
+ Optional. One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects.
+
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains only Object storage service but you can create a description.yaml with different types of services.
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ Limitations:
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the Object storage type objectstorage and version.
+
+ Set type: `objectstorage`
+
+ Limitations:
+
+ Currently `objectstorage` or `object-storage` is available.
+
+ objectStorageSize
+
+ The size of the bucket quota in GB.
+
+ Limitations:
+
+ Set a whole number between 1 and 100.
+
+ objectStoragePolicy
+
+ Optional. Either `objectStoragePolicy` or `objectStorageRawPolicy` is required.
+
+ Set one of allowed values:
+
+ `public-read`
+ `public-objects-read`
+ `public-read-write`
+ `public-write`
+ `private`
+
+ Read more about the basic policy templates.
+
+ objectStorageRawPolicy
+
+ Optional. Either `objectStoragePolicy` or `objectStorageRawPolicy` is required.
+
+ Set your own access policy in the IAM Policy JSON format.
+
+ The `{{ .BucketName }}` variable will be replaced by the bucket name.
+
+Zerops creates one bucket automatically for each new Object storage service.
+:::note
+Each Object storage service can only contain one bucket. If your application needs multiple buckets, add more Object storage services.
+:::
+Bucket will be created with a name based on the given service name and a random prefix. The name of the bucket cannot be changed later.
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add Object service to an existing project
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# array of project services
+services:
+ - # service name
+ hostname: upload
+ # service type
+ type: objectstorage
+ # Object storage size in GB
+ objectStorageSize: 73
+ # Choose object storage policy from a predefined list
+ objectStoragePolicy: public-write
+ # Or define a custom policy
+ objectStorageRawPolicy:
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Object storage service named upload will be created. The bucket quota will be set to 73 GB and the bucket access policy will be set to `public-write`.
+The content of the `services:` section of `import.yaml` is identical to the [project description file]. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the `import.yaml` file is 100 kB.
+#### Example
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```bash
+# array of project services
+services:
+ -
+ # service name
+ hostname: storage
+ # service type
+ type: objectstorage
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Object storage service in the single container mode with default auto scaling configuration will be added to your project. Hostname of the new service will be set to `storage`.
+The content of the `services:` section of `import.yaml` is identical to the [project description file](#create-a-project-description-file). The `import.yaml` never contains the `project:` section because the project already exists.
+
+----------------------------------------
+
+# Object Storage > How To > Curl File
+
+This guide explains how to download a single file from a private Object Storage bucket using cURL and a bash script with Zerops object storage.
+## Prerequisites
+- Access to Zerops Object Storage
+- Storage credentials (`ACCESS_KEY_ID` and `SECRET_ACCESS_KEY`)
+- Bash environment
+- OpenSSL and cURL installed
+:::caution
+Store your storage credentials securely and never commit them to version control.
+:::
+## Script
+Save this script as `download-storage.sh`:
+```bash
+#!/bin/bash
+server="${3:-storage-prg1.zerops.io}"
+file_path=$2
+bucket=$1
+set -eu pipefail
+contentType="application/octet-stream"
+dateValue=`date -R`
+signature_string="GET\n\n${contentType}\n${dateValue}\n/${bucket}/${file_path}"
+signature_hash=`echo -en ${signature_string} | openssl sha1 -hmac ${SECRET_ACCESS_KEY} -binary | base64`
+curl -sSo ${file_path} \
+ -H "Date: ${dateValue}" \
+ -H "Content-Type: ${contentType}" \
+ -H "Authorization: AWS ${ACCESS_KEY_ID}:${signature_hash}" \
+ "https://${server}/${bucket}/${file_path}"
+```
+## Usage
+1. Make the script executable:
+```bash
+chmod +x download-storage.sh
+```
+2. Set your storage credentials as environment variables:
+```bash
+export ACCESS_KEY_ID=your-access-key
+export SECRET_ACCESS_KEY=your-secret-key
+```
+3. Run the script:
+```bash
+./download-storage.sh my-bucket file.pdf
+```
+## Troubleshooting
+- **Permission Denied**: Check your `ACCESS_KEY_ID` and `SECRET_ACCESS_KEY`
+- **File Not Found**: Verify bucket name and file path
+- **Script Error**: Ensure the script has execute permissions
+
+----------------------------------------
+
+# Object Storage > How To > Delete
+
+## Delete Object storage service in Zerops GUI
+Go to the project dashboard and select the delete service menu item in the top right corner.
+
+## Delete Object storage using zCLI
+zCLI is the Zerops command-line tool. To delete the Object storage service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Object Storage > How To > Update Bucket
+
+Zerops creates one bucket automatically for each new Object storage service.
+:::note
+Each Object storage service can only contain one bucket. If your application needs multiple buckets, add more Object storage services.
+:::
+To change the bucket size or the access policy, go to the **Access & bucket details** in the Object service detail in Zerops GUI, scroll down and click on the **Configure bucket quota size and access policy** button.
+
+### Quota
+Set the bucket quota size in GB. The quota must be set manually. It can be changed later in Zerops GUI. Zerops doesn't support Object storage autoscaling. You can set the bucket quota from 1 to 100 GB.
+### Access policy
+Zerops creates one bucket automatically for each new Object storage service.
+:::note
+Each Object storage service can only contain one bucket. If your application needs multiple buckets, add more Object storage services.
+:::
+#### Name
+Bucket will be created with a name based on the given service name and a random prefix. The name of the bucket cannot be changed later.
+#### Access policy
+Select one of the basic policy templates:
+| Template | Description |
+| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Public read | Allows anyone:to read the bucket's location `(s3:GetBucketLocation)` to list all bucket's objects `(s3:ListBucket)` to get any object of the bucket `(s3:GetObject)` |
+| Public objects read | Allows anyone:to read the bucket's location `(s3:GetBucketLocation)` to get any object of the bucket `(s3:GetObject)` |
+| Public read write | Allows anyone:to read the bucket's location `(s3:GetBucketLocation)` to list all bucket's objects `(s3:ListBucket)` to get any object of the bucket `(s3:GetObject)` to create a new object in the bucket `(s3:PutObject,s3:ListMultipartUploadParts, s3:AbortMultipartUpload, s3:ListBucketMultipartUploads)` to delete any object of the bucket `(s3:DeleteObject)` |
+| Public write | Allows anyone to create objects in the bucket `(PutObject action)` |
+| Private | Denies the access to unauthenticated users. |
+| Private | Denies the access to unauthenticated users. |
+Or you can set your own access policy in the [IAM Policy JSON format](https://min.io/docs/minio/linux/administration/identity-access-management/policy-based-access-control.html#policy-document-structure).
+#### Example:
+```yaml
+{
+ 'Version': '2012-10-17',
+ 'Statement':
+ [
+ {
+ 'Effect': 'Allow',
+ 'Principal': { 'AWS': ['*'] },
+ 'Action': ['s3:GetBucketLocation', 's3:ListBucket'],
+ 'Resource': ['arn:aws:s3:::{{.BucketName}}'],
+ },
+ {
+ 'Effect': 'Allow',
+ 'Principal': { 'AWS': ['*'] },
+ 'Action': ['s3:GetObject'],
+ 'Resource': ['arn:aws:s3:::{{.BucketName}}/*'],
+ },
+ ],
+}
+```
+:::tip
+The `{{ .BucketName }}` variable will be replaced by the bucket name.
+:::
+
+----------------------------------------
+
+# Object Storage > Overview
+
+Zerops Object storage is powered by [MinIO ↗](https://min.io/), a high-performance, open-source S3 compatible object store. MinIO is built for large scale AI/ML, data lake and database workloads.
+## Feature Highlights
+## Popular Guides
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+
+----------------------------------------
+
+# Php > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing PHP application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](/php/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple PHP web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Php > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](/php/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](/php/how-to/build-pipeline#ports) `80`, simply use `http://app:80`
+:::info
+Do not use `https://` when communicating with PHP from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use PHP environment variables
+Zerops creates default environment variables for each PHP service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](/php/how-to/env-variables#generated-env-variables) of the PHP service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](/php/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your PHP application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access PHP application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/php/how-to/env-variables) are available when connected through VPN. To connect to your PHP application in Zerops set the hostname and [internal port](/php/how-to/build-pipeline#ports) e.g. http://app:80
+:::info
+Do not use `https://` when communicating with PHP over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your PHP service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your PHP service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/php/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Php > How To > Build Pipeline
+
+Zerops provides a customizable build and runtime environment for your PHP application.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: php-apache@latest
+ # OPTIONAL. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Build your application
+ buildCommands:
+ - composer install
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - vendor
+ - public
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ # cache: vendor
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: php-apache@latest
+ # OPTIONAL. Customize the runtime PHP environment by installing additional
+ # dependencies to the base PHP runtime environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your PHP application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # OPTIONAL. Customize the folder that will be used as the root of the publicly
+ # accessible web server content. Enter the path relative to the /var/www folder.
+ documentRoot: public
+ # OPTIONAL. Sets the custom Nginx or Apache configuration. The file must be deployed in
+ # the runtime container. Enter the path to the file relative to the /var/www folder
+ siteConfigPath: site_config.tmpl
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your PHP application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Build pipeline configuration
+### base
+_REQUIRED._ Sets the base technology for the build environment.
+Following options are available for PHP builds:
+```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
+ ...
+```
+ The base build environment contains {data.alpine.default}, the selected
+ major version of PHP, Zerops command line tool, `composer`, `git` and `wget`.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
+```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
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
+To customise your build environment use the [prepareCommands](/php/how-to/build-pipeline#preparecommands) attribute.
+:::note
+Modifying the base technology will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### os
+_OPTIONAL._ Sets the operating system for the build environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+:::note
+Changing the OS setting will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache behavior.
+:::
+### prepareCommands
+_OPTIONAL._ Customises the build environment by installing additional dependencies or tools to the base build environment.
+The base build environment contains:
+- {data.alpine.default}
+- selected version of PHP defined in the [base](/php/how-to/build-pipeline#base) attribute
+- [Zerops command line tool](/references/cli)
+- `composer`, `git` and `wget`
+To install additional packages or tools add one or more prepare commands:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: php-apache@latest
+ # OPTIONAL. Customise the build environment by installing additional packages
+ # or tools to the base build environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first build is triggered, Zerops will
+1. create a build container
+2. download your application code from your repository
+3. run the prepare commands in the defined order
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::note
+These commands are skipped when using cached environment. Modifying `prepareCommands` will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache invalidation.
+:::
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/php/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all prepare commands are finished, your custom build environment is ready for the build phase.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### buildCommands
+_REQUIRED._ Defines build commands.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: php-apache@latest
+ # REQUIRED. Build your application
+ buildCommands:
+ - composer install
+ ...
+```
+At least one command is required. Zerops triggers each command in the defined order in a dedicated build container.
+Before the build commands are triggered the build container contains:
+1. base environment defined by the [base](/php/how-to/build-pipeline#base) attribute
+2. optional customisation of the base environment defined in the [prepareCommands](/php/how-to/build-pipeline#preparecommands) attribute
+3. your application code
+#### Run build commands as a single shell instance
+Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it.
+```yaml
+buildCommands:
+ - |
+ composer install --optimize-autoloader --no-dev
+ php artisan env
+```
+#### Run build commands as a separate shell instances
+When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command.
+```yaml
+buildCommands:
+ - composer install --optimize-autoloader --no-dev
+ - php artisan env
+```
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/php/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the verbose option.
+```yaml
+buildCommands:
+ - composer install -v
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the deploy phase.
+### deployFiles
+_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
+```yaml
+# REQUIRED. Select which files / folders to deploy after
+# the build has successfully finished
+deployFiles:
+ - vendor
+ - public
+```
+Determines files or folders produced by your build, which should be deployed to your runtime service containers.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Examples
+Deploys a folder, and a file from the project root directory:
+```yaml
+deployFiles:
+ - public
+ - file.txt
+```
+Deploys the whole content of the build container:
+```yaml
+deployFiles: .
+```
+Deploys a folder, and a file in a defined path:
+```yaml
+deployFiles:
+ - ./path/to/file.txt
+ - ./path/to/dir/
+```
+#### How to use a wildcard in the path
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+Deploys all folders that are located in any path that begins with `/path/to/`
+```yaml
+deployFiles: ./path/to/~/
+```
+Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/
+```
+:::note Example
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+:::
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+_OPTIONAL._ Defines which files or folders will be cached for the next build.
+```yaml
+# OPTIONAL. Which files / folders you want to cache for the next build.
+# Next builds will be faster when the cache is used.
+cache: file.txt
+```
+The cache attribute helps optimize build times by preserving specified files between builds.
+The cache attribute supports the [~ wildcard character](#how-to-use-a-wildcard-in-the-path).
+Learn more about the [build cache system](/features/build-cache) in Zerops.
+### envVariables
+_OPTIONAL._ Defines the environment variables for the build environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ base: php-apache@latest
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ PHP_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/php/how-to/env-variables) in Zerops.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current PHP version for your runtime.
+Following options are available for PHP builds:
+```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
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the
+ selected major version of PHP, Zerops command line tool and `composer`, `git` and `wget`.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```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
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customise your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+:::info
+If no ports are specified, Zerops adds the port TCP 80 automatically.
+:::
+:::caution
+If you want the web server to listen on other port(s) than `:80`, you must [customize](/php/how-to/customize-web-server) your web server configuration as well.
+:::
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a PHP service with hostname = "app" and port = 80 from another service of the same project, simply use `app:80`. Read more about [how to access a PHP service](/php/how-to/access).
+:::info
+Do not use the port **:443**. All the incoming traffic is terminated on the Zerops internal balancer where the SSL certificate is installed and the request is forwarded to your PHP+Nginx / PHP+Apache service as a **http://** on the port **:80**.
+:::
+Each port has following attributes:
+
+ Parameter
+ Description
+
+ port
+ Defines the port number. You can set any port number between 10 and 65435. Ports outside this interval are reserved for internal Zerops systems.
+
+ protocol
+ Optional. Defines the protocol. Allowed values are TCP or UDP. Default value is TCP.
+
+ httpSupport
+ Optional. httpSupport = true is the default setting for TCP protocol. Set httpSupport = false if a web server isn't running on the port. Zerops uses this information for the configuration of public access. httpSupport = true is available only in combination with the TCP protocol.
+
+### prepareCommands
+_OPTIONAL._ Customises the PHP runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base PHP environment contains {data.alpine.default}, the selected
+ major version of PHP, Zerops command line tool and `composer`, `git` and `wget`. To install
+ additional packages or tools add one or more prepare commands:
+```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 PHP runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/php/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/php/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+
+When the prepare cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.default}, the
+ selected major version of PHP, Zerops command line tool and `composer`, `git` and `wget`.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare: ./runtime-config.yaml
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base PHP runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your PHP application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your PHP application is started.
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](/php/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](/php/how-to/build-pipeline#preparecommands-1) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](/php/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### documentRoot
+_OPTIONAL._ Customizes the folder that will be used as the root of the publicly accessible web server content.
+:::info
+By default, the document root is configured to `/var/www`.
+:::
+Customize the folder that will be used as the root of the publicly accessible web server content. Enter the path relative to the `/var/www` folder.
+E.g. `documentRoot: public` will set the web server document root to `/var/www/public`.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the folder that will be used as the root of the publicly
+ # accessible web server content. Enter the path relative to the /var/www folder.
+ documentRoot: public
+```
+### siteConfigPath
+_OPTIONAL._ Sets the custom Nginx or Apache configuration.
+:::info
+By default, the default [nginx](/php/how-to/customize-web-server#default-nginx-configuration) or [Apache](/php/how-to/customize-web-server#default-apache-configuration) web server configuration is set.
+:::
+The file must be deployed in the runtime container. Enter the path to the file relative to the `/var/www` folder.
+Read more about the [web server customization](/php/how-to/customize-web-server).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ PHP_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/php/how-to/env-variables) in Zerops.
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the folder that will be used as the root of the publicly
+ # accessible web server content. Enter the path relative to the /var/www folder.
+ documentRoot: public
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your PHP application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the folder that will be used as the root of the publicly
+ # accessible web server content. Enter the path relative to the /var/www folder.
+ documentRoot: public
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+### crontab
+_OPTIONAL._ Defines cron jobs.
+Setup cron jobs in the following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ crontab:
+ # REQUIRED. Sets the command to execute:
+ - command: ""
+ # REQUIRED. Sets the interval time to execute:
+ timing: "0 * * * *"
+```
+Read more about setting up [cron](/references/cron) in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](/php/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](/php/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your PHP application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](/php/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Php > How To > Build Process
+
+
+The build container is automatically deleted after the build has finished or failed.
+:::info
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::
+## Cancel running build
+To cancel an ongoing build:
+1. Go to service detail
+2. Select "Service dashboard & runtime containers"
+3. Click "Open pipeline detail"
+4. Click "Cancel build"
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+## Customize PHP build environment
+The default PHP build environment contains:
+- {data.alpine.default}
+- selected version of PHP defined in `zerops.yaml` [build.base](/php/how-to/build-pipeline#base) parameter
+- Git and Composer
+- [zCLI](/references/cli)
+:::note
+To use Ubuntu instead of the default Alpine, set the [build.os](/zerops-yaml/specification#os-) attribute.
+Additional packages and tools can be installed using [build.prepareCommands](/zerops-yaml/specification#preparecommands-).
+:::
+## PHP build hardware resources
+Build of your PHP application is run in a separate build container with following resource configuration:
+| HW resource | Minimum | Maximum |
+| ------------- | ------- | ------- |
+| **CPU cores** | 6 | 20 |
+| **RAM** | 8 GB | 8 GB |
+| **Disk** | 1 GB | 100 GB |
+| **Disk** | 1 GB | 100 GB |
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+## Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops will terminate the build pipeline and delete the build container.
+## Troubleshooting build-related problems
+### Failure of a build prepare command
+If any [prepare command](/php/how-to/build-pipeline#preparecommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/php/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom build environment is ready for the build phase.
+### Invalidate the build cache
+If you encounter unexpected build behavior or dependency issues, the problem might be related to [cached build data](/features/build-cache). While Zerops maintains the build cache to speed up deployments, sometimes you may need to start fresh.
+To invalidate the build cache:
+1. Go to your service detail in Zerops GUI
+2. Choose **Pipelines & CI/CD Settings** from the left menu
+3. Click on the **Invalidate build cache** button
+This will force Zerops to run the next build clean, including all prepare commands, which can help resolve cache-related issues. After invalidation, your next build will also create a fresh cache.
+### Failure of a build command
+If any [build command](/php/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/php/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `-v` verbose option.
+```yaml
+buildCommands:
+ - composer install -v
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the [deploy](/php/how-to/deploy-process) phase.
+
+----------------------------------------
+
+# Php > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart PHP service in Zerops GUI
+To stop the PHP service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped PHP service choose the **Start** item from the same menu.
+To restart the PHP service choose the **Restart** item from the same menu.
+## Stop and start PHP using zCLI
+zCLI is the Zerops command-line tool. To stop and start the PHP service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Php > How To > Create
+
+Zerops provides 2 PHP services with an included web server: **PHP+Nginx** and **PHP+Apache**. PHP runtime is highly scalable and customisable to suit both development and production.
+## Create PHP service using Zerops GUI
+First, set up a project in Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new PHP service:
+### Choose PHP version
+Following PHP versions are currently supported:
+:::info
+You can [change](/php/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app","cache", "gui" etc. Duplicate services with the same name in the same project are forbidden.
+#### Limitations:
+- maximum 25 characters
+- must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created. It can't be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as password, tokens, salts, certificates etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting the secret environment variables is optional. You can set them later in Zerops GUI.
+Read more about [different types of env variables](/php/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Set auto scaling configuration
+Zerops scales the PHP services automatically both vertically and horizontally. Vertical scaling means increasing or decreasing the hardware resources (CPU, RAM and disk) of a PHP container. Horizontal scaling adds or removes whole containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+PHP service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the PHP service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient PHP performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/php/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+:::info
+You can change the vertical auto scaling parameters later.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your PHP service. When your PHP service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ Parameter
+ Value
+
+ minimum containers
+ 1
+
+ maximum containers
+ 6
+
+PHP service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](/php/how-to/scaling) about PHP auto scaling.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Create PHP service using zCLI
+zCLI is the Zerops command-line tool. To create a new PHP service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/php/how-to/create#create-a-project-description-file)
+3. [Create a project with a PHP and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### Basic example:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in php-apache@{version} or php-nginx@{version} format
+ type: php-nginx@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one PHP version 8.1 service with default [auto scaling](/php/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/php/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a PHP and PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in php-apache@{version} or php-nginx@{version} format
+ type: php-nginx@latest
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create secret env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+ - # second service hostname
+ hostname: db
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain a PHP service and a [PostgreSQL](/postgresql/overview) service.
+PHP service with "app" hostname, the internal port(s) the service listens on will be defined later in the [zerops.yaml](/php/how-to/build-pipeline#ports). PHP service will run on version 8.1 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+ Limitations
+
+ name
+ The name of the new project. Duplicates are allowed.
+
+ description
+ Optional. Description of the new project.
+ Maximum 255 characters.
+
+ tags
+ Optional. One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects.
+
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains PHP and PostgreSQL services but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ The hostname of the new service will be set to the `hostname` value.
+
+ Limitations:
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [PHP service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+
+ All verticalAutoscaling attributes are optional. Not specified attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add PHP service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in php-apache@{version} or php-nginx@{version} format
+ type: php-nginx@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one PHP service version 8.1 with default [auto scaling](/php/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Php > How To > Customize Runtime
+
+The default PHP runtime environment contains:
+- {data.alpine.default}
+- Selected version of PHP when the runtime service was created
+- [zCLI](/references/cli)
+- Git and Composer
+:::note
+To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yaml/specification#os--1) attribute.
+Additional packages and tools can be installed using [run.prepareCommands](/zerops-yaml/specification#preparecommands--1).
+:::
+## Runtime Flow
+
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. Create a prepare runtime container
+2. Optionally: [copy selected folders or files from your build container](/php/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. Run the [run.prepareCommands](/zerops-yaml/specification#preparecommands--1) commands in the defined order
+## Command exit code
+Failed commands return non-zero exit codes and cancel deployment. Check [prepare runtime logs](/php/how-to/logs#prepare-runtime-log) for errors.
+Successful commands return exit code 0, triggering the next command. After all prepareCommands complete, the runtime environment is ready for deployment.
+The prepare runtime container is deleted once the phase completes or fails.
+## Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the build.addToRunPrepare and run.prepareCommands attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+### Clearing Zerops runtime cache
+1. Go to service detail
+2. Select "Service dashboard & runtime containers"
+3. Click "Open pipeline detail"
+4. Click "Clear runtime prepare cache"
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+### Overwrite php.ini files
+You can override PHP configuration directives by setting environment variables in your `zerops.yaml` file.
+Here's an example of how to adjust PHP's `post_max_size` directive:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: php-nginx@8.3
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ PHP_INI_post_max_size: 10M
+```
+
+----------------------------------------
+
+# Php > How To > Customize Web Server
+
+## PHP + Nginx
+### Default Nginx configuration
+The default PHP+Nginx service has following Nginx configuration:
+```
+server {
+ listen 80;
+ listen [::]:80;
+ server_name _;
+ # Be sure that you set up the correct document root!
+ root {{.DocumentRoot}};
+ location ~ \.php {
+ try_files _ @backend;
+ }
+ location / {
+ # use this for pretty url
+ try_files $uri /$uri /index.html /index.php$is_args$args;
+ }
+ location @backend {
+ fastcgi_pass unix:{{.PhpSocket}};
+ fastcgi_split_path_info ^(.+\.php)(/.*)$;
+ include fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
+ fastcgi_param DOCUMENT_ROOT $realpath_root;
+ internal;
+ }
+ access_log syslog:server=unix:/dev/log,facility=local1,tag=nginx,severity=info default_short;
+ error_log syslog:server=unix:/dev/log,facility=local1,tag=nginx,severity=error;
+}
+```
+The configuration contains 2 variables:
+- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yaml`. If the attribute is not specified, the default value `/var/www` is used.
+- **`{{.PhpSocket}}`** is replaced by a path to the PHP socket based on the PHP version.
+### Customize Nginx configuration
+Follow these steps to customize the Nginx configuration in PHP+Nginx service:
+1. Create a **.tmpl** file with the Apache configuration in your repository.
+2. Optionally use following variables:
+- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yaml`. If the attribute is not specified, the default value `/var/www` is used.
+Example:
+```
+root {{.DocumentRoot}};
+```
+- **`{{.PhpSocket}}`** is replaced by a path to the PHP socket based on the PHP version.
+Example:
+```
+fastcgi_pass unix:{{.PhpSocket}};
+```
+- **`{{.Environment.ENV_NAME}}`** is replaced by the [env variable](/php/how-to/env-variables) value. The env variable must be either defined in [run.envVariables](/php/how-to/build-pipeline#envvariables-1) in `zerops.yaml` or set as a [secret](/php/how-to/env-variables#set-secret-env-variables-in-zerops-gui) or [generated](/php/how-to/env-variables#generated-env-variables) env variable in Zerops GUI.
+:::caution
+Use the **.tmpl** file extension to make Zerops interpret the file as a template. Zerops will replace the supported variables listed above.
+:::
+3. Check that your Nginx configuration is consistent with Zerops requirements:
+- Do not use IP addresses in the `listen` directive
+- If you use other ports than `:80` in the `listen` directive, add them to the `run.ports` in your `zerops.yaml` as well.
+- Do not use the port **:443**. All the incoming `https://` traffic is terminated on the Zerops internal balancer where the SSL certificate is installed and the request is forwarded to your PHP+Nginx service as a **http://** on the port **:80**.
+4. Add the `siteConfigPath` to the run section of your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: php-nginx@latest
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - vendor
+ - public
+ # ==== how to run your application ====
+ run:
+ documentRoot: public
+ # OPTIONAL. Sets the custom Nginx or Apache configuration. The file must be deployed in the runtime container. Enter the path to the file relative to the /var/www folder
+ siteConfigPath: site_config.tmpl
+```
+5. Ensure that the `build.deployFiles` contains the folder with the `siteConfigPath` or add the path to the Nginx config file to the `deployFiles` list. Zerops will deploy the file to the runtime container(s).
+6. [Trigger]() the build & deploy pipeline.
+## PHP + Apache
+### Default Apache configuration
+The default PHP+Apache service has following Apache configuration:
+```
+ ServerName localhost
+ DocumentRoot {{.DocumentRoot}}
+ DirectoryIndex index.htm index.html index.shtml index.php index.phtml
+
+ Options -Indexes
+ Options FollowSymLinks
+ AllowOverride All
+ Require all granted
+
+ SetHandler "proxy:unix:{{.PhpSocket}}|fcgi://localhost/"
+
+ ErrorLog "| /usr/bin/logger -tapache -plocal1.err"
+ CustomLog "| /usr/bin/logger -tapache -plocal1.notice" combined
+```
+The configuration contains 2 variables:
+- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yaml`. If the attribute is not specified, the default value `/var/www` is used.
+- **`{{.PhpSocket}}`** is replaced by a path to the PHP socket based on the PHP version.
+### Customize Apache configuration
+Follow these steps to customize the Apache configuration in PHP+Apache service:
+1. Create a **.tmpl** file with the Nginx configuration in your repository.
+2. Optionally use following variables:
+- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yaml`. If the attribute is not specified, the default value `/var/www` is used.
+Example:
+```
+DocumentRoot {{.DocumentRoot}};
+```
+- **`{{.PhpSocket}}`** is replaced by a path to the PHP socket based on the PHP version.
+Example:
+```
+ SetHandler "proxy:unix:{{.PhpSocket}}|fcgi://localhost/"
+```
+- **`{{.Environment.ENV_NAME}}`** is replaced by the [env variable](/php/how-to/env-variables) value. The env variable must be either defined in [run.envVariables]() in `zerops.yaml` or set as a [secret](/php/how-to/env-variables#set-secret-env-variables-in-zerops-gui) or [generated](/php/how-to/env-variables#generated-env-variables) env variable in Zerops GUI.
+:::caution
+Use the **.tmpl** file extension to make Zerops interpret the file as a template. Zerops will replace the supported variables listed above.
+:::
+3. Check that your Apache configuration is consistent with Zerops requirements:
+- Do not use IP addresses in the `` directive
+- If you use other ports than `:80` in the `` directive, add them to the `run.ports` in your `zerops.yaml` as well.
+ Do not use the port **:443**. All the incoming `https://` traffic is terminated on the Zerops internal balancer where the SSL certificate is installed and the request is forwarded to your PHP+Apache service as a **http://** on the port **:80**.
+4. Add the `siteConfigPath` to the run section of your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: php-apache@latest
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - vendor
+ - public
+ # ==== how to run your application ====
+ run:
+ documentRoot: public
+ # OPTIONAL. Sets the custom Nginx or Apache configuration. The file must be deployed in the runtime container. Enter the path to the file relative to the /var/www folder
+ siteConfigPath: site_config.tmpl
+```
+5. Ensure that the `build.deployFiles` contains the folder with the `siteConfigPath` or add the path to the Apache config file to the `deployFiles` list. Zerops will deploy the file to the runtime container(s).
+6. [Trigger](/php/how-to/trigger-pipeline) the build & deploy pipeline.
+
+----------------------------------------
+
+# Php > How To > Delete
+
+## Delete PHP service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete PHP using zCLI
+zCLI is the Zerops command-line tool. To delete the PHP service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Php > How To > Deploy Process
+
+
+## Application artefact
+When the [build phase](/php/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](/php/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/php/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/php/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/php/how-to/build-pipeline#initcommands)
+4. Starts your application
+5. Optionally waits until the [readiness check](/php/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/php/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customize the runtime environment](/php/how-to/customize-runtime).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The PHP process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready as soon as it starts, configure a [readiness check](/php/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your PHP service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/php/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Php > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+
+ Type
+ Environment
+ Defined in
+
+ basic
+ build
+ zerops.yaml
+
+ basic
+ runtime
+ zerops.yaml
+
+ secret
+ runtime
+ Zerops GUI
+
+Use the [secret env variables](/php/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](/php/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/php/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](/php/how-to/create) a new PHP service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made to environment variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The PHP process running in the container receives the list env variables only when it starts. Update of the env variables while the PHP process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+These restrictions apply to all [types of env variables](/php/how-to/env-variables#types-of-env-variables-in-zerops).
+## Referencing other env variables
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your PHP runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the PHP service. The PHP process running in the container receives the list env variables only when it starts. Update of the env variables while the PHP process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a PHP service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your PHP app
+To access the local environment variable i.e. the variable set to this PHP service in your app, use:
+```sh
+getenv('YOUR_VARIABLE_KEY_HERE');
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+
+----------------------------------------
+
+# Php > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Php > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](/php/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](/php/how-to/build-pipeline#preparecommands-1) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the runtime containers in Zerops CLI use
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## PHP logging configuration
+Zerops logs all messages sent
+- to the standard error (`stderr`)
+- to the standard output (`stdout`)
+- via the PHP `var_dump` method
+### Severity level
+By default the `console.log` creates a message with the `Informational (6)` severity.
+Add a severity number in the `` format as a prefix to set a custom severity as shown below:
+// FIXME
+```php
+console.log('A message with the informational severity ...');
+console.log('Emergency (0) severity > system is unusable.');
+console.log('Alert (1) severity > action must be taken immediately.');
+console.log('Critical (2) severity > critical conditions.');
+console.log('Error (3) severity > error conditions.');
+console.log('Warning (4) severity > warning conditions.');
+console.log('Notice (5) severity > normal, but significant, condition.');
+console.log('Informational (6) severity > informational message.');
+console.log('Debug (7) severity > debug-level message.');
+```
+:::info
+`console.info`, `console.warn`, `console.debug`
+, and `console.error` are just aliases to the `
+ console.log
+` method. They don't set the appropriate severity number. Use the `
+ <N>
+` prefix instead. :::
+
+----------------------------------------
+
+# Php > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the PHP service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+PHP service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the PHP service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient PHP performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your PHP service. When your PHP service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+PHP service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each PHP service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the PHP service.
+### Not enough resources to scale up
+If one of the PHP containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the PHP service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor PHP resources
+Zerops provides information about how much hardware resources the PHP service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Php > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your PHP service directly when creating a new shared storage service. Just select your PHP service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the PHP service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create PHP service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new PHP service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/php/how-to/shared-storage#create-a-project-description-file)
+3. [Create a project with a PHP service and a shared storage](/php/how-to/shared-storage#create-a-project-with-a-php-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](/php/how-to/create#create-a-project-description-file) how to define the PHP service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a PHP and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in php-apache@8.1+2.4 format
+ type: php-apache@8.1+2.4
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the PHP service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with a PHP service and a shared storage
+Follow the article [How to create a project based on the description.yaml](/php/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Php > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](/php/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](/php/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](/php/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Php > How To > Upgrade
+
+You can upgrade or downgrade your PHP service to a different major PHP version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/php/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required PHP version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current PHP version for your runtime.
+If you want to build your application with a different major PHP version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
+
+----------------------------------------
+
+# Php > Overview
+
+[PHP ↗](https://www.php.net/), a popular general-purpose scripting language that is especially suited to web development.
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-php-hello-world), a **_recipe_**, containing the most simple PHP web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of PHP running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-php-hello-world/blob/main/import-project/description.yaml)):
+```yaml
+project:
+ name: my-first-project
+services:
+ - hostname: helloworld
+ type: php-apache@8.1+2.4
+ minContainers: 1
+ maxContainers: 3
+ buildFromGit: https://github.com/zeropsio/recipe-php-hello-world@main
+ enableSubdomainAccess: true
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://helloworld-24-8080.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+Hello, World!
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+## How to start
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Postgresql > Faq
+
+ Question: Why is my connection to PostgreSQL from third-party software failing?
+Answer:
+ *One possible cause:*
+ The connection string in Zerops always starts with `postgresql://`. While the official PostgreSQL documentation
+ states that both `postgresql://` and `postgres://` URIs are valid, some software requires the shorter `postgres://`
+ version.
+
+ To resolve this, create your own environment variable with the correct URI. For example, if your PostgreSQL service is named `db`, use the following format:
+
+ ```
+ postgres://${db_user}:${db_password}@${db_hostname}:${db_port}
+ ```
+
+
+----------------------------------------
+
+# Postgresql > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops by running a predefined application consisting of a PostgreSQL service and a runtime service that handles the SQL queries.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own PostgreSQL service, feel free to head straight to the [How to](/postgresql/how-to/create) section.
+## Guides
+We have created repositories, _recipes_, containing a simple web application and a PostgreSQL service, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Postgresql > How To > Connect
+
+This guide covers how to connect to your PostgreSQL database in Zerops, both from services within the same project and from outside the Zerops environment.
+## Connection Options Overview
+Zerops provides several ways to connect to PostgreSQL:
+1. **Internal connections** - Between services in the same Zerops project (via private network)
+2. **Remote connections**:
+ - **VPN access** - From your local machine via Zerops VPN
+ - **Direct IP access** - Enables external applications to connect using TLS encryption by opening public ports on IPv6 (available by default) or IPv4 (requires add-on activation if not already enabled)
+## Connection Details
+You'll find internal PostgreSQL connection details in two places in the Zerops GUI:
+1. Under the **Access details** button in the project dashboard
+2. In the service detail page under the **Peek access details** button
+### Connection Parameters
+
+ Parameter
+ Internal Connection
+ Direct IP Access (TLS)
+
+ Hostname/IP
+ Service hostname
+ Public IP address
+
+ Port
+ 5432
+ 6432
+
+ User
+ Identical to the service hostname
+ Same as internal
+
+ Password
+ Randomly generated during service creation
+ Same as internal
+
+ Port env variable
+ `port`
+ `portTls`
+
+ Connection string env variable
+ `connectionString`
+ `connectionTlsString`
+
+:::warning
+Zerops creates a system user named `zps` with full privileges for maintenance purposes. Do not delete, change the password, or remove privileges from this user, as it will disrupt Zerops' ability to maintain the database cluster.
+:::
+:::info
+For more information about default PostgreSQL setup, users, and databases, see [Manage PostgreSQL Users and Databases](/postgresql/how-to/manage).
+:::
+## Connect from Services in the Same Project
+All services within a Zerops project share a dedicated private network. There are two ways to implement connections between services in the same project:
+### Method 1: Direct Connection Parameters
+You can directly use the connection parameters from Access Details:
+```
+host = database1
+port = 5432
+user = database1
+password = ********** (find under Access Details)
+```
+### Method 2: Environment Variables (Recommended)
+For better maintainability, Zerops creates environment variables for each PostgreSQL service that you can use in your application configuration. List of service environment variables is available in Zerops GUI. Go to a PostgreSQL service detail and choose **Environment variables**.
+To use variables from one service in another, prefix the variable name with the service hostname and underscore - to access the `connectionString` variable of `postgresql1`, use `postgresql1_connectionString`.
+For more details on how to use environment variables, and instructions for adding your own custom variables, see the [Environment Variables](/features/env-variables) documentation.
+:::caution Important notes
+- When changing passwords, update both the database user password and the environment variable separately - they don't automatically synchronize.
+- While both `postgresql://` and `postgres://` URI formats are valid, Zerops uses the `postgresql://` format. If your software requires `postgres://`, create a custom environment variable with this format.
+- Do not use SSL/TLS protocols for internal connections. Security is assured by the project's private network.
+:::
+## Connect Remotely
+Zerops offers two methods for connecting to your PostgreSQL database from outside the Zerops environment:
+### Method 1: Connect via Zerops VPN
+You can securely connect to PostgreSQL from your local workstation via Zerops VPN:
+1. [Install & set up zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+3. Use the connection details from Access Details in the PostgreSQL service detail in Zerops GUI
+4. When finished, [stop the Zerops VPN](/references/vpn#stop-vpn)
+:::warning Important notes
+* Do not use SSL/TLS protocols when connecting over VPN. Security is provided by the VPN tunnel.
+* If your connection over VPN doesn't work, try adding `.zerops` suffix to the service hostname (e.g., `database1.zerops`). For additional help, check the [VPN troubleshooting page](/references/vpn/troubleshooting).
+:::
+### Method 2: Connect via Direct IP Access
+Direct IP Access uses [pgBouncer](https://www.pgbouncer.org/) for connection pooling and TLS termination.
+Internally, port `5432` is available without SSL. Externally, connections are secured with TLS through pgBouncer (port `6432`) before being routed to your PostgreSQL service.
+#### Enable external access
+1. Navigate to your PostgreSQL service in the Zerops GUI and choose the **Public Access through IP Addresses** section
+2. Choose either IPv6 (available by default) or IPv4 (requires the [unique IPv4](/features/access#dedicated-ipv4-address-330-days) add-on)
+3. Open one or more ports and point them to your PostgreSQL service (the system will direct them through pgBouncer)
+ - Choose any port from 10-65435 (except 80 and 443)
+ - Select destination service and internal port
+ - Each public port can be mapped to any internal service port
+ - Multiple public ports can point to the same internal port if needed
+ - Port configurations can be set independently for IPv4 and IPv6
+4. Optionally enable firewall protection for additional security
+5. Click the **Publish X IP access change(s)** button to apply your settings
+For database management tools and how to manage users and databases, see [Manage PostgreSQL Users and Databases](/postgresql/how-to/manage).
+
+----------------------------------------
+
+# Postgresql > How To > Control
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart PostgreSQL service in Zerops GUI
+To stop the PostgreSQL service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped PostgreSQL service choose the **Start** item from the same menu.
+To restart the PostgreSQL service choose the **Restart** item from the same menu.
+## Stop and start PostgreSQL using zCLI
+zCLI is the Zerops command-line tool. To stop and start the PostgreSQL service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Postgresql > How To > Create
+
+## Create PostgreSQL using Zerops GUI
+First, set up a project in Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new PostgreSQL service:
+
+ Parameter
+ Description
+ Limitations
+
+ hostname
+ A unique service identifier like `postgresql`,`sql`, `db` etc.
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+:::caution
+The hostname is fixed after the service is created. It can't be changed later.
+:::
+### Choose PostgreSQL service mode
+Zerops provides PostgreSQL service in two modes: **Highly available** and **Single container**.
+
+#### Highly available
+Creates a PostgreSQL cluster with **3 database containers** and **2 free database proxies**.
+This mode is suited for production.
+Zerops always keeps the 3 database containers on different physical machines. All your data is stored redundantly in 3 identical copies. In case of a container or the underlying physical machine failure, Zerops automatically disconnects the failed container from the cluster, creates a new container, and syncs all data from the remaining 2 copies. Finally, the broken container is automatically deleted.
+[Learn more](/postgresql/tech-details/cluster) about specific behaviour and technical limitations of the PostgreSQL cluster.
+#### Single container
+A PostgreSQL database installed in a single container is created. Useful for non-essential data or dev environments.
+:::caution
+Your data is stored only in a single container. If the container or the underlying physical machine fails, your data since the last backup is lost. Zerops doesn't provide any automatic repairs of single-node PostgreSQL services.
+:::
+:::info
+The PostgreSQL service mode is fixed after the service is created. It can't be changed later.
+:::
+### Choose PostgreSQL version
+Following PostgreSQL versions are currently supported:
+### Set auto-scaling configuration
+Zerops scales the PostgreSQL services automatically by raising or lowering the hardware resources of each database container.
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode, the power your application gets is dependent on other applications running on the same CPU core. In best case scenario your application gets 10/10 of CPU core power and 1/10 in the worst-case scenario.
+**Dedicated**
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto-scaling
+Vertical auto-scaling has the following default configuration:
+For most cases, the default parameters will work without issues. If you need to limit the cost of the PostgreSQL service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient PostgreSQL performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/postgresql/how-to/scaling#fine-tune-the-auto-scaling) the auto-scaling to fit your application needs.
+:::
+:::info
+You can change the auto-scaling parameters later.
+:::
+:::tip
+[Learn more](/postgresql/how-to/scale) about PostgreSQL auto-scaling.
+:::
+## Create PostgreSQL using zCLI
+zCLI is the Zerops command-line tool. To create a new PostgreSQL service via the command line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](#create-a-project-description-file)
+3. Create a project and a PostgreSQL service
+### Create a project description file
+Zerops uses a YAML format file to describe the project infrastructure.
+#### Basic example
+Create a directory `my-project`. Create a `description.yaml` file inside the directory with the following content:
+```yaml
+# Basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: postgresql1
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"NON_HA"
+ mode: NON_HA
+```
+The YAML file describes your future project infrastructure. The project will contain one PostgreSQL service in the [single container](#single-container) mode with default [auto scaling](/postgresql/how-to/scale) configuration. The hostname will be set to `postgresql1`.
+#### Full example
+Create a directory `my-project`. Create a `description.yaml` file inside the directory with the following content:
+```yaml
+# Basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # first service hostname
+ hostname: postgresql1
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"NON_HA"
+ mode: HA
+ # optional: vertical auto-scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ - # second service hostname
+ hostname: postgresql2
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The YAML file describes your future project infrastructure. The project will contain two PostgreSQL services.
+The hostname of the first service will be set to `postgresql1`. The [high availability](#highly-available) mode will be chosen and the custom [auto scaling configuration](/postgresql/how-to/scale) will be set.
+The hostname of the second service will be set to `postgresql2`. The [single container](#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/scale) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+ Limitations
+
+ name
+ The name of the new project. Duplicates are allowed.
+
+ description
+ Optional. Description of the new project.
+ Maximum 255 characters.
+
+ tags
+ Optional. One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects.
+
+At least one service in the `services:` section is required. You can create a project with multiple services. The example above contains only PostgreSQL services but you can create a `description.yaml` with [different types] of services.
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ The hostname of the new database will be set to the `hostname` value.
+
+ Limitations:
+
+- duplicate services with the same name in the same project are
+ forbidden
+
+ - maximum 25 characters
+
+- must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [PostgreSQL service types](/references/import-yaml/type-list#database-services) are currently supported.
+
+ mode
+
+ Defines the operation mode of the PostgreSQL service.
+
+ HA
+
+ Creates a PostgreSQL cluster with 3 database containers and 2 free
+ database proxies. This mode is suited for production.
+
+ Zerops always keeps the 3 database containers on different physical
+ machines. All your data is stored redundantly in 3 identical copies. In
+ case of a failure of a container or the underlying physical machine,
+ Zerops automatically disconnects the failed container from the cluster,
+ creates a new container and syncs all data from the remaining 2 copies.
+ Finally, the broken container is automatically deleted.
+
+ NON_HA
+
+ Zerops will create a PostgreSQL database installed in a single
+ container. Useful for non-essential data or dev environments.
+
+ Your data is stored only in a single container. If the container or the
+ the underlying physical machine fails, your data since the last backup are
+ lost. Zerops doesn't provide any automatic repairs of a single node
+ PostgreSQL services.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto-scaling parameters.
+ All verticalAutoscaling attributes are optional. Not specified
+ attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+:::caution
+The PostgreSQL service **hostname** and **mode** are fixed after the service is created. They can't be changed later.
+:::
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project will be created.
+ --workingDie string Sets a custom working directory. The default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+The maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add PostgreSQL service to an existing project
+#### Example
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```bash
+# array of project services
+services:
+ -
+ # service name
+ hostname: postgresql1
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"NON_HA"
+ mode: NON_HA
+```
+The YAML file describes the list of one or more services that you want to add to your existing project. In the example above, one PostgreSQL service in the [single container mode](#single-container) with default [auto scaling](/postgresql/how-to/scale) configuration will be added to your project. The hostname of the new service will be set to `postgresql1`.
+The content of the `services:` section of `import.yaml` is identical to the [project description file](#create-a-project-description-file). The `import.yaml` never contains the `project:` section because the project already exists.
+When your `import.yaml` is ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command will be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+The maximum size of the `import.yaml` file is 100 kB.
+
+----------------------------------------
+
+# Postgresql > How To > Delete
+
+## Delete PostgreSQL service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete PostgreSQL using zCLI
+zCLI is the Zerops command-line tool. To delete the PostgreSQL service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Postgresql > How To > Export Import Data
+
+## Use Adminer or phpMyAdmin to export or import data
+* [Adminer ↗](https://www.adminer.org) - an open source full-featured database management tool written in PHP
+* [phpMyAdmin ↗](https://www.phpmyadmin.net) - a free software tool written in PHP, intended to handle the administration of PostgreSQL over the Web
+1. [Install the tools to Zerops](/postgresql/how-to/manage#installing-management-tools)
+2. Use their standard export or import functions
+## Use a database management tool on your workstation to export or import data
+Do you already use a database management tool that supports PostgreSQL on your workstation? Connect it securely to PostgreSQL from your local workspace via Zerops VPN.
+Zerops VPN client is included into zCLI, the Zerops command-line tool. To start the VPN connection, read [how to connect to PostgreSQL remotely](/postgresql/how-to/connect#connect-remotely).
+:::caution
+Do not use SSL/TLS protocols when connecting to PostgreSQL over VPN. Zerops PostgreSQL is not configured to support these protocols. The security is assured by the VPN.
+:::
+Once the connection to PostgreSQL is established, use the standard export or import functions of your favourite management tool.
+## Use psql CLI to export or import data
+If you are using the [psql ↗](https://www.postgresql.org/docs/current/app-psql.html) command-line client to manage your PostgreSQL on your local workspace, you can connect it securely to PostgreSQL via Zerops VPN.
+Zerops VPN client is included into zCLI, the Zerops command-line tool. To start the VPN connection, read [how to connect to PostgreSQL remotely](/postgresql/how-to/connect#connect-remotely).
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/postgresql/how-to/connect#method-2-environment-variables-recommended) are available when connected through VPN. To connect to PostgreSQL in Zerops you have to copy the [access details](/postgresql/how-to/connect#connection-details) manually from Zerops GUI.
+Use [psql ↗](https://www.postgresql.org/docs/current/app-psql.html) command to connect to PostgreSQL in Zerops:
+```sh
+psql -h [hostname] -U [user] -p [password] -d [database_name]
+```
+:::caution
+Do not use SSL/TLS protocols when connecting to PostgreSQL over VPN. Zerops PostgreSQL is not configured to support these protocols. The security is assured by the VPN.
+:::
+To export your database data and structure, use the [pg_dump ↗](https://www.postgresql.org/docs/current/backup-dump.html) command.
+```sh
+pg_dump [database_name] > dumpfilename.sql
+```
+To import your database data and structure, use the `mysql` command.
+```sh
+mysql [database_name] < dumpfilename.sql
+```
+
+----------------------------------------
+
+# Postgresql > How To > Manage
+
+This guide covers how to manage your PostgreSQL databases in Zerops, including default setup, database management tools, plugins, and best practices.
+## Default Database and User
+Zerops creates a default database and user automatically when a new PostgreSQL service is [created](/postgresql/how-to/create).
+### Database
+- **Name**: Identical to the service hostname
+- **Encoding**: `utf8mb4`
+### DB User
+- **Username**: Identical to the service hostname
+- **Password**: Generated randomly
+:::info
+For connection methods and environment variables, see the [Connect to PostgreSQL in Zerops](/postgresql/how-to/connect) page.
+:::
+:::caution Important notes
+- When changing passwords, update both the database user password and the environment variable separately - they don't automatically synchronize.
+- While both `postgresql://` and `postgres://` URI formats are valid, Zerops uses the `postgresql://` format. If your software requires `postgres://`, create a custom environment variable with this format.
+- Do not use SSL/TLS protocols for internal connections. Security is assured by the project's private network.
+:::
+## Database Management Tools
+You can use any PostgreSQL management tool of your choice to administer your databases in Zerops. For convenience, Zerops provides ready-to-use recipes for two popular web-based database management tools:
+* [AdminerEvo](https://github.com/adminerevo/adminerevo) - developed by the AdminerEvo community and is a continuation of the [Adminer](https://www.adminer.org) project by Jakub Vrána
+* [phpMyAdmin](https://www.phpmyadmin.net) - a popular free database administration tool that works with both MySQL and PostgreSQL databases
+### Installing Management Tools
+You can install these tools with a simple one-click import in Zerops:
+1. In Zerops GUI, open your project and select **Import services** from the left menu
+2. Copy and paste one of the following YAML configurations:
+### Accessing Management Tools
+After installation, you can access these tools via VPN:
+1. [Start the Zerops VPN](/references/vpn)
+2. Type `http://adminerevo` or `http://phpmyadmin` in your browser
+:::tip
+Try `http://adminerevo.zerops` or `http://phpmyadmin.zerops` if you encounter any connection issues.
+:::
+:::caution
+Do not use https when connecting to management tools via VPN.
+:::
+## Database Tools on Your Workstation
+You can use various database management tools from your local workstation to connect to your PostgreSQL database in Zerops:
+1. **Establish a secure tunnel** using the [Zerops VPN](/references/vpn) to create an encrypted connection to your Zerops project
+2. **Obtain the [connection details](/postgresql/how-to/connect#connection-details)** from Zerops GUI
+ - Environment variables are not available through VPN connections
+3. Connect with your **preferred database tool**
+ - Do not use SSL/TLS (security is provided by the VPN)
+ - **Desktop Database Tools** - popular GUI tools like pgAdmin, DBeaver, DataGrip, or any other PostgreSQL-compatible client will work with Zerops
+ - **Command Line with psql** - connect using the standard PostgreSQL command-line client with the credential obtained above:
+ ```sh
+ psql -h [hostname] -U [user] -d [database_name]
+ ```
+:::tip
+ Try `{hostname}.zerops` instead of just `{hostname}` if you encounter any connection issues.
+:::
+## How to install and manage PostgreSQL plugins
+### Viewing available plugins
+You can list all available PostgreSQL plugins by running the following query *(superuser privileges not required)*:
+```sql
+SELECT * FROM pg_available_extensions ORDER BY name;
+```
+### Installing plugins (requires superuser)
+1. **Connect with superuser credentials**:
+ - Use the `superUser` (user `postgres`) and `superUserPassword` environment variables from your PostgreSQL service
+2. **Switch to your service database**:
+ When logging in as the superuser, you're initially in the `postgres` database, not your service database.
+3. **Install required extensions**:
+ ```sql
+ CREATE EXTENSION pg_stat_statements;
+ CREATE EXTENSION vector;
+ CREATE EXTENSION postgis;
+ ```
+:::warning
+Currently, it is not possible to add new plugins that are not already listed in `pg_available_extensions`.
+:::
+When working with text search functionality, you'll need to reference the correct `stop`, `dict`, and `affix` files when creating dictionaries in your database. These files are essential for proper text search configuration.
+Zerops PostgreSQL includes the following dictionary files:
+**Stop word files** - used to remove common words that don't add significant meaning:
+```
+czech.stop
+danish.stop
+dutch.stop
+english.stop
+finnish.stop
+french.stop
+german.stop
+hungarian.stop
+italian.stop
+nepali.stop
+norwegian.stop
+polish.stop
+portuguese.stop
+russian.stop
+slovak.stop
+spanish.stop
+swedish.stop
+turkish.stop
+```
+**Dictionary and affix files** - used for stemming and word normalization:
+```
+cs_CZ.affix
+cs_CZ.dict
+en_US.affix
+en_US.dict
+pl_PL.affix
+pl_PL.dict
+sk_SK.affix
+sk_SK.dict
+```
+**Special rules file:**
+```
+unaccent.rules
+```
+For more information on text search dictionaries, refer to the [PostgreSQL documentation](https://www.postgresql.org/docs/16/textsearch-dictionaries.html).
+
+----------------------------------------
+
+# Postgresql > How To > Scale
+
+Zerops performs an automated scaling of hardware resources required to run your database based on its usage. If the current use of your database does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your database is under heavy load or needs to store more data, then auto scaling increases the resources for the database to make sure it runs smoothly.
+## Configure auto scaling
+To change the auto scaling settings go to the PostgreSQL service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU Mode
+**Shared**
+Your database gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your database gets is depended on other applications running on the same CPU core. At best case scenario your database gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your database.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+For most cases, the default parameters will work without issues. If you need to limit the cost of the PostgreSQL service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient PostgreSQL performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/postgresql/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your database needs.
+:::
+:::tip
+[Learn more](/postgresql/how-to/scale) about PostgreSQL auto scaling.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your database starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your database.
+
+If your database doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+The default minimum free RAM is preset according to the database type and version. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your database need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the database is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each PostgreSQL service. Zerops will never scale above the entered values. If your database is in [highly available mode], maximal resources are identical for all containers of the PostgreSQL service.
+### Not enough resources to scale up
+Zerops moves a container between physical machines only if there are not enough resources on the current physical machine to scale the container up. When this happens the behaviour is different for [highly available](/postgresql/how-to/create#highly-available) and [single container](/postgresql/how-to/create#single-container) mode.
+### Automatic scale down
+When the database no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the database from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal scaling
+Zerops provides PostgreSQL service in two modes: [Highly available](/postgresql/how-to/create#highly-available) and [Single container](/postgresql/how-to/create#single-container). The PostgreSQL service mode is chosen when creating a new service and cannot be changed later.
+Zerops doesn't scale PostgreSQL service horizontally, it means no containers are added or removed from the database cluster. Only in case of a failure of a container or the underlying physical machine, Zerops automatically replaces the broken container with a new one.
+## Monitor database resources
+Zerops provides information about how much hardware resources the PostgreSQL service is currently using. Go to PostgreSQL service detail in Zerops GUI and select **Service dashboard & database containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Postgresql > Overview
+
+[PostgreSQL ↗](https://www.postgresql.org/) is a powerful, open source object-relational database system with over 35 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.
+## Feature Highlights
+### Connect to PostgreSQL service
+### Others
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Python > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing Python application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](/python/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple Python web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Python > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](/python/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](/python/how-to/build-pipeline#ports) `8000`, simply use `http://app:8000`
+:::info
+Do not use `https://` when communicating with Python from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use Python environment variables
+Zerops creates default environment variables for each Python service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](/python/how-to/env-variables#generated-env-variables) of the Python service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](/python/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your Python application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access Python application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/python/how-to/env-variables) are available when connected through VPN. To connect to your Python application in Zerops set the hostname and [internal port](/python/how-to/build-pipeline#ports) e.g. http://app:8000
+:::info
+Do not use `https://` when communicating with Python over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your Python service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your Python service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/python/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Python > How To > Build Pipeline
+
+Zerops provides a customizable build and runtime environment for your Python application.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: python@latest
+ # OPTIONAL. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - app.py
+ # OPTIONAL. Copy files from build container to runtime container.
+ addToRunPrepare:
+ - requirements.txt
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ # cache: file.txt
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: python@latest
+ # OPTIONAL. Sets the internal port(s) your app listens on:
+ ports:
+ # port number
+ - port: 8000
+ # OPTIONAL. Customize the runtime Python environment by installing additional
+ # dependencies to the base Python runtime environment.
+ # prepareCommands:
+ # - python3 -m pip install --ignore-installed -r requirements.txt
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Python application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # REQUIRED. Your Python application start command
+ start: python3 app.py
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your Python application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Build pipeline configuration
+### base
+_REQUIRED._ Sets the base technology for the build environment.
+Following options are available for Python builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: python@latest
+ ...
+```
+ The base build environment contains {data.alpine.default}, the selected
+ major version of Python, Zerops command line tool, `pip` and `git`.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base:
+ - python@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
+To customize your build environment use the [prepareCommands](/python/how-to/build-pipeline#preparecommands) attribute.
+:::note
+Modifying the base technology will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### os
+_OPTIONAL._ Sets the operating system for the build environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customized.
+:::
+:::note
+Changing the OS setting will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache behavior.
+:::
+### prepareCommands
+_OPTIONAL._ Customizes the build environment by installing additional dependencies or tools to the base build environment.
+The base build environment contains:
+- {data.alpine.default}
+- selected version of Python defined in the [base](/python/how-to/build-pipeline#base) attribute
+- [Zerops command line tool](/references/cli)
+- `pip` and `git`
+To install additional packages or tools add one or more prepare commands:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: python@latest
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ prepareCommands:
+ - apt install python3-pip # already installed for Python services
+ ...
+```
+When the first build is triggered, Zerops will
+1. create a build container
+2. download your application code from your repository
+3. run the prepare commands in the defined order
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::note
+These commands are skipped when using cached environment. Modifying `prepareCommands` will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache invalidation.
+:::
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/python/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all prepare commands are finished, your custom build environment is ready for the build phase.
+#### Run prepare commands as a single shell instance
+Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it.
+```yaml
+prepareCommands:
+ - |
+ apt update
+ apt install python3-pip # already installed for Python services
+```
+#### Run prepare commands as a separate shell instances
+When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command.
+```yaml
+prepareCommands:
+ - apt update
+ - apt install python3-pip # already installed for Python services
+```
+### deployFiles
+_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
+```yaml
+# REQUIRED. Select which files / folders to deploy after
+# the build has successfully finished
+deployFiles:
+ - app.py
+```
+Determines files or folders produced by your build, which should be deployed to your runtime service containers.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Examples
+Deploys a folder, and a file from the project root directory:
+```yaml
+deployFiles:
+ - app.py
+```
+Deploys the whole content of the build container:
+```yaml
+deployFiles: .
+```
+Deploys a folder, and a file in a defined path:
+```yaml
+deployFiles:
+ - ./path/to/file.txt
+ - ./path/to/dir/
+```
+#### How to use a wildcard in the path
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+Deploys all folders that are located in any path that begins with `/path/to/`
+```yaml
+deployFiles: ./path/to/~/
+```
+Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/
+```
+:::note Example
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+:::
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+_OPTIONAL._ Defines which files or folders will be cached for the next build.
+```yaml
+# OPTIONAL. Which files / folders you want to cache for the next build.
+# Next builds will be faster when the cache is used.
+cache: file.txt
+```
+The cache attribute helps optimize build times by preserving specified files between builds.
+The cache attribute supports the [~ wildcard character](#how-to-use-a-wildcard-in-the-path).
+Learn more about the [build cache system](/features/build-cache) in Zerops.
+### envVariables
+_OPTIONAL._ Defines the environment variables for the build environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ base: python@latest
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ PYTHON_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/python/how-to/env-variables) in Zerops.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current Python version for your runtime.
+Following options are available for Python builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: python@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: python@latest
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the
+ selected major version of Python, Zerops command line tool, `pip` and `git`.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: python@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base:
+ - python@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customize your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a Python service with hostname = "app" and port = 8000 from another service of the same project, simply use `app:8000`. Read more about [how to access a Python service](/python/how-to/access).
+Each port has following attributes:
+
+ Parameter
+ Description
+
+ port
+ Defines the port number. You can set any port number between 10 and 65435. Ports outside this interval are reserved for internal Zerops systems.
+
+ protocol
+ Optional. Defines the protocol. Allowed values are TCP or UDP. Default value is TCP.
+
+ httpSupport
+ Optional. httpSupport = true is the default setting for TCP protocol. Set httpSupport = false if a web server isn't running on the port. Zerops uses this information for the configuration of public access. httpSupport = true is available only in combination with the TCP protocol.
+
+### prepareCommands
+_OPTIONAL._ Customises the Python runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base Python environment contains {data.alpine.default}, the selected
+ major version of Python, Zerops command line tool, `pip` and `git`. To install additional packages or tools add one or more
+ prepare commands:
+```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 Python runtime environment.
+ prepareCommands:
+ - python3 -m pip install --ignore-installed -r requirements.txt
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/python/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/python/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+When the prepare cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build:prepareCommands](#preparecommands).
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.default} the
+ selected major version of Python, Zerops command line tool, `pip` and `git`.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare:
+ - requirements.txt
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base Python runtime environment.
+ prepareCommands:
+ - python3 -m pip install --ignore-installed -r requirements.txt
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Python application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your Python application is started via the [start command](/python/how-to/build-pipeline#start).
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](/python/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](/python/how-to/build-pipeline#preparecommands-1) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](/python/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances. The format is identical to [build:prepareCommands](#preparecommands).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ PYTHON_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/python/how-to/env-variables) in Zerops.
+### start
+_REQUIRED._ Defines the start command for your Python application.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Python application start command
+ start: app.py
+```
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Python application start command
+ start: app.py
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Python application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Python application start command
+ start: app.py
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+### crontab
+_OPTIONAL._ Defines cron jobs.
+Setup cron jobs in the following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ crontab:
+ # REQUIRED. Sets the command to execute:
+ - command: ""
+ # REQUIRED. Sets the interval time to execute:
+ timing: "0 * * * *"
+```
+Read more about setting up [cron](/references/cron) in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](/python/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](/python/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Python application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](/python/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Python > How To > Build Process
+
+
+## Description of the build process
+Zerops starts a temporary build container and performs following actions:
+1. Installs the build environment:
+ - Sets up base system and Go runtime
+ - Restores cached files if available (based on `build.cache` configuration)
+ - Validates cache against current `build.os`, `build.base`, and `build.prepareCommands`
+2. Downloads your application source code from [GitHub ↗](https://www.github.com), [GitLab ↗](https://www.gitlab.com) or via [Zerops CLI](/references/cli)
+3. Optionally [customizes the build environment](#customize-python-build-environment)
+4. Uploads the application artefact to the internal Zerops storage
+5. Preserves specified files for future builds (based on `build.cache` configuration)
+6. Optionally [customizes the runtime environment](/python/how-to/customize-runtime)
+7. [Deploys your application](/python/how-to/deploy-process)
+The build container is automatically deleted after the build has finished or failed.
+## Cancel running build
+When you know that the running build is not correct and you want to cancel it, you can do it in Zerops GUI. Go to the service detail, select **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Cancel build** button.
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+## Customize Python build environment
+The default Python build environment contains:
+- {data.alpine.default}
+- selected version of Python defined in `zerops.yaml` [build.base](/python/how-to/build-pipeline#base) parameter
+- [zCLI](/references/cli), Zerops command line tool
+- `pip` and `git`
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/python/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](/python/how-to/build-pipeline#preparecommands) commands to your `zerops.yaml`.
+:::info
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::
+## Python build hardware resources
+Build of your Python application is run in a separate build container with following resource configuration:
+| HW resource | Minimum | Maximum |
+| ------------- | ------- | ------- |
+| **CPU cores** | 6 | 20 |
+| **RAM** | 8 GB | 8 GB |
+| **Disk** | 1 GB | 100 GB |
+| **Disk** | 1 GB | 100 GB |
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+## Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops will terminate the build pipeline and delete the build container.
+## Troubleshooting build-related problems
+### Failure of a build prepare command
+If any [prepare command](/python/how-to/build-pipeline#preparecommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/python/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom build environment is ready for the build phase.
+### Invalidate the build cache
+If you encounter unexpected build behavior or dependency issues, the problem might be related to [cached build data](/features/build-cache). While Zerops maintains the build cache to speed up deployments, sometimes you may need to start fresh.
+To invalidate the build cache:
+1. Go to your service detail in Zerops GUI
+2. Choose **Pipelines & CI/CD Settings** from the left menu
+3. Click on the **Invalidate build cache** button
+This will force Zerops to run the next build clean, including all prepare commands, which can help resolve cache-related issues. After invalidation, your next build will also create a fresh cache.
+
+----------------------------------------
+
+# Python > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart Python service in Zerops GUI
+To stop the Python service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped Python service choose the **Start** item from the same menu.
+To restart the Python service choose the **Restart** item from the same menu.
+## Stop and start Python using zCLI
+zCLI is the Zerops command-line tool. To stop and start the Python service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Python > How To > Create
+
+Zerops provides a Python runtime service with extensive build support. Python runtime is highly scalable and customisable to suit both development and production.
+## Create Python service using Zerops GUI
+First, set up a project in Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new Python service:
+### Choose Python version
+Following Python versions are currently supported:
+:::info
+You can [change](/python/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app","cache", "gui" etc. Duplicate services with the same name in the same project are forbidden.
+#### Limitations:
+- maximum 25 characters
+- must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created. It can't be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as password, tokens, salts, certificates etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting the secret environment variables is optional. You can set them later in Zerops GUI.
+Read more about [different types of env variables](/python/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Set auto scaling configuration
+Zerops scales the Python services automatically both vertically and horizontally. Vertical scaling means increasing or decreasing the hardware resources (CPU, RAM and disk) of a Python container. Horizontal scaling adds or removes whole containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Python service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Python service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Python performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/python/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+:::info
+You can change the vertical auto scaling parameters later.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Python service. When your Python service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ Parameter
+ Value
+
+ minimum containers
+ 1
+
+ maximum containers
+ 6
+
+Python service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](/python/how-to/scaling) about Python auto scaling.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Create Python service using zCLI
+zCLI is the Zerops command-line tool. To create a new Python service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/python/how-to/create#create-a-project-description-file)
+3. [Create a project with a Python and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### Basic example:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in python@{version} format
+ type: python@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one Python version 3.12 service with default [auto scaling](/python/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/python/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Python and PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in python@{version} format
+ type: python@latest
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create secret env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+ - # second service hostname
+ hostname: db
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain a Python service and a [PostgreSQL](/postgresql/overview) service.
+Python service with "app" hostname, the internal port(s) the service listens on will be defined later in the zerops.yaml. Python service will run on version 3.12 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+ Limitations
+
+ name
+ The name of the new project. Duplicates are allowed.
+
+ description
+ Optional. Description of the new project.
+ Maximum 255 characters.
+
+ tags
+ Optional. One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects.
+
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains Python and PostgreSQL services but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ The hostname of the new service will be set to the `hostname` value.
+
+ Limitations:
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [Python service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+
+ All verticalAutoscaling attributes are optional. Not specified attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add Python service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in python@{version} format
+ type: python@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Python service version 3.12 with default [auto scaling](/python/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Python > How To > Customize Runtime
+
+
+The default Python runtime environment contains:
+- {data.alpine.default}
+- Selected version of Python when the runtime service was created.
+- [zCLI](/references/cli)
+- Git and PIP
+:::note
+To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yaml/specification#os--1) attribute.
+Additional packages and tools can be installed using [run.prepareCommands](/zerops-yaml/specification#preparecommands--1).
+:::
+## Runtime Flow
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. Create a prepare runtime container
+2. Optionally: [copy selected folders or files from your build container](/python/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. Run the run.prepareCommands in the defined order
+### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/python/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+The prepare runtime container is automatically deleted after the prepare runtime phase has finished or failed.
+### Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the build.addToRunPrepare and run.prepareCommands attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+
+----------------------------------------
+
+# Python > How To > Delete
+
+## Delete Python service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete Python using zCLI
+zCLI is the Zerops command-line tool. To delete the Python service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Python > How To > Deploy Process
+
+
+## Application artefact
+When the [build phase](/python/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](/python/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/python/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/python/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/python/how-to/build-pipeline#initcommands)
+4. Starts your application using the [start command](/python/how-to/build-pipeline#start)
+5. Optionally waits until the [readiness check](/python/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/python/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customize the runtime environment](/python/how-to/customize-runtime).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The Python process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready to handle requests right after it is started via the [start command](/python/how-to/build-pipeline#start), configure a [readiness check](/python/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your Python service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/python/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Python > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+
+ Type
+ Environment
+ Defined in
+
+ basic
+ build
+ zerops.yaml
+
+ basic
+ runtime
+ zerops.yaml
+
+ secret
+ runtime
+ Zerops GUI
+
+Use the [secret env variables](/python/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](/python/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/python/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](/python/how-to/create) a new Python service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made to environment variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The Python process running in the container receives the list env variables only when it starts. Update of the env variables while the Python process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+## Referencing other env variables
+These restrictions apply to all [types of env variables](/python/how-to/env-variables#types-of-env-variables-in-zerops).
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your Python runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the Python service. The Python process running in the container receives the list env variables only when it starts. Update of the env variables while the Python process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a Python service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your Python app
+Zerops passes all environment variables from all project services when your Python app is deployed and started.
+To access the local environment variable i.e. the variable set to this Python service in your app, use:
+```sh
+os.environ['YOUR_VARIABLE_KEY_HERE']
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+
+----------------------------------------
+
+# Python > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Python > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](/python/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](/python/how-to/build-pipeline#preparecommands-1) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the _first runtime container_ in Zerops CLI use
+```sh
+zcli service log
+```
+For an _aggregate log_ from all service's runtime containers omit the `@1`
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## Python logging configuration
+Zerops logs all messages sent
+- to the standard error (`stderr`)
+- to the standard output (`stdout`)
+- via the Python `print` or `logger.Info` methods
+### Severity level
+By default the `print` or `logger.XXX` methods create a message with the `Informational (6)` severity.
+Add a severity number in the `` format as a prefix to set a custom severity as shown below:
+```python
+import logging
+logger = logging.getLogger(__name__)
+logger.Info('A message with the informational severity ...')
+logger.Info('Emergency (0) severity > system is unusable.')
+logger.Info('Alert (1) severity > action must be taken immediately.')
+logger.Info('Critical (2) severity > critical conditions.')
+logger.Info('Error (3) severity > error conditions.')
+logger.Info('Warning (4) severity > warning conditions.')
+logger.Info('Notice (5) severity > normal, but significant, condition.')
+logger.Info('Informational (6) severity > informational message.')
+logger.Info('Debug (7) severity > debug-level message.')
+```
+:::info
+`logger.Info`, `logger.Warning`, `logger.Debug`
+, `logger.Error` and `logger.Critical` are just aliases to
+the `logger.Info` method. They don't set the appropriate severity
+number. Use the `<N>` prefix instead. :::
+
+----------------------------------------
+
+# Python > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the Python service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Python service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Python service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Python performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/python/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Python service. When your Python service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Python service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each Python service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the Python service.
+### Not enough resources to scale up
+If one of the Python containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the Python service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor Python resources
+Zerops provides information about how much hardware resources the Python service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Python > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your Python service directly when creating a new shared storage service. Just select your Python service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the Python service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create Python service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new Python service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/python/how-to/shared-storage#create-a-project-description-file)
+3. [Create a project with a Python service and a shared storage](/python/how-to/shared-storage#create-a-project-with-a-python-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](/python/how-to/create#create-a-project-description-file) how to define the Python service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Python and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in python@{version} format
+ type: python@latest
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the Python service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with a Python service and a shared storage
+Follow the article [How to create a project based on the description.yaml](/python/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Python > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](/python/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](/python/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](/python/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Python > How To > Upgrade
+
+You can upgrade or downgrade your Python service to a different major Python version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/python/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Python version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Python version for your runtime.
+If you want to build your application with a different major Python version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
+
+----------------------------------------
+
+# Python > Overview
+
+[Python ↗](https://www.python.org/) is a programming language that lets you work quickly and integrate systems more effectively..
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-python-hello-world), a **_recipe_**, containing the most simple Python web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of Python running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-python-hello-world/blob/main/import-project/description.yaml)):
+```yaml
+project:
+ name: my-first-project
+services:
+ - hostname: helloworld
+ type: python@latest
+ minContainers: 1
+ maxContainers: 3
+ buildFromGit: https://github.com/zeropsio/recipe-python-hello-world@main
+ enableSubdomainAccess: true
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://helloworld-24-8080.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+Hello, World!
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+## How to start
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Python > Tutorial > Quickstart
+
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-python-hello-world), a **_recipe_**, containing the most simple Python web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of Python running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-python-hello-world/blob/main/import-project/description.yaml)):
+```yaml
+project:
+ name: my-first-project
+services:
+ - hostname: helloworld
+ type: python@latest
+ minContainers: 1
+ maxContainers: 3
+ buildFromGit: https://github.com/zeropsio/recipe-python-hello-world@main
+ enableSubdomainAccess: true
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://helloworld-24-8080.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+Hello, World!
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Python > Tutorial > Runtime Sql
+
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-onboarding-python), a **_recipe_**, containing a PostgreSQL service with a simple Python application. The repo will be used as a source from which the app will be built.
+:::tip
+Follow the steps below and when everything is working as expected, fork the repo, try making various changes or be bold and connect your own.
+:::
+:::note
+In the detail of each step, you can find a link with more information about the topic.
+:::
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+ 2. Create a project.
+
+ Learn more about projects in
+ Zerops. See how to import a whole project into Zerops.
+
+ 3. In the left menu, click on Import services, copy & paste the
+ contents of the `import-services.yaml` config file from the recipe
+ repository of your choice. Then click on Import service.
+
+ Learn more about services in Zerops and how to import a service to an existing project.
+
+ The yaml file includes a `buildFromGit` directive, which ensures
+ a one-time build from Git repository source. See how to connect a Github or Gitlab repository to be able to
+ trigger automatic builds & deploys.
+
+ 4. Several pipelines are created, one for project creation and the rest for the activation of the services. Wait for all to finish.
+
+ Learn more about how the pipelines can be triggered and about build and deploy processes of a Python application in Zerops.
+Learn more about how to access build log of your Python service in Zerops.
+
+ 5. In the service detail, open the Public access & internal ports section, and Enable Zerops Subdomain.
+
+ Learn more about how to access your
+ Python service in Zerops.
+
+ 6. Once the pipeline has finished, click on the activated subdomain URL. You should see a simple page with
+`Entry added successfully with random data: f47ac10b-58cc-0372-8567-0e02b2c3d479. Total count: 1`
+
+ Congratulations! You have created your first application in Zerops, and we hope to see your own projects soon.
+For now, check out other features, such as environment variables, runtime log and scaling.
+
+ 7. One of the services is `adminer`, a database management tool.
+ See how to access it.
+
+ Learn more about how to use psql command-line tool instead or how to import and export data from your database.
+
+8. Feel free to make any changes to your project, fork the repo or connect your
+own. Also see other
+ Python
+ and
+ PostgreSQL
+ recipes on our Github page.
+
+:::tip
+Have you got any additional question? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Python > Tutorial > Step By Step
+
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-python-hello-world), a **_recipe_**, containing the most simple Python web application. The repo will be used as a source from which the app will be built.
+:::tip
+Follow the steps below and when everything is working as expected, fork the repo, try making various changes or be bold and connect your own.
+:::
+:::note
+In the detail of each step, you can find a link with more information about the topic.
+:::
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+ 2. Create a project.
+
+ Learn more about projects in
+ Zerops. See how to import a whole project into Zerops.
+
+ 3. In the left menu, click on Import services, copy & paste the
+ contents of this yaml file and click on Import service.
+
+ Learn more about services in
+ Zerops and how to import a service to an existing project.
+
+ The yaml file includes a `buildFromGit` directive, which ensures
+ a one-time build from Git repository source. See how to connect a Github or Gitlab repository to be able to
+ trigger automatic builds & deploys.
+
+ 4. Two pipelines are created, one for project creation and one for the service activation. Wait for both to finish.
+
+ Learn more about how the pipelines can be triggered and about build and deploy processes of a Python application in Zerops.
+Learn more about how to access build log of your Python service in Zerops.
+
+ 5. In the service detail, open the Public access & internal ports section, and Enable Zerops Subdomain.
+
+ Learn more about how to access your
+ Python service in Zerops.
+
+ 6. Once the pipeline has finished, click on the activated subdomain URL:
+ You should see a simple page with `Hello World!` printed.
+
+ Congratulations! You have created your first application in Zerops, and we hope to see your own projects soon.
+For now, check out other features, such as environment variables, runtime log and scaling.
+
+7. Feel free to make any changes to your project, fork the repo or connect your own. Also see other Python recipes on our Github page.
+
+:::tip
+Have you got any additional question? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Qdrant > Overview
+
+[Qdrant](https://qdrant.tech/) on Zerops provides a fully managed vector database solution designed for AI applications. Focus on building vector search features while we handle infrastructure maintenance, high availability, and data protection.
+## Supported Versions
+Currently supported Qdrant versions:
+Import configuration version:
+## Deployment Modes
+#### Non-HA Mode
+- Single node setup ideal for development and non-production projects
+- Simple deployment and management
+#### HA Cluster
+- Automatically configured with 3 nodes
+- Recommended for production environments
+- Built-in data replication across nodes
+- By default (`automaticClusterReplication=true`), automatically creates replicas of all shards across all three nodes
+ - Can be disabled by setting `automaticClusterReplication` to `false`
+- Automatic cluster recovery and node replacement in case of failures
+## Data Backup
+Backups are performed in `snapshot` format. For HA Cluster, backups are created on the primary container (leader) and saved to the local disk before being compressed and streamed to backup storage. The local file is then deleted.
+For general information about backup frequency and storage limits, see our [Backup documentation](/features/backup).
+## Network Architecture & Access
+Qdrant can be accessed only from services within the same project, public access is not available.
+### API Keys
+API key authentication is required for both HTTP and gRPC API calls. Include the key in your request headers. The keys can be found in generated environment variables of the service:
+- **API Key:** Full access API key for administrative operations (creating collections, indexing)
+- **Read-only API Key:** Restricted API key for search operations
+#### HTTP API
+- **Port:** `6333`
+- **Connection String:** `http://${hostname}:${port}`
+#### gRPC API
+- **Port:** `6334`
+- **gRPC Connection String:** `tcp://${hostname}:${grpcPort}`
+## Support
+For advanced configurations or custom requirements:
+- Join our [Discord community](https://discord.gg/zeropsio)
+- Contact support via [email](mailto:support@zerops.io)
+
+----------------------------------------
+
+# References > Api
+
+The Zerops REST API allows you to programmatically interact with Zerops platform by providing access to resources like projects, services, users, billing, and configurations.
+## Base URL
+All API requests should be made to:
+```
+https://api.app-prg1.zerops.io/api/rest/public
+```
+## Authentication
+The API uses Bearer token authentication. You can obtain your Personal access token from the **Access Token management** section in the Zerops GUI.
+Include the token in the Authorization header:
+```
+Authorization: Bearer
+```
+## API Resources
+:::note
+Some resource groups have non-obvious naming:
+- `/service-stack` endpoints handle services management
+- `/user-data` endpoints handle environment variables management
+:::
+View the [full Swagger documentation](https://api.app-prg1.zerops.io/api/rest/public/swagger) or jump to a specific resource group:
+
+ Group
+ Description
+
+ /app-version
+ Manage application versions, builds, and deployments
+
+ /auth
+ Authentication and token management
+
+ /billing
+ Billing operations and payment management
+
+ /client
+ Client account management
+
+ /client-user
+ User management within client accounts
+
+ /github
+ GitHub repository connections and authorization
+
+ /gitlab
+ GitLab repository connections and authorization
+
+ /project
+ Project management operations
+
+ /project-env
+ Project environment variables management
+
+ /public-http-routing
+ HTTP routing configuration
+
+ /public-port-routing
+ Port routing and firewall rules configuration
+
+ /service-stack
+ Service stack operations and configuration
+
+ /settings
+ System settings and configurations
+
+ /user
+ User account management
+
+ /user-data
+ Environment variables management
+
+ /user-notification
+ User notifications management
+
+ /user-token
+ Personal access tokens management
+
+
+----------------------------------------
+
+# References > Cli
+
+zCLI is the command-line tool for Zerops that allows users to manage services, simplify interactions, and configure infrastructure directly from the terminal.
+For detailed information, see the [Configuration](/references/cli/configuration) and [Commands Reference](/references/cli/commands) pages.
+## Platforms
+zCLI currently supports:
+- Linux (x86 & x64)
+- macOS (x86-64 & ARM64)
+- Windows (x64)
+## Get started
+### Manual Installation
+To download the zCLI directly, get the [latest release](https://github.com/zeropsio/zcli/releases) from GitHub.
+### Linux/MacOS
+```sh
+curl -L https://zerops.io/zcli/install.sh | sh
+```
+zCLI will be installed inside `/usr/bin` or `/usr/local/bin`.
+### Windows
+```powershell
+irm https://zerops.io/zcli/install.ps1 | iex
+```
+zCLI will be installed inside `C:\Program Files\` or `C:\Program Files (x86)\`
+### Using Package Managers
+You can also install zCLI using package managers:
+```sh
+npm i -g @zerops/zcli
+```
+```sh
+yarn global add @zerops/zcli
+```
+### NixOS
+:::note
+Make sure `nix-command` and flakes are enabled, if not. You can also use `--extra-experimental-features 'nix-command flakes'` with `nix`.
+:::
+Clone the [zCLI repository](https://github.com/zeropsio/zcli) and build the binary.
+```
+git clone https://github.com/zeropsio/zcli
+```
+```
+cd zcli
+```
+```
+nix develop
+```
+```
+nix build
+```
+You can find zCLI binary inside `result/bin`.
+## Personal access tokens
+Personal tokens allow you to securely access Zerops directly. You can create one or more personal tokens and manage them in [Zerops GUI](https://app.zerops.io).
+### Managing your access tokens
+To create a new personal access token, go to [Access Tokens management](https://app.zerops.io/settings/token-management) and click "Generate a new access token".
+
+You may delete an access token anytime.
+### Using access tokens
+You may use an access token to access Zerops using this command:
+```sh
+zcli login
+```
+
+----------------------------------------
+
+# References > Cli > Commands
+
+## Basic Usage
+```sh
+zcli [flags]
+```
+:::note Tip
+All commands support the `-h, --help` flag which displays help information about the command.
+:::
+:::tip Configuration
+For detailed information about configuration options, environment variables, and logging, see the [Zerops CLI Configuration](/references/cli/configuration) page.
+:::
+## Command Groups
+- [Account & VPN](#account--vpn)
+- [Project Management](#project-management)
+- [Service Operations](#service-operations)
+- [Utility Commands](#utility-commands)
+## Account & VPN
+### login
+Logs you into Zerops using a generated token or your login credentials.
+```sh
+zcli login
+```
+### logout
+Disconnects from VPN and logs out from your Zerops account.
+```sh
+zcli logout
+```
+### vpn up
+Connects to the Zerops VPN.
+```sh
+zcli vpn up [projectId] [flags]
+```
+**Flags:**
+- `--auto-disconnect` - Automatically disconnect from VPN if already connected
+- `--mtu int` - Set custom MTU value for Wireguard interface (default: 1420)
+- `--projectId string` - Required when you have access to multiple projects
+:::note
+You can set a default project ID for VPN connections in a `.zcli.yml` file or via the `ZEROPS_PROJECTID` environment variable. See the [Configuration](/references/cli/configuration) page for details.
+:::
+### vpn down
+Disconnects from the Zerops VPN.
+```sh
+zcli vpn down
+```
+:::note
+For more detailed information about Zerops VPN configuration and troubleshooting, visit the [VPN Documentation](/references/vpn).
+:::
+## Project Management
+### project list
+Lists all projects you have access to.
+```sh
+zcli project list
+```
+### project delete
+Deletes a project and all its services.
+```sh
+zcli project delete [projectId] [flags]
+```
+**Flags:**
+- `--confirm` - Skip confirmation prompts for destructive operations
+- `--projectId string` - Required when you have access to multiple projects
+### project project-import
+Creates a new project with one or more services from a YAML definition.
+```sh
+zcli project project-import [flags]
+```
+**Flags:**
+- `--orgId string` - Organization ID where the project should be created (required for multiple organizations)
+- `--workingDir string` - Sets a custom working directory (default: "./")
+### project service-import
+Creates one or more services in an existing project from a YAML definition.
+```sh
+zcli project service-import [flags]
+```
+**Flags:**
+- `--projectId string` - Required when you have access to multiple projects
+### scope project
+Sets the default project for commands that require a project ID.
+```sh
+zcli scope project [projectId]
+```
+:::tip
+Instead of using the `scope project` command, you can also set a default project ID in a `.zcli.yml` file or via the `ZEROPS_PROJECTID` environment variable. See the [Configuration](/references/cli/configuration) page for details.
+:::
+### scope reset
+Resets the default project and service scope.
+```sh
+zcli scope reset
+```
+## Service Operations
+### service list
+Lists all services in a project.
+```sh
+zcli service list [flags]
+```
+**Flags:**
+- `--projectId string` - Required when you have access to multiple projects
+### service push
+Builds your application in Zerops and deploys it. This is the recommended way to deploy your code.
+```sh
+zcli service push [serviceIdOrName] [flags]
+```
+**Flags:**
+- `--archiveFilePath string` - Creates a tar.gz archive with application code
+- `-g, --deployGitFolder` - Include the .git folder in the upload
+- `--disableLogs` - Disable logs during push
+- `-v, --verbose` - Log additional debug data to the zCLI [debug log file](/references/cli/configuration#logging-configuration)
+- `--projectId string` - Required when you have access to multiple projects
+- `--serviceId string` - Required when you have access to multiple services
+- `--setup string` - Choose setup to use from zerops.yml
+- `--versionName string` - Adds a custom version name
+- `--workingDir string` - Sets a custom working directory (default: "./")
+- `-w, --workspaceState string` - Defines version of workspace to push:
+ - `clean` - pushes the HEAD without local changes
+ - `staged` - pushes only staged files
+ - `all` - pushes all staged and unstaged files (default)
+- `--zeropsYamlPath string` - Sets a custom path to the zerops.yml file
+:::tip
+You can also use `zcli push` as a shorthand for `zcli service push`.
+To avoid specifying `--projectId` and `--serviceId` flags repeatedly, you can set default values in a `.zcli.yml` file or via environment variables. See the [Configuration](/references/cli/configuration) page for details.
+:::
+### service deploy
+Deploys your application to Zerops. Similar to `push` but focuses on deployment only.
+```sh
+zcli service deploy [serviceIdOrName]
+```
+**Flags:**
+Same as service push command.
+### service start/stop
+Commands to start or stop a Zerops service.
+```sh
+zcli service start [serviceIdOrName] [flags]
+zcli service stop [serviceIdOrName] [flags]
+```
+**Flags for both commands:**
+- `--projectId string` - Required when you have access to multiple projects
+- `--serviceId string` - Required when you have access to multiple services
+### service delete
+Deletes a Zerops service.
+```sh
+zcli service delete [serviceIdOrName] [flags]
+```
+**Flags:**
+- `--confirm` - Skip confirmation prompts for destructive operations
+- `--projectId string` - Required when you have access to multiple projects
+- `--serviceId string` - Required when you have access to multiple services
+### service enable-subdomain
+Enables access to your service through a Zerops subdomain.
+```sh
+zcli service enable-subdomain [serviceIdOrName] [flags]
+```
+**Flags:**
+- `--projectId string` - Required when you have access to multiple projects
+- `--serviceId string` - Required when you have access to multiple services
+### service log
+Gets service runtime or build logs to stdout.
+```sh
+zcli service log [serviceIdOrName] [flags]
+```
+**Flags:**
+- `--follow` - Continuously poll for new log messages
+- `--format ` - Log output format (FULL, SHORT, JSON, JSONSTREAM)
+- `--formatTemplate ` - Custom log format
+- `--limit ` - Number of recent log messages to return (1-1000, default: 100)
+- `--messageType ` - Select APPLICATION or WEBSERVER log messages
+- `--minimumSeverity ` - Filter by severity level
+- `--projectId string` - Required when you have access to multiple projects
+- `--serviceId string` - Required when you have access to multiple services
+- `--showBuildLogs` - Show build logs instead of runtime logs
+## Utility Commands
+### env
+Displays global environment variables and their paths.
+```sh
+zcli env
+```
+### version
+Shows the current zCLI version.
+```sh
+zcli version
+```
+### show-debug-logs
+Displays debug logs for troubleshooting.
+```sh
+zcli show-debug-logs
+```
+### support
+Displays information about how to contact Zerops support.
+```sh
+zcli support
+```
+### completion
+Generates shell autocompletion scripts.
+```sh
+zcli completion {bash|fish|powershell|zsh}
+```
+**Available Shells:**
+- `bash` - Generate autocompletion script for Bash
+- `fish` - Generate autocompletion script for Fish
+- `powershell` - Generate autocompletion script for PowerShell
+- `zsh` - Generate autocompletion script for Zsh
+**Example:**
+```sh
+zcli completion bash > ~/.zerops-completion.bash
+echo 'source ~/.zerops-completion.bash' >> ~/.bashrc
+```
+
+----------------------------------------
+
+# References > Cli > Configuration
+
+:::tip Commands Reference
+For a comprehensive reference of all available commands, see the [Commands Reference](/references/cli/commands) page.
+:::
+## Configuration Overview
+You can configure default values for zCLI commands using the following methods (in order of increasing precedence):
+1. [Configuration files](#configuration-files)
+2. [Environment variables](#environment-variables)
+3. [Command-line flags](/references/cli/commands)
+:::note Precedence
+This precedence order means that command-line flags will override environment variables, which will override settings in configuration files.
+:::
+## Configuration Files
+zCLI supports configuration via YAML files in the following locations:
+1. Global config (user home): `~/.config/zerops/zcli.yaml` or `~/zerops/zcli.yaml`
+2. Project-specific config: `./.zcli.yaml` in the root of your application repository
+The system first loads the global config file, then merges in the project-specific config if it exists:
+- Settings unique to the global config are preserved
+- Settings in the project-specific config will override any duplicate keys from the global config
+### Configuration File Examples
+**Global config file:**
+```yaml
+# Set organization-wide defaults
+workspaceState: "all"
+```
+**Project-specific file:**
+```yaml
+# Set project-specific settings
+projectId: "your-project-id"
+serviceId: "your-service-id"
+# Override global workspace state for this project
+workspaceState: "clean"
+```
+## Environment Variables
+### Standard Environment Variables
+Any flag can be set via environment variables by:
+- Using the `ZEROPS_` prefix
+- Converting the flag name to uppercase
+- Using the full flag name (not shorthand)
+**Example:**
+```sh
+export ZEROPS_WORKSPACESTATE=clean
+export ZEROPS_PROJECTID=your-project-id
+```
+### Special Environment Variables
+zCLI also recognizes special environment variables that control its behavior:
+#### Terminal Mode Configuration
+The `ZEROPS_CLI_TERMINAL_MODE` environment variable controls the interactive mode of zCLI:
+```sh
+export ZEROPS_CLI_TERMINAL_MODE=
+```
+Available modes:
+- `auto` (default): Automatically detects if interactive mode can be used and enables it when possible
+- `enabled`: Forces interactive mode to be enabled
+- `disabled`: Forces interactive mode to be disabled
+This setting affects interactive prompts, progress indicators, and other terminal-based user interface elements.
+#### Logging Configuration
+zCLI maintains a debug log file for the `service push` and `service deploy` commands. This logging feature is designed specifically for debugging purposes. The log file can be found in one of these locations:
+**1. Default locations** (checked in this order):
+ - `/var/log/zcli.log` (if zCLI has write permissions)
+ - `~/.config/zerops/zerops.log` (as fallback)
+**2. Custom location** (if specified):
+ - Set with `ZEROPS_CLI_LOG_FILE_PATH` environment variable
+:::note
+zCLI must have write permissions for the specified log file locations.
+:::
+To enable verbose logging with additional debug information, use the `--verbose` flag (or its shorthand `-v`):
+```sh
+zcli service push --verbose
+zcli service push -v
+```
+To troubleshoot deployment issues, you can check these log files using commands like `cat` or `tail`:
+```sh
+# View the entire log file
+cat ~/.config/zerops/zerops.log
+# Stream new log entries
+tail -f ~/.config/zerops/zerops.log
+```
+
+----------------------------------------
+
+# References > Debug Mode
+
+This document describes the debug mode configuration capabilities for service stacks in Zerops, allowing developers to pause execution at specific points during build and runtime processes for debugging purposes.
+## Overview
+Debug mode introduces control over two distinct phases of deployment:
+- **Build phase** - When the `buildCommands` are executed
+- **Runtime prepare phase** - When the `prepareCommands` are executed
+For each phase, you can choose when to pause the execution:
+- **Disable** - No pausing, execution proceeds normally
+- **Before first command** - Execution stops before running any commands
+- **After last command** - Execution stops after all commands complete
+- **On command fail** - Execution stops when a command fails
+Each phase can be configured with its own debug settings without affecting the other phase.
+:::warning Important
+The entire build process, including any time spent in debug mode, has a maximum duration of 60 minutes. After this time limit is reached, the build process is automatically cancelled.
+:::
+## Configuration
+The debug mode configuration can be found in your service detail under the **Pipelines & CI/CD settings**.
+
+## Debug Control
+When execution is paused in debug mode, you have several commands available to control the debugging process. Each command serves a specific purpose and affects the deployment process differently.
+### Debug Pause Points
+There are three key points where execution can pause during deployment:
+- ➠ **Disable** - Do not pause
+- ↪ **Before First Command** - Paused before any commands run
+- ✖ **On Command Failure** - Paused when a command fails
+- ✔ **After Last Command** - Paused after all commands complete
+### Available Commands
+#### Continuing Execution
+To proceed with the normal deployment process, use:
+```bash
+zsc debug continue
+```
+
+ Pause Point
+ Behavior
+
+ ↪ Before First Command
+ Begins running commands for the current phase until next possible pause point
+
+ ✖ On Command Failure
+ Skips the failed command and continues deployment
+
+ ✔ After Last Command
+ Moves to the next phase (from build to runtime prepare) or completes deployment
+
+#### Marking Success
+To force a successful deployment status, use:
+```bash
+zsc debug success
+```
+
+ Pause Point
+ Behavior
+
+ ↪ Before First Command
+ Ends current phase without running any commands
+
+ ✖ On Command Failure
+ Ignores the failure and ends current phase with success
+
+ ✔ After Last Command
+ Concludes current phase with a successful status
+
+:::note
+Requires valid `deployFiles` to work properly (fails otherwise).
+:::
+#### Forcing Failure
+To terminate the deployment with a failure status, use:
+```bash
+zsc debug fail
+```
+
+ Pause Point
+ Behavior
+
+ ↪ Before First Command
+ Marks current phase as failed without running commands
+
+ ✖ On Command Failure
+ Ends deployment with original error
+
+ ✔ After Last Command
+ Overwrites successful execution with failed status and ends deployment
+
+Each phase can be configured independently to pause at any of the points described above, giving you precise control over your debugging workflow. The 60-minute timeout ensures deployments don't remain blocked indefinitely.
+## Usage Examples
+### Example 1: Debugging Build Failures
+
+ Build phase
+ ✖ On Command Failure
+
+ Prepare runtime phase
+ ➠ Disable
+
+This configuration allows you to:
+1. Inspect the container state after a failure
+2. Make necessary adjustments
+3. Use `zsc debug continue` to resume or `zsc debug fail` to abort
+### Example 2: Validating Runtime Setup
+
+ Build phase
+ ➠ Disable
+
+ Prepare runtime phase
+ ✔ After Last Command
+
+## Best Practices
+#### Targeted Debugging
+- Enable debug mode only for the specific phase you need to investigate
+- This minimizes disruption to the deployment process
+- Helps maintain clear debugging sessions
+#### Clean Up
+- Always remember to disable debug mode after completing your debugging session
+- Set both phases to **Disable**
+- Prevents unexpected pauses in future deployments
+#### Production Consideration
+- Be cautious when using debug mode in production environments
+- Paused executions can block deployments
+- Consider using separate development services for extended debugging sessions
+#### Timeout Awareness
+- Be mindful of the 60-minute maximum debug pause time (p)lan debugging sessions accordingly)
+## Technical Considerations
+- Debug mode settings persist until explicitly changed
+- Build phase and runtime prepare phase operate independently
+- Debug commands are only available when execution is paused
+- Success signals require valid `deployFiles` to proceed
+
+----------------------------------------
+
+# References > Firewall
+
+Zerops includes a comprehensive firewall system implemented using [nftables](https://en.wikipedia.org/wiki/Nftables) to ensure platform security.
+The primary focus is on managing outbound communication to prevent potential platform misuse while maintaining the flexibility needed for legitimate applications.
+## What is a Firewall?
+A Firewall is a network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules.
+At Zerops, we implemented a robust firewall system to protect our platform and your applications.
+## Default Firewall Rules
+### Allowed Outbound Ports
+
+ Protocol
+ Port
+ Service
+
+ TCP/UDP
+ 80
+ HTTP
+
+ TCP/UDP
+ 443
+ HTTPS
+
+ TCP/UDP
+ 22
+ SSH
+
+ TCP/UDP
+ 53
+ DNS
+
+ TCP/UDP
+ 123
+ NTP
+
+ TCP
+ 587
+ SMTP (with STARTTLS)
+
+### Restricted Ports
+To maintain platform security, certain ports are restricted:
+- **TCP**: All ports in the range 1-1024 (except those explicitly allowed above)
+- **UDP**: All ports in the range 1-65535 (except those explicitly allowed above)
+> **Note**: Ports outside these ranges are generally unrestricted.
+## Security Measures
+These firewall rules are strategically implemented to:
+- Prevent unauthorized use of the Zerops infrastructure for spam or network attacks
+- Protect Zerops and its users from potential security threats
+- Maintain compliance with security best practices
+## Requesting Firewall Modifications
+If your application requires access to additional ports:
+1. Contact Zerops support at `support@zerops.io`.
+2. Include in your request:
+ - Detailed explanation of your use case.
+ - Specific ports and protocols needed.
+ - Mention your Project ID and Organization ID from your Zerops Dashboard.
+## Common Use Cases
+### Standard Web Applications (HTTP/HTTPS)
+- Full access to HTTP/HTTPS communication (ports 80/443)
+- Unrestricted DNS queries (port 53)
+- Time synchronization via NTP (port 123)
+> Enabled by default for all projects on Zerops.
+### Email Services
+- SMTP access through port 587 (with STARTTLS)
+- For detailed SMTP configuration, see our [SMTP documentation](/references/smtp)
+### Custom Applications
+- Special port requirements should be discussed with support
+- Each request is evaluated based on security implications
+
+----------------------------------------
+
+# References > Github Integration
+
+Discover how to seamlessly integrate your GitHub repository with Zerops for automated builds and deployments.
+You can choose between two powerful integration approaches: direct integration through the Zerops GUI for straightforward setup, or GitHub Actions for more customized deployment workflows.
+This guide walks you through both integration methods, helping you choose and implement the approach that best fits your team's needs.
+---
+## Prerequisites
+Before starting the integration process, ensure your repository contains a valid `zerops.yaml` configuration file located in the root directory. This file is essential for defining the build, deploy, and run processes.
+For detailed information on how to create or modify this file, refer to the [Zerops YAML configuration](/zerops-yaml/specification) guide.
+---
+## Integration via Zerops GUI
+Follow these steps to connect your GitHub repository directly with Zerops:
+1. **Access Service Settings**
+ - Log into the [**Zerops GUI**](https://app.zerops.io/)
+ - Select the relevant service from your dashboard.
+ - In the left-hand menu, navigate to **Build, Deploy, Run Pipeline Settings**.
+2. **Connect to GitHub**
+ - Click **Connect with a GitHub repository**
+ - You'll be prompted to authorize Zerops to access your GitHub account.
+ - Grant the necessary permissions for Zerops to manage webhooks and fetch your code.
+:::note
+Zerops requires full access to your repository in order to configure webhooks and pull the latest code changes. However, Zerops does not store your source code unless explicitly specified by you.
+:::
+3. **Select Repository and Trigger**
+ - Choose the GitHub repository you'd like to integrate with Zerops.
+ - Configure the trigger that will initiate a build:
+ - **New tag**: Builds are triggered whenever a new tag is created. This is the recommended option for production deployments.
+ - You can optionally add a regular expression (regex) to filter specific tags.
+ - **Push to branch**: Builds are triggered on every push to a specified branch, such as `main` or `develop`.
+4. **Finalize Setup**
+ - Review and confirm your settings to complete the integration process.
+ - Your GitHub repository is now connected, and builds will be triggered based on the configured triggers.
+
+---
+### Managing Your GitHub Integration
+To skip triggering a build for a specific commit, you can include `ci skip` or `skip ci` in your commit message (case insensitive). This tells Zerops to ignore that particular commit during the build process.
+:::note
+Although the webhook will still be delivered to GitHub, no action will be taken if `ci skip` is present in the commit message.
+:::
+---
+### Disconnecting Your Repository
+To disconnect your GitHub repository from Zerops:
+1. Navigate to the **Service Details** page for the relevant service
+1. Select **Build, Deploy, Run Pipeline Settings** from the menu.
+1. Click **Stop automatic build trigger**
+**This action will remove the GitHub webhook and delete the associated integration configuration, effectively halting automated builds from this repository.**
+
+### Authorizing Access to Organizations
+If you want to authorize Zerops to access a specific organization, you can do so by clicking on the **Grant** from [GitHub Applications Settings](https://github.com/settings/connections/applications/4408deded6c1fed7193c).
+---
+## GitHub Workflow Integration
+As an alternative to direct integration, you can use GitHub Actions to manage your deployments. This approach gives you more control over your deployment workflow and allows integration with other CI/CD processes.
+### GitHub Workflow using Zerops Actions
+1. **Create Workflow Configuration**
+ Create a new file at `.github/workflows/deploy.yaml` in your repository:
+ ```yaml
+ name: Deploy to Zerops
+
+ on:
+ push:
+ branches:
+ - main
+
+ jobs:
+ deploy:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v3
+
+ - name: Deploy with Zerops
+ uses: zeropsio/actions@main
+ with:
+ access-token: ${{ secrets.ZEROPS_TOKEN }}
+ service-id: your-service-id
+ ```
+2. **Generate Access Token**
+ - Navigate to [**Settings > Access Token Management**](https://app.zerops.io/settings/token-management) in your Zerops dashboard
+ - Generate a new access token with appropriate permissions
+ - Copy this token for use in GitHub secrets
+3. **Locate Service ID**
+ - Go to your service dashboard and click the three dots menu → **Copy Service ID**
+ - Alternatively, find it in your service URL: `https://app.zerops.io/service-stack//dashboard`
+4. **Configure GitHub Secrets**
+ - Go to your GitHub repository settings
+ - Navigate to **Settings** > **Secrets and variables** > **Actions** > **Repository secrets**
+ - Add a new secret named `ZEROPS_TOKEN` with your access token value
+:::note
+Keep your access token secure and never commit it directly to your repository. The token provides administrative access to your Zerops resources.
+:::
+For more information about GitHub Actions, refer to the [official GitHub Actions documentation](https://docs.github.com/en/actions).
+
+----------------------------------------
+
+# References > Gitlab Integration
+
+Discover how to seamlessly integrate your GitLab repository with Zerops for automated builds and deployments.
+This guide walks you through the step-by-step process to link your repository, configure triggers, and manage your integrations efficiently.
+---
+## Prerequisites
+Before starting the integration process, ensure your repository contains a valid `zerops.yaml` configuration file located in the root directory. This file is essential for defining the build, deploy, and run processes.
+For detailed information on how to create or modify this file, refer to the [Zerops YAML configuration](/zerops-yaml/specification) guide.
+---
+## Integration Steps
+Follow these steps to connect your Gitlab repository with Zerops:
+1. **Access Service Settings**
+ - Log into the [**Zerops GUI**](https://app.zerops.io/)
+ - Select the relevant service from your dashboard.
+ - In the left-hand menu, navigate to **Build, Deploy, Run Pipeline Settings**.
+2. **Connect to GitLab**
+ - Click **Connect with a GitLab repository**
+ - You'll be prompted to authorize Zerops to access your GitLab account.
+ - Grant the necessary permissions for Zerops to manage webhooks and fetch your code.
+:::note
+Zerops requires full access to configure webhooks and download your code. Your source code is not stored after the build process.
+:::
+3. **Select Repository and Trigger**
+ - Choose the repository to integrate
+ - Select a trigger method:
+ - **New tag**: Builds trigger on new tags
+ - Optionally add a regex to filter tags
+ - **Push to branch**: Builds trigger on pushes to a specific branch
+4. **Finalize Setup**
+ - Confirm your settings to complete the integration
+-->
+---
+## Managing Your GitLab Integration
+To skip triggering a build for a specific commit, you can include `ci skip` or `skip ci` in your commit message (case insensitive). This tells Zerops to ignore that particular commit during the build process.
+:::note
+Although the webhook will still be delivered to GitLab, no action will be taken if `ci skip` is present in the commit message.
+:::
+---
+## Disconnecting Your Repository
+To disconnect your GitLab repository from Zerops:
+1. Navigate to the **Service Details** page for the relevant service
+1. Select **Build, Deploy, Run Pipeline Settings** from the menu.
+1. Click **Stop automatic build trigger**
+**This action will remove the GitLab webhook and delete the associated integration configuration, effectively halting automated builds from this repository.**
+
+
+----------------------------------------
+
+# References > Import Yaml > Pre Processor
+
+The `yamlPreprocessor` option in your project & service import YAML allows you to generate random secret values, passwords, and public/private key pairs for your secret environment variables.
+---
+## How does it work?
+The `yamlPreprocessor=on` is required as the first line in your import YAML to enable the preprocessor.
+```yaml
+#yamlPreprocessor=on
+project:
+ name: project
+services:
+ - hostname: app
+ type: nodejs@latest
+ buildFromGit: https://github.com/example/app
+ enableSubdomainAccess: true
+ envSecrets:
+ # yamlPreprocessor feat: generates a random 64 char and stores it
+ SECRET_KEY: )>
+
+ - hostname: db
+ type: postgresql@16
+ mode: HA
+```
+After you've added the `yamlPreprocessor=on` line, the preprocessor will be enabled and you can now utilize the functions.
+---
+### How Preprocessing Works
+The YAML script processing happens in two sequential steps. During the first turn (preprocessing), the system scans for Zerops import functions and modifiers, evaluates them, and replaces function calls with their results. All this data is stored in memory.
+The second turn handles standard processing, where the system creates the imported project, instantiates all required services, and handles environment variables, including setting up any new ones as needed.
+### Syntax Reference
+
+ Sequence
+ Description
+
+ `
+ The identifier of the beginning of a function expression syntax.
+
+ `(`
+ The identifier of the beginning of the function parameters.
+
+ `)`
+ The identifier of the end of the function parameters.
+
+ `,`
+ A function parameters delimiter.
+
+ `
+ Identifier of the beginning of a string expression (without @).
+
+ `>`
+ The identifier of the end of a string expression or a function expression syntax.
+
+ `|`
+ The separator between a string or a function expression content and a modifier name.
+
+ `\`
+ Escaping character.
+
+ `\<>|`
+ Characters that need to be escaped to print them out.
+
+:::note
+All functions in the preprocessor return values as strings, regardless of the operation performed. This includes numeric operations, random generation, and variable manipulation.
+:::
+---
+## Parameter Data Types
+Functions generally support 2 types of parameters.
+### String expressions
+- Value is enclosed in `` characters.
+- Spaces between `` are NOT trimmed.
+- When the value is passed as a function parameter, it's always a string.
+```yaml
+# String expression:
+SECRET_KEY: )>
+# String expressions: and
+RANDOM_RANGE: , )>
+# String expressions: , ,
+PICK_VALUE: , , )>
+```
+### Variable reference names
+Variables are used to store and reuse values across your configuration. They can be created using functions like `setVar` and retrieved using `getVar`.
+- Variable references are NOT enclosed in `` when used with `getVar`
+- Variable names are case-sensitive
+- Spaces before and after the reference name are trimmed
+- Returns an error if the variable doesn't exist
+```yaml
+# Stores a value in myPassword variable
+PASSWORD: , )>)>
+# Retrieves the stored value (myPassword)
+HASHED_PASSWORD:
+# Reuses the stored value (myPassword)
+SAME_PASSWORD_AGAIN:
+```
+:::tip Internal processing of function parameters
+All parameters are handled as strings internally. For functions that expect numbers (like `generateRandomString`), the string values are automatically converted to numbers during processing.
+:::
+---
+## Nested Expressions
+The preprocessor supports nested function and string expressions, allowing you to:
+- Combine multiple functions
+- Use function outputs as inputs for other functions
+- Nest string expressions within other strings
+- Create complex, multi-level expressions
+### Examples of Nesting with Environment Variables
+```yaml
+#yamlPreprocessor=on
+services:
+- hostname: app
+ type: nodejs@20
+ envSecrets:
+ NESTED_STRINGS: content>
+ NESTED_FUNCTIONS: , )>)>
+ EVEN_MORE_NESTING: , , )>)>)>
+```
+### Outputs of Nesting with Environment Variables
+```yaml
+#yamlPreprocessor=on
+services:
+- hostname: app
+ type: nodejs@20
+ envSecrets:
+ NESTED_STRINGS: "Base and Nested content"
+ NESTED_FUNCTIONS: "58580f0ad377a8e4c0dccc1622e2d3812b90"
+ EVEN_MORE_NESTING: "73bcd2b647293dd04674cdecc"
+```
+### Escaping to Print Reserved Characters
+Reserved characters `\<>|` have to be escaped using the `\` backslash to print them out. It's mandatory to escape the `\` character itself.
+:::caution
+The YAML processing happens in two sequential phases:
+1. **Preprocessing Phase**: Evaluates functions, modifiers, and replaces them with results
+2. **YAML Processing Phase**: Creates project, services, and handles environment variables
+Each phase processes escape characters, so backslashes need to be escaped twice:
+- If you want to output a single backslash `\`, you need to use four backslashes `\\\\`
+- Example:
+Input: `FILE_PATH: value\\\\with\\\\backslashes`
+Output: `FILE_PATH: value\with\backslashes`
+It means that if `DIR: ` is used, the final value stored in the environment variable will be just `\`. The same is true for any value with backslashes, like `SERVER: True\\\\False`, where the stored result will be `True\False`.
+:::
+### Examples of Correct Function Expressions
+```yaml
+# Function will receive one parameter as the string constant value of: 30
+)>
+# Function will receive two parameters as the string constant values of: 200 and 1000
+, )>
+# It's possible to nest functions one into the other.
+, )>)>
+# Using commas inside a string constant passed as the parameter is possible.
+# The passed value is stored as internal variable under the name: commentValue
+, )>
+# Function will receive one parameter as the internal variable reference: commentValue
+# Its value is returned as a string if such an internal variable exists. If not, an error returns.
+# Examples of function expressions with escaped characters:
+\ # Output:
+\)\> # Output: )>
+\, \)\> # Output: , )>
+\\, \)\> # Output: , )>
+\, )\> # Output:
+```
+---
+:::tip What happens with environment variable references
+Environment variable reference might need to be used as a part of string expressions. From the parsing point of view on the pre-processing level, they have not been recognized as something special but just a regular string, and they will be transparently passed without any modification. The second standard parsing turn only evaluates them.
+:::
+```yaml
+# The part ` {ITEM_VALUE` is taken as a regular text when storing a string value as an internal variable.
+, )>
+# The returned value will be exactly the same when retrieving the previously stored value.
+)>
+# The returned value will be: By the way, this {ITEM_VALUE} is text passed over as a value.
+```
+---
+## List of import functions
+:::caution Important reminder
+If you don't use the `yamlPreprocessor=on` line at the beginning of your import YAML script, the preprocessor will not be enabled and the functions will not work.
+The `type: nodejs@latest` is just an example. The functions are available for all runtime types.
+:::
+---
+### generateRandomString (length)
+This function generates a random string of specified length using alphanumeric characters and some special characters (`_`, `-`, `.`). It's useful for creating random passwords, API keys, or any other secret values that needs to be unique and unpredictable.
+
+ Field
+ Details
+
+ Syntax:
+ `)>`
+
+ Limitation:
+ Length of the string should be an *integer* between `1` and `1024` characters. eg. ``, ``, ``.
+
+ Output:
+ hR5hS79H4p
+
+#### Usage in import YAML
+```yaml
+#yamlPreprocessor=on
+services:
+- hostname: app
+ type: nodejs@20
+ envSecrets:
+ RANDOM_STRING: )>
+```
+#### Output of import YAML
+```yaml
+RANDOM_STRING: 58580f0ad377a8e4c0dccc1622e2d3812b90
+```
+---
+### generateRandomBytes (length)
+This function generates requested amount of cryptographically random bytes. It is useful for creating random passwords, API keys, or any other secret values that needs to be unique and unpredictable.
+
+ Field
+ Details
+
+ Syntax:
+ `)>`
+
+ Limitation:
+ Length of the string should be an *integer* between `1` and `1024` characters. eg. ``, ``, ``.
+
+ Output:
+ hR5hS79H4p
+
+#### Usage in import YAML
+```yaml
+#yamlPreprocessor=on
+services:
+- hostname: app
+ type: nodejs@20
+ envSecrets:
+ RANDOM_STRING: )>
+```
+#### Output of import YAML
+```yaml
+RANDOM_STRING: 58580f0ad377a8e4c0dccc1622e2d3812b90
+```
+---
+### generateRandomInt (min, max)
+This function generates a random integer within a specified range (inclusive). It's particularly useful when you need random numeric values, like ports, timeouts, or any other configuration that requires random numbers within specific bounds.
+
+ Field
+ Details
+
+ Syntax:
+ `, )>`
+
+ Minimum:
+ Required minimum (inclusive) as a signed integer (from -4,611,686,018,427,387,903 to 4,611,686,018,427,387,903).
+
+ Maximum:
+ Required maximum (inclusive) as a signed integer (from -4,611,686,018,427,387,903 to 4,611,686,018,427,387,903).
+
+ Output:
+ 823
+
+#### Usage in import YAML
+```yaml
+#yamlPreprocessor=on
+services:
+- hostname: app
+ type: nodejs@20
+ envSecrets:
+ RANDOM_INT: , )>
+```
+#### Output of import YAML
+```yaml
+RANDOM_INT: 823
+```
+---
+### pickRandom (...param)
+
+ Field
+ Details
+
+ Syntax:
+ `, , , , , )>`
+
+ Parameters:
+ The required parameters from which the selection will be made. eg. ``, ``, ``, etc.
+
+ Output:
+ 1024
+
+This function randomly selects one value from a list of provided options. It's helpful when you want to randomly assign values from a predefined set, such as screen resolutions, configuration options, or any other scenario where you need random selection from specific choices.
+#### Usage in import YAML
+```yaml
+#yamlPreprocessor=on
+services:
+- hostname: app
+ type: nodejs@20
+ envSecrets:
+ PICK_RANDOM: , , , , , )>
+```
+#### Output of import YAML
+```yaml
+PICK_RANDOM: 1024
+```
+---
+### setVar (name, content)
+This function stores a value in memory for later use and returns the stored value. It's particularly useful when you need to reuse the same generated value multiple times in your configuration, ensuring consistency across different environment variables.
+
+ Field
+ Details
+
+ Syntax:
+ `, )>)>`
+
+ Variable:
+ The required parameter of the internal variable name under which the provided content can be retrieved later using getVar function. The chosen name is case-sensitive. eg. ``, ``, etc
+
+ Content:
+ Any text you want to be stored, including composition using functions. Already existing variable with the same name is overwritten.
+
+ Output:
+ N4KdtM41WskS74wx
+
+#### Usage in import YAML
+```yaml
+#yamlPreprocessor=on
+services:
+- hostname: app
+ type: nodejs@20
+ envSecrets:
+ SET_VAR: , )>)>
+```
+#### Output of import YAML
+```yaml
+SET_VAR: N4KdtM41WskS74wx
+```
+---
+### getVar (name)
+This function retrieves a previously stored value from memory. It works in conjunction with setVar and other storage functions to access values that were generated or stored earlier in the configuration process. eg. `plainPassword`
+
+ Field
+ Details
+
+ Syntax:
+ ``
+
+ Variable:
+ The required parameter of the internal variable name that is case-sensitive. The parameter is used as a reference, so it MUST NOT be enclosed in < and >. eg. `(plainPassword)`, `(varName)`, etc
+
+ Output:
+ N4KdtM41WskS74wx
+
+#### Usage in import YAML
+```yaml
+#yamlPreprocessor=on
+services:
+- hostname: app
+ type: nodejs@20
+ envSecrets:
+ GET_VAR:
+```
+#### Output of import YAML
+```yaml
+GET_VAR: N4KdtM41WskS74wx
+```
+---
+### generateRandomStringVar (name, length)
+This function combines the functionality of `generateRandomString` and `setVar`. It generates a random string and automatically stores it under a specified variable name for later use.
+The output contains only a random combination of alphanumeric characters (`a-zA-Z0-9`) and select special characters (`_`, `-`, `.`).
+
+ Field
+ Details
+
+ Syntax:
+ `, )>`
+
+ Variable:
+ The required parameter of the internal variable name under which the provided content can be retrieved later using getVar function. The chosen name is case-sensitive. eg. ``, ``, etc
+
+ Limitation:
+ Required length of the string to be generated in characters (maximum allowed value is 1024).
+
+ Output:
+ hR5hS79H4p
+
+#### Usage in import YAML
+```yaml
+#yamlPreprocessor=on
+services:
+- hostname: app
+ type: nodejs@20
+ envSecrets:
+ GENERATE_RANDOM_STRING_VAR: , )>
+```
+#### Output of import YAML
+```yaml
+GENERATE_RANDOM_STRING_VAR: hR5hS79H4p
+```
+---
+### generateJWT (tokenSecret, jsonPayload)
+This function generates a JWT (JSON Web Token) signed by HS256 algorithm using provided secret and payload. The payload MUST be a valid JSON value. Default values for `iss` and `iat` are set to `zerops` and current timestamp respectively.
+
+ Field
+ Details
+
+ Syntax:
+ `, )>`
+
+ Token Secret:
+ The required secret (`string`) used to sign your JWT.
+
+ JSON Payload:
+ The required payload part of the JWT (`string`) in JSON format.
+
+ Output:
+ eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYWRtaW4iLCJpYXQiOjE3Mjkw
+ Njk4NTcsImlzcyI6Inplcm9wcyJ9.xPrqHDtGhK5c7WMJliguwBeKI29qzAoD7KXrtACb
+ jio
+
+#### Usage in import YAML
+```yaml
+#yamlPreprocessor=on
+services:
+- hostname: app
+ type: nodejs@20
+ envSecrets:
+ # Using a fixed secret string
+ JWT_FIXED: , )>
+
+ # Using an empty payload
+ JWT_EMPTY: , )>
+
+ # Generate and store a random secret, then use it
+ JWT_RANDOM: , )>, )>
+
+ # Use a previously stored secret
+ JWT_STORED: , )>
+```
+#### Output of import YAML
+```yaml
+JWT_FIXED: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYWRtaW4iLCJleHAiOjE3OTg3NjE2MDAsImlhdCI6MTcyOTA2OTYzMiwiaXNzIjoiemVyb3BzIn0.xPrqHDtGhK5c7WMJliguwBeKI29qzAoD7KXrtACbjio
+JWT_EMPTY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MjkwNjk4NTcsImlzcyI6Inplcm9wcyJ9.xPrqHDtGhK5c7WMJliguwBeKI29qzAoD7KXrtACbjio
+JWT_RANDOM: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYWRtaW4iLCJleHAiOjE3OTg3NjE2MDAsImlhdCI6MTcyOTA2OTYzMiwiaXNzIjoiemVyb3BzIn0.ksbck_HQv44YXbqJk6lDrGFYTq3nmLydFIe0Xlejk5Q
+JWT_STORED: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYWRtaW4iLCJleHAiOjE3OTg3NjE2MDAsImlhdCI6MTcyOTA2OTYzMiwiaXNzIjoiemVyb3BzIn0.O0RaXzGFwj2t8P2kc4nU4PfuI43-dAuAl2d0T1uUlEE
+```
+---
+### getDateTime (format, [timezone])
+This function returns the current date and time formatted according to your specifications. It's useful for timestamps, logging, and any scenario where you need the current time in a specific format and timezone.
+Returns the current date and time in a specified mask pattern and a chosen timezone.
+
+ Field
+ Details
+
+ Syntax:
+ `, )>`
+
+ Mask:
+ The required parameter of the chosen timezone.
+ eg. ``
+
+ Timezone:
+
+ The optional parameter of the chosen timezone. It's possible to select from three different formats: Abbreviation, Location, and POSIX. If not specified, the GMT timezone is set by default.
+ You can see the complete listing of all possible values. POSIX format uses the opposite sign. Times to the west are positive, to the east negative.
+ For Central European Time, you can use `CET`, `Europe/Prague`, `Etc/GMT-2` (summer), `Etc/GMT-1` (winter). Abbreviated and location formats return values with the currently valid DST.
+ eg. ``, ``, ``
+
+ Output:
+ 11.12.2022 18:06:13
+
+#### Usage in import YAML
+```yaml
+#yamlPreprocessor=on
+services:
+- hostname: app
+ type: nodejs@20
+ envSecrets:
+ GET_DATETIME: , )>
+```
+#### Output of import YAML
+```yaml
+GET_DATETIME: 11.12.2022 18:06:13
+```
+#### Masking
+
+ When using the `getDateTime` function, you can customize the output format using various masks. Here's a comprehensive list of available format patterns:
+ #### Year
+ - `YYYY` - Full year (e.g., 2024)
+ - `YY` - Two-digit year (e.g., 24)
+ #### Month
+ - `MMMM` - Full month name (e.g., January)
+ - `MMM` - Short month name (e.g., Jan)
+ - `MM` - Two-digit month (e.g., 01)
+ - `M` - Single-digit month (e.g., 1)
+ #### Day
+ - `DDDD` - Day of year with leading zeros (e.g., 001, 002, ..., 365)
+ - `DD` - Day of month with leading zeros (e.g., 01, 02, ..., 31)
+ - `D` - Day of month without leading zeros (e.g., 1, 2, ..., 31)
+ - `dddd` - Full weekday name (e.g., Monday)
+ - `ddd` - Short weekday name (e.g., Mon)
+ #### Time
+ - `HH` - 24-hour format with leading zeros (e.g., 00, 01, ..., 23)
+ - `hh` - 12-hour format with leading zeros (e.g., 01, 02, ..., 12)
+ - `h` - 12-hour format without leading zeros (e.g., 1, 2, ..., 12)
+ - `mm` - Minutes with leading zeros (e.g., 00, 01, ..., 59)
+ - `m` - Minutes without leading zeros (e.g., 0, 1, ..., 59)
+ - `ss` - Seconds with leading zeros (e.g., 00, 01, ..., 59)
+ - `s` - Seconds without leading zeros (e.g., 0, 1, ..., 59)
+ - `S` - Microseconds (e.g., 000000...999999)
+ #### Period
+ - `A` - Uppercase meridiem (AM, PM)
+ - `a` - Lowercase meridiem (am, pm)
+ #### Timezone
+ - `ZZZ` - Timezone abbreviation (e.g., UTC, CET)
+ - `zz` - Timezone offset with colon (e.g., +00:00, +01:00)
+ - `Z` - Timezone offset without colon (e.g., +0000, +0100)
+ #### Usage of different masks
+ ```yaml
+ #yamlPreprocessor=on
+ services:
+ - hostname: app
+ type: nodejs@20
+ envSecrets:
+ TIMESTAMP: , )>
+ FRIENDLY_DATE: , )>
+ ```
+
+---
+:::tip Example Usage for Environment Variables
+- For Multiline Generation use:
+```yaml
+APP_PUBLIC_KEY: |
+
+```
+- For Single Value Generation use:
+```yaml
+APP_PUBLIC_KEY_SSH:
+```
+:::
+---
+### generateED25519Key (name)
+Generates public and private ED25519 key pairs (including SSH) and stores them for later use as internal variables with names using the base name and variants.
+
+ Field
+ Details
+
+ Syntax:
+ `)>`
+
+ Variants:
+ The base name parameter stores all generated key versions as internal variables, combined with the Available Variants.
+
+#### Available Variants
+
+ Variant
+ Description
+ Retrieving the value
+
+ Public
+ Public key version. This value is also returned by the called function.
+ ``
+
+ PublicSsh
+ SSH formatted public key version. For use as the authorized key file.
+ ``
+
+ Private
+ Private key version in the standard format. Not usable for OpenSSH.
+ ``
+
+ PrivateSsh
+ Private key version in the OpenSSH format.
+ ``
+
+#### Usage in import YAML
+:::caution
+ These Generated keys are formatted as multiline strings. That means using the `|` syntax is necessary in import YAML.
+:::
+```yaml
+#yamlPreprocessor=on
+services:
+- hostname: app
+ type: nodejs@20
+ envSecrets:
+ GENERATED_PUBLIC_KEY: |
+ )>
+ APP_PUBLIC_KEY: |
+
+ APP_PUBLIC_KEY_SSH:
+ APP_PRIVATE_KEY: |
+
+ APP_PRIVATE_KEY_SSH: |
+
+```
+#### Output of import YAML
+:::info
+ You can clearly see the multiline strings and the `|` syntax in Output.
+:::
+
+ - Generated as a multiline value
+ - The same value as in APP_PUBLIC_KEY.
+ ```yaml
+ GENERATED_PUBLIC_KEY: |
+ -----BEGIN PUBLIC KEY-----
+ MCowBQYDK2VwAyEAu0/gEIpNUbVdqA20lVl+ZD+5/zzfVK4exrgGLxgQQRU=
+ -----END PUBLIC KEY-----
+ ```
+
+ - Generated as a multiline value.
+ - The same value as in GENERATED_PUBLIC_KEY.
+ ```yaml
+ APP_PUBLIC_KEY: |
+ -----BEGIN PUBLIC KEY-----
+ MCowBQYDK2VwAyEAu0/gEIpNUbVdqA20lVl+ZD+5/zzfVK4exrgGLxgQQRU=
+ -----END PUBLIC KEY-----
+ ```
+
+ - Generated as a single value
+ ```yaml
+ APP_PUBLIC_KEY_SSH: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILtP4BCKTVG1XagNtJVZfmQ/uf8831SuHsa4Bi8YEEEV
+ ```
+
+ - Generated as a multiline value
+ ```yaml
+ APP_PRIVATE_KEY: |
+ -----BEGIN PRIVATE KEY-----
+ MC4CAQAwBQYDK2VwBCIEIFzW6uPLlMnse2Hqg4hlyTwtlWaPKHjyoaaBi/FfVxBQ
+ -----END PRIVATE KEY-----
+ ```
+
+ - Generated as a multiline value
+ ```yaml
+ APP_PRIVATE_KEY_SSH: |
+ -----BEGIN OPENSSH PRIVATE KEY-----
+ b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtz
+ c2gtZWQyNTUxOQAAACC7T+AQik1RtV2oDbSVWX5kP7n/PN9Urh7GuAYvGBBBFQAA
+ AIiaywRCmssEQgAAAAtzc2gtZWQyNTUxOQAAACC7T+AQik1RtV2oDbSVWX5kP7n/
+ PN9Urh7GuAYvGBBBFQAAAEBc1urjy5TJ7Hth6oOIZck8LZVmjyh48qGmgYvxX1cQ
+ ULtP4BCKTVG1XagNtJVZfmQ/uf8831SuHsa4Bi8YEEEVAAAAAAECAwQF
+ -----END OPENSSH PRIVATE KEY-----
+ ```
+
+---
+### generateRSA2048Key (name)
+This Generates public and private RSA 2048bit key pairs (including SSH) and stores them for later use as internal variables with names using the base name and variants.
+
+ Field
+ Details
+
+ Syntax:
+ `)>`
+
+ Variants:
+ The base name parameter stores all generated key versions as internal variables, combined with the Available Variants.
+
+#### Available Variants
+
+ Variant
+ Description
+ How to use with: `)>`
+
+ Public
+ Public key version. This value is also returned by the called function.
+ ``
+
+ PublicSsh
+ SSH formatted public key version. For use as the authorized key file.
+ ``
+
+ Private
+ Private key version in the standard format.
+ ``
+
+#### Usage in import YAML
+:::caution
+ These Generated keys are formatted as multiline strings. That means using the `|` syntax is necessary in import YAML.
+:::
+```yaml
+#yamlPreprocessor=on
+services:
+- hostname: app
+ type: nodejs@16
+ minContainers: 1
+ envSecrets:
+ GENERATED_PUBLIC_KEY: |
+ )>
+ APP_PUBLIC_KEY: |
+
+ APP_PUBLIC_KEY_SSH:
+ APP_PRIVATE_KEY: |
+
+```
+#### Output of import YAML
+:::info
+ You can clearly see the multiline strings and the `|` syntax in Output.
+:::
+
+ - Generated as a multiline value
+ - The same value as in APP_PUBLIC_KEY.
+ ```yaml
+ GENERATED_PUBLIC_KEY: |
+ -----BEGIN PUBLIC KEY-----
+ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyWMKx+vdEb/Ww19trV9D
+ og7x6d4MCL4u576fVdDjBFhXjXYrK0Y0movvYNe72qtpggW8FnAiKbFNWMLr7mV1
+ 2u0JEdPzaqSOX/XKRKWq2q7wyZjGU0uVLJ3Rd2Y4yFyjg6zbvA0Hh5HRgbn7xoRM
+ UbT3mt1lBP+DeHIi9exTvtiNfpO0Z1bidmLLvzLnakg1ei8YWnEAFJi83/MuRMhI
+ WOA32h14WVbvg4SA7++STHF3uHL+kHJ7P/KeqACDBPbgcc9Sz7WsSTAO6Pdry3sr
+ KCP60AMaT2PewB51AtuvFR8nP05WskMgd887KHXZjk9NhDU5E06vz4nf7a3t+it0
+ UwIDAQAB
+ -----END PUBLIC KEY-----
+ ```
+
+ - Generated as a multiline value.
+ - The same value as in GENERATED_PUBLIC_KEY.
+ ```yaml
+ APP_PUBLIC_KEY: |
+ -----BEGIN PUBLIC KEY-----
+ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyWMKx+vdEb/Ww19trV9D
+ og7x6d4MCL4u576fVdDjBFhXjXYrK0Y0movvYNe72qtpggW8FnAiKbFNWMLr7mV1
+ 2u0JEdPzaqSOX/XKRKWq2q7wyZjGU0uVLJ3Rd2Y4yFyjg6zbvA0Hh5HRgbn7xoRM
+ UbT3mt1lBP+DeHIi9exTvtiNfpO0Z1bidmLLvzLnakg1ei8YWnEAFJi83/MuRMhI
+ WOA32h14WVbvg4SA7++STHF3uHL+kHJ7P/KeqACDBPbgcc9Sz7WsSTAO6Pdry3sr
+ KCP60AMaT2PewB51AtuvFR8nP05WskMgd887KHXZjk9NhDU5E06vz4nf7a3t+it0
+ UwIDAQAB
+ -----END PUBLIC KEY-----
+ ```
+
+ - Generated as a single value
+ ```yaml
+ APP_PUBLIC_KEY_SSH: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJYwrH690Rv9bDX22tX0OiDvHp3gwIvi7nvp9V0OMEWFeNdisrRjSai+9g17vaq2mCBbwWcCIpsU1YwuvuZXXa7QkR0/NqpI5f9cpEpararvDJmMZTS5UsndF3ZjjIXKODrNu8DQeHkdGBufvGhExRtPea3WUE/4N4ciL17FO+2I1+k7RnVuJ2Ysu/MudqSDV6LxhacQAUmLzf8y5EyEhY4DfaHXhZVu+DhIDv75JMcXe4cv6Qcns/8p6oAIME9uBxz1LPtaxJMA7o92vLeysoI/rQAxpPY97AHnUC268VHyc/TlayQyB3zzsoddmOT02ENTkTTq/Pid/tre36K3RT
+ ```
+
+ - Generated as a multiline value
+ ```yaml
+ APP_PRIVATE_KEY: |
+ -----BEGIN PRIVATE KEY-----
+ MIIEvwIBADANBgkqhkiG9w0BAQEFAASCCS4wggkqAgEAAoICAQDWRgQntuMGJfME
+ wj9wLrBqNyUd13k1nRuzHZ3x5VJodRrPjX19M9gFXuY95zTJti6VOG+pZftzuTkf
+ +MlW9NwFEe/g0OomY6UwfKfPj4/ib3MPiASg2o4Ixqu0mv3IrLOsGmU25J38gAVQ
+ I3oohW4+B7Vp+2+RnLQCx1FsweWpa8wR0ffQwl0LsWSEWyutfSxi+5pbYwWORBOK
+ yESmGFqGBhMfl0KutBqNAGLt9IYS61bYIqnvfzHqE1uIH3/+ViNzMAr56xt8Lr5a
+ +Y84Mmer1h1wnh6OHnOE6y2sw+876RO8OjMTnHq6v1HDnKHQyCNHxDvpqihy7hly
+ RtCpC9fuCJC94lB0Gf65xgJC55Jx7gGRSbdLUhN2XZdQeAGPtdidz5KqC8S02fhi
+ DKe0C78hpUGD8MZU4GqvqlyiHoouBhKugkba7F0NeSOLVC9GPLdKNjt5AyCi72pQ
+ z8vXaBk8TIb7F+WeQ3NtLw8sgZj0XjXRtx/S6SSoTIOkIKB6hKsPV0k+Z7VaVJ+F
+ pXPsr2CbwcH0iyCJC6A6hLQWnDnts26PLcFck7hE6UjE4BsBhXQhcyMTe5Yai3y4
+ V5NWoHinkLO9NX2N2hBcpQWSSCbr0wSg33xAHROzcG1w5/n1fq46723CbWW3Gcsf
+ naL/hPIt3MSsiz28RqjHlB7qXiWEBQIDAQABAoICAQCemAYdSv0voMkFfaysoLIM
+ e7JqKwDY0OcepM4xq1VaYUqt0oDOOaArIXly2f01SzWhVrs2+3eoyLBiXKbRSLzM
+ t+D/WkHklh4/DBS8yPprU6grF7atQ/aawkl2jL1IWaNGv+aoQYA50pucHBYfhdr5
+ 6IS649JJSV3nLJW01LLiuhm6Gtm8Vw+9RtgqKrziVOKUhLtT5q/HA9YfA2nkMeRW
+ jIp8+Fzvp/h64o1WqITP3gZSRR3YWSGdqiQ2VXJL0n+8kxOctQqL2KEl/s6lfpFD
+ G2CA6VeeQyWnfNY6qG8avcHQsJb7bfdc35xqFzWhrXCHftQFd98madrFvWpVpKF1
+ fjSrQAWHShgyCBQuBteWhYWFlWMkYX3tab6MUS8vUR3LQuv3NGEWvQMgxA2eBzq2
+ iPhTnCJ0EQIMgsBg+O6qW2JuJMdTwB2U+WlLJiJnSBQ5aWwDKjIIzoH17lYmDOvz
+ ij0ZbzHUx01wU5w58z8mi//PppQheaxIT0jZkoGXOmbMsCTv/UcxlqnVHJ1ysA8d
+ QgK+3L+7dyjl3k5IQNt9f49X/C5D0oPYGuzPuP37HzEZYZbYtz5CoICUf6nNFGBl
+ aetSTGRs6ePVqHlo1cZQdk5fIQwX7yelehEb/Cpjk0mv5sk8cJcYviAnkQyUBjOE
+ wujWkG9XTisPMl3c6pAkJQKCAQEA/5TAJKP/uGofwDxoFXg4zjyRsqWeWpIvny5E
+ K9avHPdqFcU1DGAVwUfw6z5Grx8QzWZbnPFI5KMvdVoLpDMubw1XWQCY5X7AD3Iu
+ C9C0cbE+vW8d0AKGEt2q4ERTMZ5dqJiAN/tGJ8wH9mQxOhoim1MPAb0PZJg6WHda
+ 4uN/wnZCuhEVnU86vbKhMJUZYotxEiV3qokZzV7zwsYOdCDw5iipm6McrRVrfdyE
+ u4yIyorq9RB3JChhkgkKSLaFHpuG/YOSM0DQ3vizC57w3LpJ+i+d2FR7Z8fYPSSW
+ BF/hUBUNZG4kk4wxH9dYk27ohBSI2u44n50zrQGST36vxETodwKCAQEA1p/uia4V
+ cHilRd454sQMevtbZO2Zak/g7MzxIUIPI363CKCfjIu/t3iyJ5xohI6OVdqdvE0/
+ hEiVJkv5YNXNLvQFnF7y7z5/HKjkEe72TrZuBwWSoQx69UP9QymzMuV+41f8aVpc
+ c2Xe7XWXK+X56ZGRFND5sB8hd65G9D818Qi90kQyYlb43l8CyiylqYIYh8ldIqHU
+ jAzNGk65kpW6CkL9v/qloKrpAWxErAinB40MHBvgZULj7LijCt2orHOPjOjC1f8n
+ BDf9eBKT+gTLXifIggGBh0iBxen9d2S7/Wz4ySLX47ijDgH0aQO8d668z+c9As0t
+ lz1HmEqLtyLSYwKCAQBH3Y/ZvbOeK1kaOOIbh16Rvz5IuYE5fnmdjOjmWsuKnZda
+ 38T24d28J3p661v8ygNzfiCslLwmbixeFx/G4A1idKHnCN/1SBrBPR3tfJYAkhJO
+ OfxsDQmeLG5r+UpbXWiAi8Eh/KnRbvGeOrYM3GR2wHgryPmXE6b0UTthKQ83owFI
+ SJ2HSkv+I0hn3MTyjLsSmy526W4z7UslrYNK7ChQz4ZBmS/rC2baUTOReQbNzRoc
+ JrEZnbEx2xDlOU1dOeZPSrvFZahVyiCuV9bqegdrLhB4T+kTWYJYTv1P5ZX5arIF
+ V2M5ieYWSftCGaGP4iZJSUrqts1dDGATsk/CJI4pAoIBAQCnIfYk2x6w7hJt/ScA
+ swCxCGpchzYv9rJGVTX1WzbkwjmQi1yTmwQZwPCjLgaqK0UmEE9DIriyr78OCp3R
+ Tc0xoi94XOw7aGSeEdtBJ+BA3YmDCFDt/wUFWAOyOJfmq5aLPao+9HIIHy1hp2+o
+ bLeXrpbXKgE2qJdsVpfEfjDoWZFQW3EM6YN1z3EhtXDwNnIZ07ImVPVqdlGGCgYy
+ 40vzz8VAqdQu8MjwJbq4aSiBFdJ3VTICSPurDQFSZdiDKp5/8YZAFSjx/RPyXC1F
+ xlQEJ2DZ9IhErC76y0NppVVLfX+jSfHq0I6RSu5klNdAMB+ymvUE6Hh3TO4i5vI0
+ E/bXAoIBAQCEXLJhLE/imGPl1Fbqh4lnr2iRMzN3cPxb6DHiKoFXhY18/WWneXEI
+ 8DwK0D+n8spX67YyelFqBjWi4JrG2KhZmPSBF7p7lPypjPdbjkCnSJ0Qjrvdo5ns
+ 46CtmUH8d54SAdgRkXypc1y/3mOnVAhnSRUYm5mtDOtfG0dXdsfS/uDXVRZkTv7S
+ xjdaHi3Ap+oxTMS+zWfKvYAx5g0gTdvb+FdsN89T9XRRx+7N5TmG9D+sUAqNEWkH
+ 7SG6By8x+JqhURZOF9T9n2TX7N9g/+c0y9J10Ol5r0rDFM4SSTX9A5NmqfNF6LO7
+ A0bX/JM8kHjLlJNrtioxcT+dX4lL6/zT
+ -----END PRIVATE KEY-----
+ ```
+
+---
+### generateRSA4096Key (name)
+This Function Generates public and private RSA 4096bit key pairs (including SSH) and stores them for later use as internal variables with names using the base name and variants.
+
+ Field
+ Details
+
+ Syntax:
+ `)>`
+
+ Variants:
+ The base name parameter stores all generated key versions as internal variables, combined with the Available Variants.
+
+#### Available Variants
+
+ Variant
+ Description
+ How to use with: `)>`
+
+ Public
+ Public key version. This value is also returned by the called function.
+ ``
+
+ PublicSsh
+ SSH formatted public key version. For use as the authorized key file.
+ ``
+
+ Private
+ Private key version in the standard format.
+ ``
+
+#### Usage in import YAML
+:::caution
+ These Generated keys are formatted as multiline strings. That means using the `|` syntax is necessary in import YAML.
+:::
+```yaml
+#yamlPreprocessor=on
+services:
+- hostname: app
+ type: nodejs@16
+ envSecrets:
+ GENERATED_PUBLIC_KEY: |
+ )>
+ APP_PUBLIC_KEY: |
+
+ APP_PUBLIC_KEY_SSH:
+ APP_PRIVATE_KEY: |
+
+```
+#### Output of import YAML
+:::info
+ You can clearly see the multiline strings and the `|` syntax in Output.
+:::
+
+ - Generated as a multiline value
+ - The same value as in APP_PUBLIC_KEY.
+ ```yaml
+ GENERATED_PUBLIC_KEY: |
+ -----BEGIN PUBLIC KEY-----
+ MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA1kYEJ7bjBiXzBMI/cC6w
+ ajclHdd5NZ0bsx2d8eVSaHUaz419fTPYBV7mPec0ybYulThvqWX7c7k5H/jJVvTc
+ BRHv4NDqJmOlMHynz4+P4m9zD4gEoNqOCMartJr9yKyzrBplNuSd/IAFUCN6KIVu
+ Pge1aftvkZy0AsdRbMHlqWvMEdH30MJdC7FkhFsrrX0sYvuaW2MFjkQTishEphha
+ hgYTH5dCrrQajQBi7fSGEutW2CKp738x6hNbiB9//lYjczAK+esbfC6+WvmPODJn
+ q9YdcJ4ejh5zhOstrMPvO+kTvDozE5x6ur9Rw5yh0MgjR8Q76aoocu4ZckbQqQvX
+ 7giQveJQdBn+ucYCQueSce4BkUm3S1ITdl2XUHgBj7XYnc+SqgvEtNn4YgyntAu/
+ IaVBg/DGVOBqr6pcoh6KLgYSroJG2uxdDXkji1QvRjy3SjY7eQMgou9qUM/L12gZ
+ PEyG+xflnkNzbS8PLIGY9F410bcf0ukkqEyDpCCgeoSrD1dJPme1WlSfhaVz7K9g
+ m8HB9IsgiQugOoS0Fpw57bNujy3BXJO4ROlIxOAbAYV0IXMjE3uWGot8uFeTVqB4
+ p5CzvTV9jdoQXKUFkkgm69MEoN98QB0Ts3BtcOf59X6uOu9twm1ltxnLH52i/4Ty
+ LdzErIs9vEaox5Qe6l4lhAUCAwEAAQ==
+ -----END PUBLIC KEY-----
+ ```
+
+ - Generated as a multiline value.
+ - The same value as in GENERATED_PUBLIC_KEY.
+ ```yaml
+ APP_PUBLIC_KEY: |
+ -----BEGIN PUBLIC KEY-----
+ MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA1kYEJ7bjBiXzBMI/cC6w
+ ajclHdd5NZ0bsx2d8eVSaHUaz419fTPYBV7mPec0ybYulThvqWX7c7k5H/jJVvTc
+ BRHv4NDqJmOlMHynz4+P4m9zD4gEoNqOCMartJr9yKyzrBplNuSd/IAFUCN6KIVu
+ Pge1aftvkZy0AsdRbMHlqWvMEdH30MJdC7FkhFsrrX0sYvuaW2MFjkQTishEphha
+ hgYTH5dCrrQajQBi7fSGEutW2CKp738x6hNbiB9//lYjczAK+esbfC6+WvmPODJn
+ q9YdcJ4ejh5zhOstrMPvO+kTvDozE5x6ur9Rw5yh0MgjR8Q76aoocu4ZckbQqQvX
+ 7giQveJQdBn+ucYCQueSce4BkUm3S1ITdl2XUHgBj7XYnc+SqgvEtNn4YgyntAu/
+ IaVBg/DGVOBqr6pcoh6KLgYSroJG2uxdDXkji1QvRjy3SjY7eQMgou9qUM/L12gZ
+ PEyG+xflnkNzbS8PLIGY9F410bcf0ukkqEyDpCCgeoSrD1dJPme1WlSfhaVz7K9g
+ m8HB9IsgiQugOoS0Fpw57bNujy3BXJO4ROlIxOAbAYV0IXMjE3uWGot8uFeTVqB4
+ p5CzvTV9jdoQXKUFkkgm69MEoN98QB0Ts3BtcOf59X6uOu9twm1ltxnLH52i/4Ty
+ LdzErIs9vEaox5Qe6l4lhAUCAwEAAQ==
+ -----END PUBLIC KEY-----
+ ```
+
+ - Generated as a single value
+ ```yaml
+ APP_PUBLIC_KEY_SSH: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDWRgQntuMGJfMEwj9wLrBqNyUd13k1nRuzHZ3x5VJodRrPjX19M9gFXuY95zTJti6VOG+pZftzuTkf+MlW9NwFEe/g0OomY6UwfKfPj4/ib3MPiASg2o4Ixqu0mv3IrLOsGmU25J38gAVQI3oohW4+B7Vp+2+RnLQCx1FsweWpa8wR0ffQwl0LsWSEWyutfSxi+5pbYwWORBOKyESmGFqGBhMfl0KutBqNAGLt9IYS61bYIqnvfzHqE1uIH3/+ViNzMAr56xt8Lr5a+Y84Mmer1h1wnh6OHnOE6y2sw+876RO8OjMTnHq6v1HDnKHQyCNHxDvpqihy7hlyRtCpC9fuCJC94lB0Gf65xgJC55Jx7gGRSbdLUhN2XZdQeAGPtdidz5KqC8S02fhiDKe0C78hpUGD8MZU4GqvqlyiHoouBhKugkba7F0NeSOLVC9GPLdKNjt5AyCi72pQz8vXaBk8TIb7F+WeQ3NtLw8sgZj0XjXRtx/S6SSoTIOkIKB6hKsPV0k+Z7VaVJ+FpXPsr2CbwcH0iyCJC6A6hLQWnDnts26PLcFck7hE6UjE4BsBhXQhcyMTe5Yai3y4V5NWoHinkLO9NX2N2hBcpQWSSCbr0wSg33xAHROzcG1w5/n1fq46723CbWW3GcsfnaL/hPIt3MSsiz28RqjHlB7qXiWEBQ==
+ ```
+
+ - Generated as a multiline value
+ ```yaml
+ APP_PRIVATE_KEY: |
+ -----BEGIN PRIVATE KEY-----
+ MIIJRAIBADANBgkqhkiG9w0BAQEFAASCCS4wggkqAgEAAoICAQDWRgQntuMGJfME
+ wj9wLrBqNyUd13k1nRuzHZ3x5VJodRrPjX19M9gFXuY95zTJti6VOG+pZftzuTkf
+ +MlW9NwFEe/g0OomY6UwfKfPj4/ib3MPiASg2o4Ixqu0mv3IrLOsGmU25J38gAVQ
+ I3oohW4+B7Vp+2+RnLQCx1FsweWpa8wR0ffQwl0LsWSEWyutfSxi+5pbYwWORBOK
+ yESmGFqGBhMfl0KutBqNAGLt9IYS61bYIqnvfzHqE1uIH3/+ViNzMAr56xt8Lr5a
+ +Y84Mmer1h1wnh6OHnOE6y2sw+876RO8OjMTnHq6v1HDnKHQyCNHxDvpqihy7hly
+ RtCpC9fuCJC94lB0Gf65xgJC55Jx7gGRSbdLUhN2XZdQeAGPtdidz5KqC8S02fhi
+ DKe0C78hpUGD8MZU4GqvqlyiHoouBhKugkba7F0NeSOLVC9GPLdKNjt5AyCi72pQ
+ z8vXaBk8TIb7F+WeQ3NtLw8sgZj0XjXRtx/S6SSoTIOkIKB6hKsPV0k+Z7VaVJ+F
+ pXPsr2CbwcH0iyCJC6A6hLQWnDnts26PLcFck7hE6UjE4BsBhXQhcyMTe5Yai3y4
+ V5NWoHinkLO9NX2N2hBcpQWSSCbr0wSg33xAHROzcG1w5/n1fq46723CbWW3Gcsf
+ naL/hPIt3MSsiz28RqjHlB7qXiWEBQIDAQABAoICAQCemAYdSv0voMkFfaysoLIM
+ e7JqKwDY0OcepM4xq1VaYUqt0oDOOaArIXly2f01SzWhVrs2+3eoyLBiXKbRSLzM
+ t+D/WkHklh4/DBS8yPprU6grF7atQ/aawkl2jL1IWaNGv+aoQYA50pucHBYfhdr5
+ 6IS649JJSV3nLJW01LLiuhm6Gtm8Vw+9RtgqKrziVOKUhLtT5q/HA9YfA2nkMeRW
+ jIp8+Fzvp/h64o1WqITP3gZSRR3YWSGdqiQ2VXJL0n+8kxOctQqL2KEl/s6lfpFD
+ G2CA6VeeQyWnfNY6qG8avcHQsJb7bfdc35xqFzWhrXCHftQFd98madrFvWpVpKF1
+ fjSrQAWHShgyCBQuBteWhYWFlWMkYX3tab6MUS8vUR3LQuv3NGEWvQMgxA2eBzq2
+ iPhTnCJ0EQIMgsBg+O6qW2JuJMdTwB2U+WlLJiJnSBQ5aWwDKjIIzoH17lYmDOvz
+ ij0ZbzHUx01wU5w58z8mi//PppQheaxIT0jZkoGXOmbMsCTv/UcxlqnVHJ1ysA8d
+ QgK+3L+7dyjl3k5IQNt9f49X/C5D0oPYGuzPuP37HzEZYZbYtz5CoICUf6nNFGBl
+ aetSTGRs6ePVqHlo1cZQdk5fIQwX7yelehEb/Cpjk0mv5sk8cJcYviAnkQyUBjOE
+ wujWkG9XTisPMl3c6pAkJQKCAQEA/5TAJKP/uGofwDxoFXg4zjyRsqWeWpIvny5E
+ K9avHPdqFcU1DGAVwUfw6z5Grx8QzWZbnPFI5KMvdVoLpDMubw1XWQCY5X7AD3Iu
+ C9C0cbE+vW8d0AKGEt2q4ERTMZ5dqJiAN/tGJ8wH9mQxOhoim1MPAb0PZJg6WHda
+ 4uN/wnZCuhEVnU86vbKhMJUZYotxEiV3qokZzV7zwsYOdCDw5iipm6McrRVrfdyE
+ u4yIyorq9RB3JChhkgkKSLaFHpuG/YOSM0DQ3vizC57w3LpJ+i+d2FR7Z8fYPSSW
+ BF/hUBUNZG4kk4wxH9dYk27ohBSI2u44n50zrQGST36vxETodwKCAQEA1p/uia4V
+ cHilRd454sQMevtbZO2Zak/g7MzxIUIPI363CKCfjIu/t3iyJ5xohI6OVdqdvE0/
+ hEiVJkv5YNXNLvQFnF7y7z5/HKjkEe72TrZuBwWSoQx69UP9QymzMuV+41f8aVpc
+ c2Xe7XWXK+X56ZGRFND5sB8hd65G9D818Qi90kQyYlb43l8CyiylqYIYh8ldIqHU
+ jAzNGk65kpW6CkL9v/qloKrpAWxErAinB40MHBvgZULj7LijCt2orHOPjOjC1f8n
+ BDf9eBKT+gTLXifIggGBh0iBxen9d2S7/Wz4ySLX47ijDgH0aQO8d668z+c9As0t
+ lz1HmEqLtyLSYwKCAQBH3Y/ZvbOeK1kaOOIbh16Rvz5IuYE5fnmdjOjmWsuKnZda
+ 38T24d28J3p661v8ygNzfiCslLwmbixeFx/G4A1idKHnCN/1SBrBPR3tfJYAkhJO
+ OfxsDQmeLG5r+UpbXWiAi8Eh/KnRbvGeOrYM3GR2wHgryPmXE6b0UTthKQ83owFI
+ SJ2HSkv+I0hn3MTyjLsSmy526W4z7UslrYNK7ChQz4ZBmS/rC2baUTOReQbNzRoc
+ JrEZnbEx2xDlOU1dOeZPSrvFZahVyiCuV9bqegdrLhB4T+kTWYJYTv1P5ZX5arIF
+ V2M5ieYWSftCGaGP4iZJSUrqts1dDGATsk/CJI4pAoIBAQCnIfYk2x6w7hJt/ScA
+ swCxCGpchzYv9rJGVTX1WzbkwjmQi1yTmwQZwPCjLgaqK0UmEE9DIriyr78OCp3R
+ Tc0xoi94XOw7aGSeEdtBJ+BA3YmDCFDt/wUFWAOyOJfmq5aLPao+9HIIHy1hp2+o
+ bLeXrpbXKgE2qJdsVpfEfjDoWZFQW3EM6YN1z3EhtXDwNnIZ07ImVPVqdlGGCgYy
+ 40vzz8VAqdQu8MjwJbq4aSiBFdJ3VTICSPurDQFSZdiDKp5/8YZAFSjx/RPyXC1F
+ xlQEJ2DZ9IhErC76y0NppVVLfX+jSfHq0I6RSu5klNdAMB+ymvUE6Hh3TO4i5vI0
+ E/bXAoIBAQCEXLJhLE/imGPl1Fbqh4lnr2iRMzN3cPxb6DHiKoFXhY18/WWneXEI
+ 8DwK0D+n8spX67YyelFqBjWi4JrG2KhZmPSBF7p7lPypjPdbjkCnSJ0Qjrvdo5ns
+ 46CtmUH8d54SAdgRkXypc1y/3mOnVAhnSRUYm5mtDOtfG0dXdsfS/uDXVRZkTv7S
+ xjdaHi3Ap+oxTMS+zWfKvYAx5g0gTdvb+FdsN89T9XRRx+7N5TmG9D+sUAqNEWkH
+ 7SG6By8x+JqhURZOF9T9n2TX7N9g/+c0y9J10Ol5r0rDFM4SSTX9A5NmqfNF6LO7
+ A0bX/JM8kHjLlJNrtioxcT+dX4lL6/zT
+ -----END PRIVATE KEY-----
+ ```
+
+## Import modifiers
+Modifiers provide a simpler way to transform values compared to using functions alone. You can chain multiple modifiers together using the `|` symbol, making it easy to apply several transformations in sequence. They work with both string and function expressions - just add them between the `` markers, right before the closing `>`.
+---
+### List of import modifiers
+
+ Name
+ Description
+
+ sha256
+ Generate a hash of the incoming string using sha256 algorithm.
+
+ sha512
+ Generate a hash of the incoming string using sha512 algorithm.
+
+ bcrypt
+
+ Generate a hash of the incoming string using bcrypt algorithm.
+ Fixed configuration: Number of cycles = 11
+
+ argon2id
+
+ Generate a hash of the incoming string using argon2id algorithm.
+ Fixed configuration: Memory = 64MiB, Iterations = 4, Parallelism = 4, SaltLen = 16B, KeyLength = 32B
+
+ toHex
+ Encodes provided string/bytes into hexadecimal
+
+ toString
+ Encodes provided string/bytes into string comprised of [a-zA-Z0-9_-.]
+
+ upper
+ Maps all unicode letters to their upper case
+
+ lower
+ Maps all unicode letters to their lower case
+
+ title
+ Maps all words to title case (first letter upper case, rest lower case)
+
+ noop
+ Does nothing - used in tests
+
+---
+### Examples of correctly using import modifiers
+
+ - `, )>` will output a random string of 30 characters:
+ ```yaml
+ 7a14c8e74bc98a0d74253b1d1a4ef6
+ ```
+ - `)| sha256>` will output the sha256 hash of the `` variable:
+ ```yaml
+ 081b91d6dff5036229a92e2442fb65d7c8124571d4e70a2ac4729aeb86957407
+ ```
+ - `)| sha512>` will output the sha512 hash of the `` variable:
+ ```yaml
+ 89c05547de0aa4926512a958f95ab8bf4096ceec63ad5aad4266890bfa059e0cc98917c54276ba4cd61f1dde4c8efda948fc967885c9dd50558ed939722ca10c
+ ```
+ - `)| bcrypt>` will output the bcrypt hash of the `` variable:
+ ```yaml
+ $2a$10$CxKZX0yIxdc7ts6eI5aBu.g.heAsFcePdMDEpnlViTlo3vGc//PXe
+ ```
+ - `)| argon2id>` will output the argon2id hash of the `` variable:
+ ```yaml
+ $argon2id$v=19$m=98304,t=1,p=3$uWBpmoUT3sfckXHyRF9hlg$8bGtNffuHxaRIgN99zCmJeGEYJF5BY2J9TwzqmezP28
+ ```
+
+ - Using upper case modifier:
+ ```yaml
+ Input:
+ Output: STATIC STRING WITH A MODIFIER
+ ```
+ - Using lower case modifier:
+ ```yaml
+ Input:
+ Output: static string with a modifier
+ ```
+ - Using title case modifier:
+ ```yaml
+ Input:
+ Output: Static String With A Modifier
+ ```
+ - Chaining multiple modifiers:
+ ```yaml
+ Input:
+ Output: static string with a modifier
+ ```
+ - Using modifiers with functions:
+ ```yaml
+ Input: ) | upper>
+ Output: 7A14C8E74BC98A0D74253B1D1A4EF6
+
+ Input: , ) | lower>)>
+ Output: h73ep149sd
+ ```
+:::tip Using a space before the pipe separator
+As you can see above, unlike the case of the string expression, using a space before the `|` separator in a function expression doesn't add an additional space character to the result.
+:::
+
+----------------------------------------
+
+# References > Import Yaml > Type List
+
+This is a list of all supported service types that can be used in import yaml configuration file.
+:::note
+Versions listed on the same line are aliases of the same underlying version.
+:::
+## Available service types
+### Static Services
+
+ Service Type
+ Versions
+
+ Nginx
+
+ Static
+
+### Containers and virtual machines
+
+ Service Type
+ Versions
+
+ Alpine
+
+ Ubuntu
+
+### Runtime services
+
+ Service Type
+ Versions
+
+ Bun
+
+ Deno
+
+ .NET
+
+ Elixir
+
+ Gleam
+
+ Go
+
+ Java
+
+ Node.js
+
+ PHP & Apache
+
+ PHP & nginx
+
+ Python
+
+ Rust
+
+### Database services
+
+ Database Type
+ Versions
+
+ KeyDB
+
+ MariaDB
+
+ PostgreSQL
+
+ Qdrant
+
+ Valkey
+
+### Search Engine
+
+ Search Engine
+ Versions
+
+ Elasticsearch
+
+ Meilisearch
+
+ Typesense
+
+### Message Broker
+
+ Message Broker
+ Versions
+
+ Kafka
+
+ NATS
+
+### Storage Services
+
+ Database Type
+ Versions
+
+ Object storage
+
+ Shared storage
+
+
+----------------------------------------
+
+# References > Import
+
+The Zerops YAML configuration provides powerful capabilities for both importing and exporting projects and services. This documentation covers how to define your infrastructure as code and move configurations between environments.
+## YAML Configuration Basics
+The Zerops YAML configuration can be used to create or replicate services in Zerops. You can import configurations in two ways:
+- **Using the GUI**:
+ - **For projects**: In the Zerops dashboard, click on **Import a project** in the Projects section
+ - **For services**: Navigate to a project's details page and click **Import services** in the services section
+- **Using the [CLI](/references/cli)**: Run `zcli project project-import` for projects or `zcli project service-import` for individual services
+Both methods provide straightforward ways to migrate or replicate infrastructure as needed.
+This section provides a comprehensive example of an import YAML configuration file, allowing you to define and import a project and its services with environment variables.
+```yaml
+# ==== Define a project to import ====
+project:
+ # REQUIRED. Name of your project
+ name: project0
+ # Project description
+ description: "This project is an example only"
+ # Project core package - LIGHT/SERIOUS
+ corePackage: SERIOUS
+ # List of project tags for filtering
+ tags:
+ - test
+ - dev
+ # Project-level environment variables
+ envVariables:
+ LOG_LEVEL: info
+ API_VERSION: v1
+# ==== Define a list of services to import into the project ====
+services:
+ # REQUIRED. Name of your service
+ - hostname: app
+ # REQUIRED. Choose from list of supported technologies and their versions
+ type: nodejs@22
+ # HA or NON_HA mode
+ mode: HA
+ # Map of secret environment variables
+ envSecrets:
+ SECRET_KEY: )>
+ # Environment variables defined in .env format (automatically creates secret envs)
+ dotEnvSecrets: |
+ APP_KEY=)>
+ DB_PASSWORD=secure123
+ # Object storage size in GB
+ objectStorageSize: 2
+ # Choose object storage policy from a predefined list
+ objectStoragePolicy: public-read-write
+ # Define additional policy
+ objectStorageRawPolicy:
+ # One time build git repository
+ buildFromGit: https://github.com/myorg/myapp
+ # true or false
+ enableSubdomainAccess: true
+ # The higher the sooner the service is created
+ priority: 1
+ # Vertical autoscaling configuration object
+ verticalAutoscaling:
+ minCpu: 1
+ maxCpu: 3
+ # Choose SHARED or DEDICATED
+ cpuMode: DEDICATED
+ minRam: 1
+ maxRam: 4
+ minDisk: 1
+ maxDisk: 10
+ startCpuCoreCount: 2
+ minFreeCpuCores: 0.5
+ minFreeCpuPercent: 20
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # Minimum number of containers
+ minContainers: 2
+ # Maximum number of containers
+ maxContainers: 6
+ # List of shared storage services to connect to
+ mount:
+ - teststorage1
+ # Full nginx config
+ nginxConfig: |-
+ server {
+ listen 80 default_server;
+ listen [::]:80 default_server;
+ server_name _;
+ root /var/www;
+ location / {
+ try_files $uri $uri/ /index.html;
+ }
+ access_log syslog:server=unix:/dev/log,facility=local1 default_short;
+ error_log syslog:server=unix:/dev/log,facility=local1;
+ }
+ # Zerops.yaml configuration
+ zeropsSetup: backendapi
+ zeropsYaml:
+ zerops:
+ - setup: backendapi
+ build:
+ base: nodejs@22
+ buildCommands:
+ - npm ci
+ - npm run build
+ deployFiles: ./
+ cache: node_modules
+ run:
+ initCommands:
+ - npm run db:migrate
+ start: npm start
+ # When set to true, enables overriding an existing runtime service with the same hostname and triggers a redeploy
+ override: false
+ # REQUIRED. Name of your other service
+ - hostname: teststorage1
+ type: shared-storage
+ ...
+```
+:::note
+The example above is a general guideline; not all keys are valid for every service type. For technology-specific details, refer to the **Create service** page in the **How To** section of the Zerops documentation.
+- `REQUIRED.` If a parent object is defined, the key-value pair is required to be filled. All other key-value pairs are optional.
+:::
+## Project Configuration
+The project configuration is used to define the project you want to import.
+### Usage
+
+ Field
+ Type
+ Description
+
+ project
+ object
+ _REQUIRED, if a whole project is imported_
+Only one project can be defined.
+
+ name
+ string, REQUIRED
+ The name of the new project. Duplicates are allowed.
+
+ description
+ string
+ Description of the new project.
+
+ corePackage
+ string
+ [Core package](/features/infrastructure#project-core) of the new project.
+Values: LIGHT/SERIOUS (default LIGHT)
+
+ tags
+ list of strings
+ One or more string tags.
+Tags provide better orientation in projects.
+
+ envVariables
+ map[string]string
+ [Project-level environment variables](/features/env-variables#project-variables) that are available to all services in the project.
+
+:::warning
+The `corePackage` value can't be changed later. Make sure to choose a suitable core package for your project.
+:::
+This example will create a project named `project0` with [serious core](/features/infrastructure#serious-core) package and the description `This project is an example only`. The project will have two tags: `test` and `dev`, and two environment variables: `LOG_LEVEL` and `API_VERSION`:
+```yaml
+# ==== Define a project to import ====
+project:
+ # REQUIRED. Name of your project
+ name: project0
+ # Project description
+ description: "This project is an example only"
+ # Project core package
+ corePackage: LIGHT
+ # List of project tags for filtering
+ tags:
+ - test
+ - dev
+ # Project-level environment variables
+ envVariables:
+ LOG_LEVEL: info
+ API_VERSION: v1
+```
+## Service Configuration
+The service configuration defines one or more services to import into your project. Services are specified as an array under the `services` key, allowing you to configure multiple services in a single YAML file. You need at least one service and either an existing project to import into or a project defined in the YAML file.
+The Service Configuration section is divided into multiple subsections for better organization:
+- [**Service Basic Configuration**](#service-basic-configuration) - Core parameters like hostname, type, mode, and environment variables
+- [**Service Vertical Autoscaling**](#service-vertical-autoscaling) - CPU, RAM, and disk scaling settings
+- [**Service Horizontal Autoscaling**](#service-horizontal-autoscaling) - Container count scaling settings
+- [**Service Mount Shared Storage**](#service-mount-shared-storage) - Connecting to shared storage services
+- [**Service Nginx Configuration**](#service-nginx-configuration) - Custom web server settings
+- [**Service zerops.yaml Configuration**](#service-zeropsyaml-configuration) - Build and run configurations
+```yaml
+#yamlPreprocessor=on
+services:
+ - hostname: app # REQUIRED: Unique service identifier
+ type: nodejs@22 # REQUIRED: Service type and version
+ mode: HA # HA or NON_HA mode (default: NON_HA)
+ # Environment variables
+ envSecrets: # Secret environment variables (blurred in GUI)
+ SECRET_KEY: )> # Generated random string
+ dotEnvSecrets: | # Environment vars in .env format
+ APP_KEY=)>
+ # Storage configuration
+ objectStorageSize: 2 # Object storage size in GB
+ objectStoragePolicy: public-read-write # Predefined S3 bucket policy
+ # Note: Typically you would use either objectStoragePolicy OR objectStorageRawPolicy, not both
+ objectStorageRawPolicy: | # Custom S3 bucket policy
+ {
+ "Version": "2012-10-17",
+ "Statement": [
+ {
+ "Effect": "Allow",
+ "Principal": "*",
+ "Action": ["s3:GetObject"],
+ "Resource": ["arn:aws:s3:::{{ .BucketName }}/*"]
+ }
+ ]
+ }
+ # Build and deployment
+ buildFromGit: https://github.com/myorg/myapp # Git repo for one-time build
+ enableSubdomainAccess: true # Enable public access via Zerops subdomain
+ priority: 1 # Higher priority services are created sooner
+ override: true # When true, triggers redeploy of existing service
+ # Vertical autoscaling
+ verticalAutoscaling:
+ minCpu: 1 # Minimum number of virtual CPUs
+ maxCpu: 3 # Maximum number of virtual CPUs
+ cpuMode: DEDICATED # SHARED or DEDICATED CPU mode
+ minRam: 1 # Minimum RAM in GB
+ maxRam: 4 # Maximum RAM in GB
+ minDisk: 1 # Minimum disk space in GB
+ maxDisk: 10 # Maximum disk space in GB
+ startCpuCoreCount: 2 # Initial CPU core count
+ minFreeCpuCores: 0.5 # Min free CPU cores before scaling
+ minFreeCpuPercent: 20 # Min free CPU percentage before scaling
+ minFreeRamGB: 0.5 # Min free RAM in GB before scaling
+ minFreeRamPercent: 20 # Min free RAM percentage before scaling
+ # Horizontal autoscaling
+ minContainers: 2 # Minimum number of containers (default: 1, max: 10)
+ maxContainers: 6 # Maximum number of containers (max: 10)
+ # Shared storage
+ mount: # List of shared storage services to mount
+ - teststorage1
+ # Nginx configuration
+ nginxConfig: |- # Custom nginx configuration
+ server {
+ listen 80 default_server;
+ listen [::]:80 default_server;
+ server_name _;
+ root /var/www/public;
+ location / {
+ try_files $uri $uri/ /index.html;
+ }
+ access_log syslog:server=unix:/dev/log,facility=local1 default_short;
+ error_log syslog:server=unix:/dev/log,facility=local1;
+ }
+ # Zerops.yaml configuration
+ zeropsSetup: backendapi # Service setup name from zeropsYaml or repo
+ zeropsYaml: # Full zerops.yaml configuration
+ zerops:
+ - setup: backendapi
+ build:
+ base: nodejs@22
+ buildCommands:
+ - npm ci
+ - npm run build
+ deployFiles: ./
+ cache: node_modules
+ run:
+ initCommands:
+ - npm run db:migrate
+ start: npm start
+ # A second, simpler service example
+ - hostname: teststorage1
+ type: shared-storage
+```
+This example includes all possible configuration options for Zerops services. Not all options are required or applicable to every service type. The example shows two services in the same YAML file: a fully configured Node.js API service and a simpler static frontend service.
+### Service Basic Configuration
+
+ Field
+ Type
+ Description
+
+ services
+ list of objects, REQUIRED
+ At least one service is required.
+
+ hostname
+ string, REQUIRED
+
+ The unique service identifier.
+ Limitations:
+ - duplicates in the same project forbidden
+ - maximum 25 characters, lowercase ASCII letters (a-z) or numbers (0-9) only
+
+ type
+ enum, REQUIRED
+ Specifies the service type and version. See [supported types](/references/import-yaml/type-list).
+
+ mode
+ enum
+ Values: HA / NON_HA (default NON_HA)
+Defines the operation mode of the service.
+
+ envSecrets
+ map[string]string
+ Environment variables that are blurred by default in Zerops GUI. Can be edited or deleted in Zerops GUI.
+
+ dotEnvSecrets
+ string (multiline)
+ Environment variables in .env file format that are automatically created as secret envs.
+
+ objectStorageSize
+ integer
+ Object storage size in GB.
+
+ objectStoragePolicy
+ enum
+
+ Values: **private / public-read / public-objects-read / public-write / public-read-write / custom**
+ Select a predefined AWS S3 bucket access policy.
+
+ objectStorageRawPolicy
+ json
+
+ Define your own AWS S3 bucket access policy. See [AWS docs](https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-policy-language-overview.html) for details.
+ Use `{{ .BucketName }}` placeholder if you need to use bucket name in your custom policy rules.
+
+ buildFromGit
+ string (URL)
+
+ A URL of a Github or Gitlab repository used for a one-time build of your service.
+
+ enableSubdomainAccess
+ boolean
+
+ Default: `false`
+ Set `true`, if you want to enable a public access to your service via a Zerops subdomain. Not suitable for production.
+
+ priority
+ integer
+
+ Services are sorted before creation by priority in descending order, i.e. the higher the priority the sooner the service is created.
+
+ override
+ boolean
+
+ Default: `false`
+ This only works for **runtime** services.
+ The parameter allows you to replace an existing runtime service with the same hostname byt triggering a redeploy if the service already exists.
+
+```yaml
+#yamlPreprocessor=on
+services:
+# REQUIRED: Name of your service
+- hostname: app
+ # REQUIRED: Choose from list of supported technologies and their versions
+ type: nodejs@22
+ # High-Availability or Non-High-Availability mode
+ mode: HA
+ # Map of secret environment variables
+ envSecrets:
+ SECRET_KEY: )>
+ # Environment variables in .env format
+ dotEnvSecrets: |
+ APP_KEY=)>
+ # Object storage size in GB
+ objectStorageSize: 2
+ # Choose object storage policy from a predefined list
+ objectStoragePolicy: public-read-write
+ # Define additional policy
+ objectStorageRawPolicy:
+ # One time build git repository
+ buildFromGit: https://github.com/myorg/myapp
+ # Enables public access via zerops.app subdomain
+ enableSubdomainAccess: true
+ # The higher the sooner the service is created
+ priority: 1
+ # When set to true, triggers a redeploy of an existing runtime service with the same hostname
+ override: false
+```
+This yaml will create a `nodejs@latest` service named `app` in `HA` (High-Availability) mode with the following configurations:
+- Environment variables:
+ - From `envSecrets`: `SECRET_KEY` (requires yamlPreprocessor)
+ - From `dotEnvSecrets`: `APP_KEY` in .env format (requires yamlPreprocessor)
+- Object storage: 2GB with `public-read-write` policy
+- Git repository: `https://github.com/zeropsio/recipe-nodejs`
+- Public access enabled via Zerops subdomain
+- Priority: 1
+- Override existing service: `false`
+The `services` object allows you to define one or more services in the same yaml file.
+:::caution
+The `yamlPreprocessor` option in your project & service import YAML is required to generate random secret values, passwords, and public/private key pairs. For more information, see the [yamlPreprocessor](/references/import-yaml/pre-processor) page.
+:::
+### Service Vertical Autoscaling
+The vertical autoscaling configuration defines how the service can scale its resources vertically.
+
+ Field
+ Type
+ Description
+
+ minCpu
+ integer
+ Minimum number of virtual CPUs
+
+ maxCpu
+ integer
+ Maximum number of virtual CPUs
+
+ cpuMode
+ enum
+ Values: **SHARED / DEDICATED**
+
+ minRam
+ float
+
+ Minimum RAM in GB that each container of the service can scale down to.
+
+ maxRam
+ float
+
+ Maximum RAM in GB that each container of the service can scale up to.
+
+ minDisk
+ float
+
+ Minimum disk space in GB that each container of the service can scale down to.
+
+ maxDisk
+ float
+
+ Maximum disk space in GB that each container of the service can scale up to.
+
+ startCpuCoreCount
+ integer
+
+ Number of CPU cores with which each container starts.
+
+ minFreeCpuCores
+ float
+
+ Minimum number of unused CPU cores before a container starts scaling.
+
+ minFreeCpuPercent
+ float
+
+ Minimum percentage of unused CPU cores before a container starts scaling.
+
+ minFreeRamGB
+ float
+
+ Minimum unused memory in GB before a container starts scaling.
+
+ minFreeRamPercent
+ float
+
+ Minimum percentage of unused memory before a container starts scaling.
+
+```yaml
+services:
+ - hostname: app
+ type: nodejs@22
+ buildFromGit: https://github.com/myorg/myapp
+ enableSubdomainAccess: true
+ verticalAutoscaling:
+ minCpu: 1 # Minimum number of virtual CPUs
+ maxCpu: 3 # Maximum number of virtual CPUs
+ cpuMode: DEDICATED # SHARED or DEDICATED CPU mode
+ minRam: 1 # Minimum RAM in GB
+ maxRam: 4 # Maximum RAM in GB
+ minDisk: 1 # Minimum disk space in GB
+ maxDisk: 10 # Maximum disk space in GB
+ startCpuCoreCount: 2 # Initial CPU core count
+ minFreeCpuCores: 0.5 # Min free CPU cores before scaling
+ minFreeCpuPercent: 20 # Min free CPU percentage before scaling
+ minFreeRamGB: 0.5 # Min free RAM in GB before scaling
+ minFreeRamPercent: 20 # Min free RAM percentage before scaling
+```
+This yaml will create a service with the hostname `app` with `php-nginx@8.4` runtime with `HA` High-Availability mode for vertical autoscaling:
+- CPU: `1-3` virtual CPUs in `DEDICATED` mode
+- RAM: `1-4 GB`
+- Disk Space: `1-10 GB`
+### Service Horizontal Autoscaling
+The horizontal autoscaling configuration is used to define the horizontal autoscaling settings for the service.
+
+ Field
+ Type
+ Description
+
+ minContainers
+ integer
+ Minimum number of containers of the service.
+Default: 1, maximum value: 10
+ maxContainers
+ integer
+ Maximum number of containers of the service.
+Maximum value: 10
+```yaml
+services:
+ - hostname: app
+ type: nodejs@22
+ buildFromGit: https://github.com/zeropsio/recipe-php
+ enableSubdomainAccess: true
+ # Minimum number of containers
+ minContainers: 2
+ # Maximum number of containers
+ maxContainers: 6
+```
+The `minContainers` and `maxContainers` parameters allow you to define the minimum and maximum number of containers for the service. The service will automatically scale between these values as needed.
+### Service Mount Shared Storage
+The mount shared storage configuration defines which shared storage services should be mounted to the service.
+
+ Field
+ Type
+ Description
+
+ mount
+ list of strings
+ Mount shared storage to the service. `buildFromGit` must be filled.
+
+```yaml
+services:
+ - hostname: app
+ type: nodejs@22
+ buildFromGit: https://github.com/myorg/myapp
+ enableSubdomainAccess: true
+ mount:
+ - teststorage1
+```
+The `mount:` parameter allows you to mount a shared storage (which should be created inside the project) to the service.
+### Service Nginx Configuration
+The nginx configuration defines the nginx settings for the service.
+
+ Field
+ Type
+ Description
+
+ nginxConfig
+ string (multiline)
+ Insert full nginx config.
+
+```yaml
+#yamlPreprocessor=on
+services:
+ - hostname: app
+ type: php-nginx@8.4
+ enableSubdomainAccess: true
+ nginxConfig: |-
+ server {
+ listen 80 default_server;
+ listen [::]:80 default_server;
+ server_name _;
+ root /var/www;
+ location / {
+ try_files $uri $uri/ /index.html;
+ }
+ access_log syslog:server=unix:/dev/log,facility=local1 default_short;
+ error_log syslog:server=unix:/dev/log,facility=local1;
+ }
+```
+The `nginxConfig: |-` parameter allows you to specify a custom nginx configuration for the service.
+### Service zerops.yaml Configuration
+The `zeropsSetup` and `zeropsYaml` parameters provide flexibility in how you define and use your service configurations. Both parameters are optional and work together in the following ways:
+
+ Field
+ Type
+ Description
+
+ zeropsSetup
+ string
+ Specifies which service setup to use. This should match a setup name found in either the `zeropsYaml` parameter (if provided) or the `zerops.yaml` file in the repository root. If not specified, defaults to the service hostname.
+
+ zeropsYaml
+ object
+ Contains the full [zerops.yaml configuration](/zerops-yaml/specification). If provided, this will be used instead of looking for a `zerops.yaml` file in the repository.
+
+```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
+```
+#### How They Work Together
+- **Neither parameter specified**:
+ - The system looks for a `zerops.yaml` file in the repository root
+ - It searches for a setup with a name that matches the service hostname
+- **Only `zeropsSetup` specified**:
+ - The system looks for a setup with the specified name in the `zerops.yaml` file in the repository root
+- **Only `zeropsYaml` specified**:
+ - The system uses the provided YAML configuration instead of looking for a file in the repository
+ - It searches for a setup with a name that matches the service hostname
+- **Both parameters specified**:
+ - The system uses the provided `zeropsYaml` configuration
+ - It specifically looks for the setup named in `zeropsSetup` within that YAML
+If the specified `zeropsSetup` does not exist in the available YAML configuration (either provided in `zeropsYaml` or found in the repository), the import will fail.
+## Export
+Zerops provides the ability to export your existing projects and services as YAML configurations through the GUI. This feature is particularly useful for:
+- Creating backups of your project configurations
+- Replicating project or service setups across different environments
+- Sharing project templates with team members
+- Creating version-controlled infrastructure configurations
+The exported YAML follows the same structure as the import YAML configuration detailed above. It will contain all the configuration parameters you've set for your project and services.
+### How to Export
+#### Exporting a Single Service
+Navigate to your service dashboard in the Zerops GUI, click the three-dot menu (⋮) in the top-right corner of the service card, and choose **Export service as yaml**.
+#### Exporting an Entire Project
+In the Zerops GUI, go to the project dashboard, click the three-dot menu (⋮) in the top-right corner of the project card, and select **Export project as yaml**.
+### Using Exported Configurations
+The exported YAML files are compatible with:
+- The Zerops GUI import functionality
+- The `zcli project project-import` command
+- The `zcli project service-import` command (for single service exports)
+This allows you to easily move configurations between environments or create new instances of your infrastructure.
+
+----------------------------------------
+
+# References > Smtp
+
+Simple Mail Transfer Protocol (SMTP) is the internet standard for email transmission. It operates as a set of rules that govern how email messages are formatted, encrypted, and relayed between servers.
+## SMTP in Zerops
+Zerops implements a security-first approach to email sending operations, allowing only port 587 for SMTP communication. This decision aligns with modern security practices and helps maintain the platform's integrity.
+### Port Configuration
+
+ Port
+ Status
+ Description
+
+ 587
+ ✅ Allowed
+ Modern SMTP submission with STARTTLS
+
+ 25
+ ❌ Blocked
+ Traditional SMTP (security risk)
+
+ 465
+ ❌ Blocked
+ Legacy SMTPS (deprecated)
+
+### Why Port 587
+Port 587 is the modern standard for sending emails through SMTP, designed specifically for authenticated client submissions. This port enforces several security measures:
+- Mandatory TLS encryption for data protection
+- Required authentication for all clients
+- Secure transmission through verified providers
+#### How It Works
+Port 587 implements STARTTLS to establish secure connections. The process follows these steps:
+1. Client connects to the SMTP server
+2. Server responds with available capabilities
+3. Client requests STARTTLS upgrade
+4. Connection switches to encrypted TLS
+5. Client provides authentication credentials
+6. Email transmission begins over secure channel
+This implementation balances modern security requirements with broad compatibility, making it the recommended choice for email transmission.
+### Port Restrictions and Platform Security
+Zerops enforces a strict policy of **blocking ports 25 and 465** for email operations.
+:::caution
+This is a permanent security measure with no exceptions, designed to protect both the platform and its users.
+:::
+Port 25, in particular, is frequently exploited for spam distribution across cloud platforms. Instead of providing basic SMTP functionality, we encourage the use of specialized email services that offer:
+- Advanced deliverability management
+- Comprehensive monitoring and analytics
+- Built-in spam protection
+- Professional IP reputation management
+- Automated bounce handling
+This strict policy stems from a crucial understanding: poor IP reputation from email abuse can cascade across an entire infrastructure. The impact extends beyond email services to affect:
+- Legitimate web applications
+- Platform response times
+- Overall service reliability
+- Other customers' applications
+This is why Zerops maintains this strict policy - to ensure consistent, reliable service for all platform users.
+## Sending Emails from Zerops
+### Recommended Approaches
+You have two main options for sending emails from your Zerops applications:
+1. **Email Provider SMTP Client**
+ - You act as a client using their SMTP servers
+ - Subject to provider's sending limits and policies
+2. **Specialized Email Services**
+ - Purpose-built for application email delivery
+ - Your own dedicated sending infrastructure
+ - Higher limits with scalable pricing
+ - Advanced delivery monitoring and analytics
+### Configuration Examples
+These examples serve as a starting point. Check your email provider's official documentation for current configuration requirements.
+:::note
+Port 587 is mandatory for all SMTP configurations in Zerops. Other ports (25, 465) are blocked for security reasons.
+:::
+#### Enterprise Email Providers
+
+ Service
+ Host
+ Port
+ Secure
+ Username
+ Password
+
+ Gmail
+ smtp.gmail.com
+ 587
+ false
+ your.name@gmail.com
+ App Password required
+
+ Google Workspace
+ smtp-relay.gmail.com
+ 587
+ false
+ your.name@your-domain.com
+ Regular password (App Password if using 2FA)
+
+ Office 365
+ smtp.office365.com
+ 587
+ false
+ your.name@your-domain.com
+ Account password
+
+:::note Google
+- Gmail/Office 365: Better for testing or low-volume sending
+- Google Workspace: Suitable for business needs with higher limits
+:::
+#### Email Service Providers
+
+ Provider
+ Host
+ Port
+ Username
+ Password
+ Features
+
+ SendGrid
+ smtp.sendgrid.net
+ 587
+ apikey
+ SendGrid API key
+ • Free tier available
+• Real-time analytics
+• Webhooks
+• Spam detection
+
+ Mailgun
+ smtp.mailgun.org
+ 587
+ postmaster@your-domain.com
+ Mailgun password
+ • Free tier available
+• Email validation
+• Routing rules
+• Delivery analytics
+
+ Amazon SES
+ email-smtp.us-east-1.amazonaws.com
+ 587
+ SES access key ID
+ SES secret access key
+ • Pay as you go pricing
+• AWS integration
+• High deliverability
+• Auto-scaling
+
+## Best Practices
+When implementing email functionality in your applications:
+- Store SMTP credentials in environment variables
+- Implement proper error handling and retry logic
+- Use queue systems for bulk sending to prevent rate limits
+- Monitor delivery status and bounce rates
+- Keep SMTP libraries and configurations up to date
+
+----------------------------------------
+
+# References > Ssh
+
+:::note
+SSH access is available only for runtime services and web servers.
+Database services, message brokers, and object storage are not accessible via SSH.
+:::
+## Prerequisites
+Before establishing an SSH connection to your runtime service, you must first connect to the [Zerops VPN](/references/vpn).
+## Setting Up Your Connection
+### 1. Configure VPN Access
+The [Zerops CLI (zCLI)](/references/cli) comes bundled with the [Zerops VPN](/references/vpn) client. To connect to your [Zerops project](/features/infrastructure#projects):
+1. [Install and configure zCLI](/references/cli)
+2. [Initialize the Zerops VPN connection](/references/vpn#start-vpn)
+### 2. Establish SSH Connection
+Once your VPN session is active, you can connect to any [service](/features/infrastructure#services) using its hostname:
+```sh
+ssh
+```
+Example:
+```sh
+ssh app
+```
+When connecting for the first time, you may receive this security prompt:
+```sh title="bash"
+The authenticity of host 'app (x.x.x.x)' can't be established.
+RSA key fingerprint is SHA256:5wdgRcp/...
+This key is not known by any other names
+Are you sure you want to continue connecting (yes/no/[fingerprint])?
+```
+Type `yes` to trust the host and prevent future prompts.
+## Advanced Connection Options
+
+## Connecting to Specific Containers
+To access a specific container instead of the service as a whole, use the container's hostname:
+```sh
+ssh
+```
+Example:
+```sh
+ssh node-id-1.runtime.app.zerops
+```
+:::note
+When using [HA mode](/features/scaling-ha), connecting to the service hostname will route you to a random container within that service.
+:::
+## Container Naming Conventions
+Each container in your project has a unique hostname following these patterns:
+- Format 1: `node-id-.runtime.app.zerops`
+- Format 2: `node.runtime.app.zerops`
+When your application [scales horizontally](https://docs.zerops.io/features/scaling-ha#vertical-and-horizontal-auto-scaling):
+- New containers receive incremental hostnames
+- Decommissioned container hostnames are not recycled
+- You might see non-sequential container numbers (e.g., `node-id-5` and `node-id-12`)
+- Container hostnames may change as your service scales
+:::warning
+Never connect to containers using their local IP addresses, as these addresses are dynamic and may change.
+:::
+## Important Considerations
+### Non-Persistent Changes
+SSH connections should not be used for making persistent changes to your service:
+- In [HA mode](/features/scaling-ha), changes via SSH affect only the current container
+- Container replacements or scaling events will deploy the original application version
+- For persistent changes across all containers, use:
+ - [`run.prepareCommands`](/zerops-yaml/specification#preparecommands--1)
+ - [`run.initCommands`](/zerops-yaml/specification#initcommands-)
+
+----------------------------------------
+
+# References > Vpn
+
+At Zerops, security is our core priority. We ensure everything stays within a private network with zero exposure to the internet.
+Unlike typical consumer VPNs that focus on changing your public IP address, our WireGuard VPN implementation is specifically designed to give you secure access to your project's services.
+## Prerequisites
+Before getting started, ensure you have:
+- [WireGuard](https://www.wireguard.com/install) installed on your system
+- [zCLI](/references/cli) (serves as the WireGuard client)
+- A Zerops project with at least one service
+## Usage
+You can interact with services within your project and even establish SSH connection to your services after connecting to project through VPN.
+### Start VPN
+To start a VPN session:
+```bash
+zcli vpn up
+```
+Select your project when prompted.
+```bash
+Usage:
+ zcli vpn up [projectId] [flags]
+Flags:
+ --auto-disconnect Automatically disconnects existing VPN connections
+ --help Display help for the vpn up command
+ --projectId string Project ID for command execution (required for multiple projects)
+```
+To connect to a specific project without using the interactive mode, use the project ID from your Zerops dashboard:
+```bash
+zcli vpn up Evs8Je4NTvKeIkUqoUXp2w
+```
+:::info
+First-time `zcli vpn up` usage requires installing the Zerops VPN daemon.
+Confirm with `y` when prompted (administrator privileges may be required).
+:::
+Upon connection, you'll have secure access to your project's private network with the following characteristics:
+- All services are accessible via their hostnames
+- Only one project connection is possible at a time (new connections automatically close existing ones)
+- The VPN daemon maintains connection stability with automatic reconnection
+- Environment variables are not available through VPN connections
+### Stop VPN
+To stop the VPN session:
+```bash
+zcli vpn down
+Usage:
+ zcli vpn down [flags]
+Flags:
+ --help Display help for the vpn down command
+```
+## How do we provide better security?
+We are using WireGuard under the hood for VPN to establish a secure tunnel
+connection to a private network of a Zerops project. This approach provides a safer connection
+compared to SSH.
+Additionally, you won't need to add any passwords or IP addresses for SSH access.
+WireGuard is a free, lightweight, open-source software—technically a communication protocol—that
+utilizes cryptography.
+It helps us create a secure tunnel that uses UDP for transmitting traffic. We use public/private key pairs
+for authorization.
+Inside Zerops project runs a Wireguard server and zCLI (Zerops Command Line Interface) works as
+a Wireguard client which helps you to interact with your zerops project if you're authorized.
+
+----------------------------------------
+
+# References > Vpn > Troubleshooting
+
+# VPN Troubleshooting Guide
+## 1. Interface Already Exists
+**Problem**: When running `zcli vpn up`, you get an error like:
+```
+ERR /opt/homebrew/bin/wg-quick up /opt/homebrew/etc/wireguard/zerops.conf: [+] Interface for zerops is utun6 wg-quick: 'zerops' already exists as 'utun6'
+```
+**Solution**: Reset the VPN connection by running:
+```bash
+zcli vpn down
+zcli vpn up
+```
+## 2. Hostname Resolution
+**Problem**: Even with VPN successfully connected, hostname resolution fails with errors like:
+```
+could not translate host name "hostname" to address: nodename nor servname provided, or not known
+```
+* The issue is known to happen rarely on Windows
+**Solution**: Append `.zerops` to the hostname, even when VPN shows as connected:
+```bash
+# Instead of
+psql -h [hostname] -U [user]
+# Use
+psql -h [hostname].zerops -U [user]
+```
+:::tip Windows OS tip
+In the Advanced TCP/IP Settings dialog, navigate to the DNS tab and confirm that "zerops" appears in the "Append these DNS suffixes (in order)" list. If missing, add it using the Add button.
+:::
+## 3. WSL2 VPN Connection
+**Problem**: VPN not running in WSL2
+**Solution**: This might occur because `systemd` is not running in WSL2 by default. To fix:
+1. Run `sudo -e /etc/wsl.conf`
+2. Add `system=true` to `[boot]` section
+3. Comment out the first line `LABEL=cloudimg-rootfs / ext4 defaults 0 1`
+4. In `cmd.exe/PowerShell` run `wsl --shutdown` to restart WSL2
+
+----------------------------------------
+
+# References > Zsc
+
+Zerops Setup Control (zsc) is a command-line utility automatically installed in all Zerops containers enabling developers to manage and control container environments directly from within both runtime and build contexts.
+Zerops Setup Control provides essential capabilities for container management, including resource scaling, technology installation, and environment configuration.
+Zerops Setup Control commands can be executed in two ways:
+- **Manual execution**:
+ - From the web terminal interface in Zerops GUI
+ - Using SSH connections to your containers
+- **Automated execution**:
+ - As part of your `zerops.yaml` configuration file
+## Usage
+```sh
+zsc [flags]
+```
+## Commands
+---
+### help
+This command lists available commands and flags on a command by placing `help`, `-h` or `--help` flag after the command.
+```sh
+zsc help
+# or
+zsc --help
+# or
+zsc -h
+```
+---
+### completion
+Generate the autocompletion script for zsc for the specified shell.
+```sh
+zsc completion [command]
+```
+#### Available sub-commands
+- `bash`: Generate the autocompletion script for bash
+- `fish`: Generate the autocompletion script for fish
+- `powershell`: Generate the autocompletion script for powershell
+- `zsh`: Generate the autocompletion script for zsh
+#### Available flags
+- `-h, --help`: Help for the completion command
+---
+### backup-create
+Creates a backup of any specified stack in your project.
+```sh
+zsc backup-create
+```
+#### Required parameters
+- `stackName`: Name of the stack to backup
+#### Available flags
+- `-h, --help`: Help for the backup-create command
+#### Example
+```sh
+zsc backup-create db
+```
+---
+### cdn
+Manages CDN (Content Delivery Network) operations for your Zerops services.
+```sh
+zsc cdn [command]
+```
+#### Available sub-commands
+- `purge`: Invalidates cached content from the CDN for a specific domain. The purge command allows you to ensure that the most up-to-date content is being served to visitors after making updates to your site.
+#### Available flags
+- `-h, --help`: Help for the cdn command
+#### Examples
+```sh
+# Purge all CDN cache for a specific domain
+zsc cdn purge example.com
+# Purge all content using wildcard pattern
+zsc cdn purge example.com "/*"
+# Purge CDN cache for a specific file (note the $ suffix)
+zsc cdn purge example.com "/path/to/my-file$"
+# Purge CDN cache for a specific directory
+zsc cdn purge example.com "/images/"
+```
+:::important
+- This command must be executed in any container within the project that has the CDN-enabled domain active
+- Currently, the purge command only works for the [Static Mode](/features/cdn#static-mode) CDN
+:::
+---
+### shared-storage
+Manages shared storage volumes for persistent data storage.
+```sh
+zsc shared-storage [command]
+```
+#### Available sub-commands
+- `mount`: Mounts the shared storage
+- `unmount`: Unmounts the shared storage
+- `wait`: Waits for readiness of the storage mount
+#### Available flags
+- `-h, --help`: Help for the shared-storage command
+#### Examples
+```sh
+# View shared-storage help
+zsc shared-storage --help
+# Mount a shared storage volume
+zsc shared-storage mount
+# Unmount a shared storage volume
+zsc shared-storage unmount
+# Wait for a storage mount to be ready
+zsc shared-storage wait
+```
+---
+### crontab
+Manages scheduled tasks that are defined in your zerops.yaml configuration.
+```sh
+zsc crontab [command]
+```
+#### Available sub-commands
+- `list`: List all crontabs defined in zerops.yaml
+- `run`: Execute crontab command defined in zerops.yaml
+#### Available flags
+- `-h, --help`: Help for the crontab command
+---
+### execOnce
+Execute a command exactly once across all containers in a service, preventing duplicate execution in high-availability setups.
+```sh
+zsc execOnce [flags] -- [args...]
+```
+#### Required parameters
+* ``: A unique identifier for the execution
+* `--`: Standard separator indicating the end of options and beginning of the command
+* ` [args...]`: The actual command to execute and its arguments
+#### Available flags
+- `-r, --retryUntilSuccessful`: Retry command until it succeeds
+- `-v, --verbose`: Verbose output
+- `-h, --help`: Help for the execOnce command
+#### Behavior
+- **On success**: All containers proceed with their tasks
+- **On failure**: All containers report the command as failed
+- **With --retryUntilSuccessful**: The command is retried on a different container until it succeeds
+#### Examples
+```sh
+# Execute a command once for the entire service stack
+zsc execOnce someStaticKey -- /var/www/myBinary some initial command --flag="value" --flag2="value2"
+# Run migrations for each new app version deployed to Zerops
+zsc execOnce ${ZEROPS_appVersionId} -- php /var/bin/console migrations:continue
+```
+:::info
+This command is ideal for database migrations, initialization scripts, and other operations that should only run once in clustered environments.
+:::
+---
+### fail-me
+Deliberately fails the current container for testing purposes.
+```sh
+zsc fail-me
+```
+#### Available flags
+- `-h, --help`: Help for the fail-me command
+---
+### install
+Run install commands for the specified base technology in your runtime container.
+```sh
+zsc install [flags]
+```
+#### Required parameters
+- `baseName`: The technology and version to install - see the full list of supported [base environments](/zerops-yaml/base-list).
+#### Available flags
+- `--buildBase `: Build base (default "php@8.4")
+- `--buildOs `: Build os (default "alpine")
+- `-m, --mode `: Mode (default "RUNTIME")
+- `--runBase `: Run base (default "php-nginx@8.4")
+- `--runOs `: Run os (default "alpine")
+- `-h, --help`: Help for the install command
+#### Examples
+```sh
+zsc install rust@1.78
+zsc install dotnet@8
+zsc install nginx@1.22
+```
+#### Example usage in `zerops.yaml`
+```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
+```
+---
+### noop
+Keep a container alive indefinitely with a non-terminating process.
+```sh
+zsc noop [flags]
+```
+#### Available flags
+- `-s, --silent`: Disables output to StdOut
+- `-h, --help`: Help for the noop command
+#### Examples
+```sh
+zsc noop
+zsc noop --silent
+```
+:::info
+The `noop` command is especially useful for:
+- Debugging build failures by keeping containers alive for investigation
+- Supporting applications that run as background daemons
+- Keeping service containers active when your app doesn't have a foreground process
+- As a start command in zerops.yaml for services that don't have a natural blocking command
+:::
+#### Usage in zerops.yaml
+```yaml
+zerops:
+ - setup: myapp
+ run:
+ start: zsc noop
+ ports:
+ - port: 8080
+ http: true
+```
+---
+### resources
+Displays the current resource scaling configuration for the container.
+```sh
+zsc resources
+```
+#### Available flags
+- `-h, --help`: Help for the resources command
+#### Example output
+```json
+{
+ "cpuCoreCount": 1,
+ "memoryGBytes": 0.25,
+ "diskGBytes": 1
+}
+```
+#### Related commands
+- `zsc scale`: Dynamically adjust resource allocations
+---
+### scale
+Dynamically adjust CPU or memory resources for the current container for a specified duration.
+```sh
+zsc scale {cpu|ram} { |auto}
+```
+#### Required parameters
+- `cpu|ram`: Resource type to scale (either CPU cores or RAM)
+- ` ` or `auto`: Scale value and duration, or "auto" to disable custom scaling
+#### Available flags
+- `-h, --help`: Help for the scale command
+#### Supported values
+- **For RAM**: Value must be suffixed by a unit (KiB, MiB, GiB); number may be a float.
+- **For CPU**: Value must not be suffixed; number must be an integer.
+- **"auto"**: Disables any custom scaling set via this command and must be used without the duration parameter.
+- **"min"** and **"max"**: Set the container to its CURRENT min and max values.
+- Numeric values can be prefixed with **"+"** for relative scaling, adding the requested value to currently used resources.
+- Duration must be suffixed by a unit (s = seconds, m = minutes, h = hours, d = days) and cannot be less than 10 minutes.
+#### Examples
+```sh
+zsc scale cpu auto
+zsc scale cpu 5 1h
+zsc scale cpu +2 30m
+zsc scale cpu min 10m
+zsc scale ram auto
+zsc scale ram 5GB 1h
+zsc scale ram +2.5GB 600s
+zsc scale ram max 10m
+```
+:::info
+- Resource adjustments take effect within approximately 10 seconds
+- The container cannot be scaled above or below its max/min resources set in the vertical autoscaling configuration
+- If you scale to a value that exceeds the maximum set limit (e.g., 10GB RAM when max is 5GB), the container will only receive the maximum allowed resources
+- If service limits are changed while custom scaling is active, the container will automatically adjust to the new boundaries
+- If the service auto-scaling configuration is updated, you must call the scale command again to apply custom scaling
+:::
+:::caution
+If there are insufficient resources on the current server, the container might be moved to another node with available resources, which will reset the scale duration.
+The container will scale down automatically if resources are not utilized, or if the scale command duration expires.
+:::
+---
+### test
+Run diagnostic tests to verify connectivity and service availability.
+```sh
+zsc test tcp : [flags]
+```
+#### Required parameters
+- `:`: Host and port to test connectivity to
+#### Available flags
+- `--timeout `: Maximum test duration (default: 30s)
+- `--dialTimeout `: Single attempt timeout (default: 2s)
+- `-4`: Force IPv4
+- `-6`: Force IPv6
+- `-h, --help`: Help for the test tcp command
+#### Example
+```sh
+# Test TCP connection to a host
+zsc test tcp api.zerops:80
+zsc test tcp database:5432 --timeout 1m
+```
+---
+### setSecretEnv
+Securely update environment variables containing sensitive information.
+```sh
+zsc setSecretEnv
+```
+#### Arguments
+- `key`: The name of the environment variable to set
+- `content`: The new value for the variable, or `-` to read from stdin
+#### Available flags
+- `-h, --help`: Help for the setSecretEnv command
+#### Examples
+```sh
+# Set a secret environment variable directly
+zsc setSecretEnv SECRET_KEY "new_value"
+# Set a secret environment variable from stdin (useful for multi-line values or piping)
+echo "new_value" | zsc setSecretEnv SECRET_KEY -
+# Set a secret API key from a file
+cat api_key.txt | zsc setSecretEnv API_KEY -
+```
+:::info
+Secret environment variables are encrypted at rest and securely distributed to your containers. Use this command for storing sensitive configuration like API keys, tokens, and passwords.
+:::
+---
+### version
+Displays the current version of Zsc CLI.
+```sh
+zsc version
+```
+#### Available flags
+- `-h, --help`: Help for the version command
+
+----------------------------------------
+
+# Rust > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing Rust application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](/rust/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple Rust web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Rust > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](/rust/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](/rust/how-to/build-pipeline#ports) `8080`, simply use `http://app:8080`
+:::info
+Do not use `https://` when communicating with Rust from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use Rust environment variables
+Zerops creates default environment variables for each Rust service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](/rust/how-to/env-variables#generated-env-variables) of the Rust service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](/rust/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your Rust application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access Rust application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/rust/how-to/env-variables) are available when connected through VPN. To connect to your Rust application in Zerops set the hostname and [internal port](/rust/how-to/build-pipeline#ports) e.g. http://app:8080
+:::info
+Do not use `https://` when communicating with Rust over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your Rust service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your Rust service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/rust/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Rust > How To > Build Pipeline
+
+Zerops provides a customizable build and runtime environment for your Rust application.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: rust@latest
+ # OPTIONAL. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # REQUIRED. Build your application
+ buildCommands:
+ - cargo b --release
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - target/release/~app
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ # cache: file.txt
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: rust@latest
+ # OPTIONAL. Sets the internal port(s) your app listens on:
+ ports:
+ # port number
+ - port: 8080
+ # OPTIONAL. Customize the runtime Rust environment by installing additional
+ # dependencies to the base Rust runtime environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Rust application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # REQUIRED. Your Rust application start command
+ start: ./app
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your Rust application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Build pipeline configuration
+### base
+_REQUIRED._ Sets the base technology for the build environment.
+Following options are available for Rust builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: rust@latest
+ ...
+```
+ The base build environment contains {data.alpine.default}, the selected
+ major version of Rust, Zerops command line tool, `npm` , `yarn`, `git` and `npx` tools.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base:
+ - rust@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
+To customize your build environment use the [prepareCommands](/rust/how-to/build-pipeline#preparecommands) attribute.
+:::note
+Modifying the base technology will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### os
+_OPTIONAL._ Sets the operating system for the build environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customized.
+:::
+:::note
+Modifying the OS will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### prepareCommands
+_OPTIONAL._ Customizes the build environment by installing additional dependencies or tools to the base build environment.
+The base build environment contains:
+- {data.alpine.default}
+- selected version of Rust defined in the [base](/rust/how-to/build-pipeline#base) attribute
+- [Zerops command line tool](/references/cli)
+- `npm`, `yarn`, `git` and `npx` tools
+To install additional packages or tools add one or more prepare commands:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: rust@latest
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ prepareCommands:
+ - cargo b --release
+ ...
+```
+When the first build is triggered, Zerops will
+1. create a build container
+2. download your application code from your repository
+3. run the prepare commands in the defined order
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::note
+These commands are skipped when using cached environment. Modifying `prepareCommands` will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache invalidation.
+:::
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/rust/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all prepare commands are finished, your custom build environment is ready for the build phase.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### buildCommands
+_REQUIRED._ Defines build commands.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: rust@latest
+ # REQUIRED. Build your application
+ buildCommands:
+ - cargo b --release
+ ...
+```
+At least one command is required. Zerops triggers each command in the defined order in a dedicated build container.
+Before the build commands are triggered the build container contains:
+1. base environment defined by the [base](/rust/how-to/build-pipeline#base) attribute
+2. optional customisation of the base environment defined in the [prepareCommands](/rust/how-to/build-pipeline#preparecommands) attribute
+3. your application code
+#### Run build commands as a single shell instance
+Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it.
+```yaml
+buildCommands:
+ - |
+ cargo b --release
+```
+#### Run build commands as a separate shell instances
+When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command.
+```yaml
+buildCommands:
+ - cargo b --release
+```
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/rust/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the --verbose option.
+```yaml
+buildCommands:
+ - cargo b --release
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the deploy phase.
+### deployFiles
+_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
+```yaml
+# REQUIRED. Select which files / folders to deploy after
+# the build has successfully finished
+deployFiles:
+ - target/release/~app
+```
+Determines files or folders produced by your build, which should be deployed to your runtime service containers.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Examples
+Deploys a folder, and a file from the project root directory:
+```yaml
+deployFiles:
+ - target/release/~app
+```
+Deploys the whole content of the build container:
+```yaml
+deployFiles: .
+```
+Deploys a folder, and a file in a defined path:
+```yaml
+deployFiles:
+ - ./path/to/file.txt
+ - ./path/to/dir/
+```
+#### How to use a wildcard in the path
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+Deploys all folders that are located in any path that begins with `/path/to/`
+```yaml
+deployFiles: ./path/to/~/
+```
+Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/
+```
+:::note Example
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+:::
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+_OPTIONAL._ Defines which files or folders will be cached for the next build.
+```yaml
+# OPTIONAL. Which files / folders you want to cache for the next build.
+# Next builds will be faster when the cache is used.
+cache: file.txt
+```
+The cache attribute helps optimize build times by preserving specified files between builds.
+The cache attribute supports the [~ wildcard character](#how-to-use-a-wildcard-in-the-path).
+Learn more about the [build cache system](/features/build-cache) in Zerops.
+### envVariables
+_OPTIONAL._ Defines the environment variables for the build environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ base: rust@latest
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ RUST_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/rust/how-to/env-variables) in Zerops.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current Rust version for your runtime.
+Following options are available for Rust builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: rust@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: rust@latest
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the
+ selected major version of Rust, Zerops command line tool, npm, yarn, git and
+ npx tools.
+:::info
+You can change the base environment when you need to. Just simply modify the zerops.yaml in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: rust@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base:
+ - rust@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customize your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a Rust service with hostname = "app" and port = 8080 from another service of the same project, simply use `app:8080`. Read more about [how to access a Rust service](/rust/how-to/access).
+Each port has following attributes:
+
+ Parameter
+ Description
+
+ port
+ Defines the port number. You can set any port number between 10 and 65435. Ports outside this interval are reserved for internal Zerops systems.
+
+ protocol
+ Optional. Defines the protocol. Allowed values are TCP or UDP. Default value is TCP.
+
+ httpSupport
+ Optional. httpSupport = true is the default setting for TCP protocol. Set httpSupport = false if a web server isn't running on the port. Zerops uses this information for the configuration of public access. httpSupport = true is available only in combination with the TCP protocol.
+
+### prepareCommands
+_OPTIONAL._ Customises the Rust runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base Rust environment contains {data.alpine.default}, the selected
+ major version of Rust, Zerops command line tool and `npm` , `yarn`, `git` and `npx` tools. To install additional packages or tools add one or
+ more prepare commands:
+```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 Rust runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/rust/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/rust/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+
+When the prepare cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.default}, the
+ selected major version of Rust, Zerops command line tool and `npm`, `yarn`, `git` and `npx` tools.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare: ./runtime-config.yaml
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base Rust runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Rust application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your Rust application is started via the [start command](/rust/how-to/build-pipeline#start).
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](/rust/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](/rust/how-to/build-pipeline#preparecommands-1) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](/rust/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ RUST_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/rust/how-to/env-variables) in Zerops.
+### start
+_REQUIRED._ Defines the start command for your Rust application.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Rust application start command
+ start: ./app
+```
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Rust application start command
+ start: ./app
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Rust application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Rust application start command
+ start: ./app
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+### crontab
+_OPTIONAL._ Defines cron jobs.
+Setup cron jobs in the following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ crontab:
+ # REQUIRED. Sets the command to execute:
+ - command: ""
+ # REQUIRED. Sets the interval time to execute:
+ timing: "0 * * * *"
+```
+Read more about setting up [cron](/references/cron) in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](/rust/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](/rust/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Rust application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](/rust/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Rust > How To > Build Process
+
+
+## Description of the build process
+Zerops starts a temporary build container and performs following actions:
+1. Installs the build environment:
+ - Sets up base system and Go runtime
+ - Restores cached files if available (based on `build.cache` configuration)
+ - Validates cache against current `build.os`, `build.base`, and `build.prepareCommands`
+2. Downloads your application source code from [GitHub ↗](https://www.github.com), [GitLab ↗](https://www.gitlab.com) or via [Zerops CLI](/references/cli)
+3. Optionally [customizes the build environment](#customize-rust-build-environment)
+4. Runs the build commands
+5. Uploads the application artefact to the internal Zerops storage
+6. Preserves specified files for future builds (based on `build.cache` configuration)
+7. Optionally [customizes the runtime environment](/rust/how-to/customize-runtime)
+8. [Deploys your application](/rust/how-to/deploy-process)
+The build container is automatically deleted after the build has finished or failed.
+## Cancel running build
+When you know that the running build is not correct and you want to cancel it, you can do it in Zerops GUI. Go to the service detail, select **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Cancel build** button.
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+## Customize Rust build environment
+The default Rust build environment contains:
+- {data.alpine.default}
+- selected version of Rust defined in `zerops.yaml` [build.base](/rust/how-to/build-pipeline#base) parameter
+- [zCLI](/references/cli), Zerops command line tool
+- `npm`, `yarn`, `git` and `npx` tools
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/rust/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](/rust/how-to/build-pipeline#preparecommands) commands to your `zerops.yaml`.
+:::info
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::
+## Rust build hardware resources
+Build of your Rust application is run in a separate build container with following resource configuration:
+| HW resource | Minimum | Maximum |
+| ------------- | ------- | ------- |
+| **CPU cores** | 6 | 20 |
+| **RAM** | 8 GB | 8 GB |
+| **Disk** | 1 GB | 100 GB |
+| **Disk** | 1 GB | 100 GB |
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+## Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops will terminate the build pipeline and delete the build container.
+## Troubleshooting build-related problems
+### Failure of a build prepare command
+If any [prepare command](/rust/how-to/build-pipeline#preparecommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/rust/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom build environment is ready for the build phase.
+### Invalidate the build cache
+If you encounter unexpected build behavior or dependency issues, the problem might be related to [cached build data](/features/build-cache). While Zerops maintains the build cache to speed up deployments, sometimes you may need to start fresh.
+To invalidate the build cache:
+1. Go to your service detail in Zerops GUI
+2. Choose **Pipelines & CI/CD Settings** from the left menu
+3. Click on the **Invalidate build cache** button
+This will force Zerops to run the next build clean, including all prepare commands, which can help resolve cache-related issues. After invalidation, your next build will also create a fresh cache.
+### Failure of a build command
+If any [build command](/rust/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/rust/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `--verbose` option.
+```yaml
+buildCommands:
+ - cargo build --release -v
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the [deploy](/rust/how-to/deploy-process) phase.
+
+----------------------------------------
+
+# Rust > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart Rust service in Zerops GUI
+To stop the Rust service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped Rust service choose the **Start** item from the same menu.
+To restart the Rust service choose the **Restart** item from the same menu.
+## Stop and start Rust using zCLI
+zCLI is the Zerops command-line tool. To stop and start the Rust service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Rust > How To > Create
+
+Zerops provides a Rust runtime service with extensive build support. Rust runtime is highly scalable and customisable to suit both development and production.
+## Create Rust service using Zerops GUI
+First, set up a project in Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new Rust service:
+### Choose Rust version
+Following Rust versions are currently supported:
+:::info
+You can [change](/rust/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app","cache", "gui" etc. Duplicate services with the same name in the same project are forbidden.
+#### Limitations:
+- maximum 25 characters
+- must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created. It can't be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as password, tokens, salts, certificates etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting the secret environment variables is optional. You can set them later in Zerops GUI.
+Read more about [different types of env variables](/rust/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Set auto scaling configuration
+Zerops scales the Rust services automatically both vertically and horizontally. Vertical scaling means increasing or decreasing the hardware resources (CPU, RAM and disk) of a Rust container. Horizontal scaling adds or removes whole containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Rust service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Rust service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Rust performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/rust/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+:::info
+You can change the vertical auto scaling parameters later.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Rust service. When your Rust service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ Parameter
+ Value
+
+ minimum containers
+ 1
+
+ maximum containers
+ 6
+
+Rust service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](/rust/how-to/scaling) about Rust auto scaling.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Create Rust service using zCLI
+zCLI is the Zerops command-line tool. To create a new Rust service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/rust/how-to/create#create-a-project-description-file)
+3. [Create a project with a Rust and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### Basic example:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in rust@{version} format
+ type: rust@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one Rust version 18 service with default [auto scaling](/rust/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/rust/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Rust and PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in rust@{version} format
+ type: rust@latest
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create secret env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+ - # second service hostname
+ hostname: db
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain a Rust service and a [PostgreSQL](/postgresql/overview) service.
+Rust service with "app" hostname, the internal port(s) the service listens on will be defined later in the [zerops.yaml](/rust/how-to/build-pipeline#ports). Rust service will run on version 18 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+ Limitations
+
+ name
+ The name of the new project. Duplicates are allowed.
+
+ description
+ Optional. Description of the new project.
+ Maximum 255 characters.
+
+ tags
+ Optional. One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects.
+
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains Rust and PostgreSQL services but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [Rust service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+ All verticalAutoscaling attributes are optional. Not specified
+ attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers
+ for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value
+ map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add Rust service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in rust@{version} format
+ type: rust@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Rust service version 18 with default [auto scaling](/rust/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Rust > How To > Customize Runtime
+
+
+The default Rust runtime environment contains:
+- {data.alpine.default}
+- Selected version of Rust when the runtime service was created.
+- [zCLI](/references/cli)
+- Git
+:::note
+To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yaml/specification#os--1) attribute.
+Additional packages and tools can be installed using [run.prepareCommands](/zerops-yaml/specification#preparecommands--1).
+:::
+### Runtime Flow
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/rust/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the run.prepareCommands commands in the defined order
+### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/rust/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+The prepare runtime container is automatically deleted after the prepare runtime phase has finished or failed.
+### Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the build.addToRunPrepare and run.prepareCommands attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+
+----------------------------------------
+
+# Rust > How To > Delete
+
+## Delete Rust service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete Rust using zCLI
+zCLI is the Zerops command-line tool. To delete the Rust service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Rust > How To > Deploy Process
+
+
+## Application artefact
+When the [build phase](/rust/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](/rust/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/rust/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/rust/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/rust/how-to/build-pipeline#initcommands)
+4. Starts your application using the [start command](/rust/how-to/build-pipeline#start)
+5. Optionally waits until the [readiness check](/rust/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/rust/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customize the runtime environment](/rust/how-to/customize-runtime).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The Rust process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready to handle requests right after it is started via the [start command](/rust/how-to/build-pipeline#start), configure a [readiness check](/rust/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your Rust service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/rust/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Rust > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+
+ Type
+ Environment
+ Defined in
+
+ basic
+ build
+ zerops.yaml
+
+ basic
+ runtime
+ zerops.yaml
+
+ secret
+ runtime
+ Zerops GUI
+
+Use the [secret env variables](/rust/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](/rust/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/rust/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](/rust/how-to/create) a new Rust service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made to environment variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The Rust process running in the container receives the list env variables only when it starts. Update of the env variables while the Rust process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+These restrictions apply to all [types of env variables](/rust/how-to/env-variables#types-of-env-variables-in-zerops).
+## Referencing other env variables
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your Rust runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the Rust service. The Rust process running in the container receives the list env variables only when it starts. Update of the env variables while the Rust process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a Rust service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your Rust app
+Zerops passes all environment variables from all project services when your Rust app is deployed and started.
+To access the local environment variable i.e. the variable set to this Rust service in your app, use:
+```sh
+env::var("YOUR_VARIABLE_KEY_HERE")
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+
+----------------------------------------
+
+# Rust > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Rust > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](/rust/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](/rust/how-to/build-pipeline#preparecommands-1) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the _first runtime container_ in Zerops CLI use
+```sh
+zcli service log
+```
+For an _aggregate log_ from all service's runtime containers omit the `@1`
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## Rust logging configuration
+Zerops logs all messages sent
+- to the standard error (`stderr`)
+- to the standard output (`stdout`)
+- via the Rust `console.log` method
+### Severity level
+By default the `console.log` creates a message with the `Informational (6)` severity.
+Add a severity number in the `` format as a prefix to set a custom severity as shown below:
+```rust
+console.log("A message with the informational severity ...");
+console.log('Emergency (0) severity > system is unusable.');
+console.log('Alert (1) severity > action must be taken immediately.');
+console.log('Critical (2) severity > critical conditions.');
+console.log('Error (3) severity > error conditions.');
+console.log('Warning (4) severity > warning conditions.');
+console.log('Notice (5) severity > normal, but significant, condition.');
+console.log('Informational (6) severity > informational message.');
+console.log('Debug (7) severity > debug-level message.');
+```
+:::info
+`console.info`, `console.warn`, `console.debug`
+, and `console.error` are just aliases to the `
+ console.log
+` method. They don't set the appropriate severity number. Use the `
+ <N>
+` prefix instead. :::
+
+----------------------------------------
+
+# Rust > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the Rust service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Rust service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Rust service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Rust performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Rust service. When your Rust service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Rust service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each Rust service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the Rust service.
+### Not enough resources to scale up
+If one of the Rust containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the Rust service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor Rust resources
+Zerops provides information about how much hardware resources the Rust service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Rust > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your Rust service directly when creating a new shared storage service. Just select your Rust service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the Rust service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create Rust service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new Rust service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/rust/how-to/shared-storage#create-a-project-description-file)
+3. [Create a project with a Rust service and a shared storage](/rust/how-to/shared-storage#create-a-project-with-a-rust-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](/rust/how-to/create#create-a-project-description-file) how to define the Rust service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Rust and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in rust@{version} format
+ type: rust@latest
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the Rust service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with a Rust service and a shared storage
+Follow the article [How to create a project based on the description.yaml](/rust/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Rust > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](/rust/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](/rust/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](/rust/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Rust > How To > Upgrade
+
+You can upgrade or downgrade your Rust service to a different major Rust version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/rust/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Rust version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Rust version for your runtime.
+If you want to build your application with a different major Rust version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
+
+----------------------------------------
+
+# Rust > Overview
+
+[Rust ↗](https://www.rust-lang.org/) - a language empowering everyone to build reliable and efficient software.
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-rust-hello-world), a **_recipe_**, containing the most simple Rust web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of Rust running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-rust-hello-world/blob/main/import-project/description.yaml)):
+```yaml
+project:
+ name: my-first-project
+services:
+ - hostname: helloworld
+ type: rust@latest
+ minContainers: 1
+ maxContainers: 3
+ buildFromGit: https://github.com/zeropsio/recipe-rust-hello-world@main
+ enableSubdomainAccess: true
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://helloworld-24-8080.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+Hello, World!
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+## How to start
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Shared Storage > How To > Backup
+
+Zerops provides built-in backup functionality for your Shared Storage service. For general information about configuring backups, viewing backup files, limits, and security, please refer to the [general backup documentation](/features/backup).
+Shared Storage backups on Zerops:
+- Are stored as tarballs containing the entire contents of the shared storage directory (`/mnt/`)
+- Can be managed through the Shared Storage service detail page under **Backups List & Configuration**
+### Storage Optimization
+For large Shared Storage volumes:
+- Be mindful of the [project backup limits](/features/backup#limits) (25 GiB total backup volume per project)
+- Consider adjusting your backup frequency for optimal storage usage
+- Regularly clean up unnecessary files from your Shared Storage to reduce backup size
+
+----------------------------------------
+
+# Shared Storage > How To > Connect
+
+This page covers how to connect an existing shared storage to runtime services and how to disconnect services when needed.
+## In Zerops GUI
+### Connect a new shared storage
+When creating a new shared storage service, you can directly select which runtime services it should be connected to. See [Create Shared Storage](/shared-storage/how-to/create) for details about the creation process.
+### Connect an existing shared storage
+For existing storage, go to the shared storage service detail page and select **Shared storage connections**. Toggle ON any runtime services you wish to connect to this storage.
+
+## Disconnect a shared storage in Zerops GUI
+To disconnect storage, access the shared storage service detail page, select **Shared storage connections**, and toggle OFF the desired runtime service.
+
+----------------------------------------
+
+# Shared Storage > How To > Create
+
+Shared Storage provides persistent file storage that can be mounted as a POSIX-compatible filesystem to your runtime services. Built on [SeaweedFS ↗](https://github.com/seaweedfs/seaweedfs), it enables reliable data persistence and sharing across services in your infrastructure.
+## Create Using Zerops GUI
+First, set up a project in Zerops GUI and add a runtime service. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new Shared Storage service:
+### Set a Hostname
+Enter a unique service identifier like "storage", "files" etc. Duplicate services with the same name in the same project are forbidden.
+#### Hostname Limitations:
+- Maximum 25 characters
+- Must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::note
+The hostname is fixed after the service is created. It can't be changed later.
+:::
+### Connect to Services
+Select one or more project's runtime services in the Share with Services block:
+
+The new Shared Storage will be connected to the selected runtimes.
+:::note
+Runtime services can be connected and disconnected at any time even after the shared storage is created.
+:::
+### Choose Deployment Mode
+Choose between **Highly Available** (recommended for production) or **Single Container** (suitable for development) deployment.
+:::warning
+The Shared Storage deployment mode is fixed after the service is created. It can't be changed later.
+See [Technical Details](/shared-storage/technical-details#deployment-modes) for more information about deployment modes.
+:::
+### Set Auto Scaling Configuration
+Configure vertical auto scaling parameters to control resource allocation and costs.
+
+:::note
+For detailed information about auto scaling capabilities and recommendations, see [Technical Details](/shared-storage/technical-details#auto-scaling-configuration).
+:::
+## Create Using zCLI
+zCLI is the Zerops command-line tool. To create a new Shared Storage service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Create a project description file
+3. Create a project with a runtime and a Shared Storage service
+### Choose Your Runtime
+export const languages = [
+ { name: "Node.js", link: "/nodejs/how-to/shared-storage#create-nodejs-service-with-a-shared-storage-using-zcli" },
+ { name: "PHP", link: "/php/how-to/shared-storage#create-php-service-with-a-shared-storage-using-zcli" },
+ { name: "Python", link: "/python/how-to/shared-storage#create-python-service-with-a-shared-storage-using-zcli" },
+ { name: "Go", link: "/go/how-to/shared-storage#create-go-service-with-a-shared-storage-using-zcli" },
+ { name: ".NET", link: "/dotnet/how-to/shared-storage#create-dotnet-service-with-a-shared-storage-using-zcli" },
+ { name: "Rust", link: "/rust/how-to/shared-storage#create-rust-service-with-a-shared-storage-using-zcli" }
+]
+
+----------------------------------------
+
+# Shared Storage > How To > Manage
+
+Zerops Shared Storage provides several web interfaces to manage, monitor, and troubleshoot your storage. These interfaces are accessible through the [Zerops VPN](/references/vpn) and offer different capabilities for managing your data and monitoring system performance.
+## Access Web Interfaces
+### Filer UI
+* `http://.zerops:8888`
+The Filer UI provides a web-based interface for managing files and directories in your Shared Storage:
+- Browse the directory structure and create new directories
+- Upload new files (up to 64MB) and download existing files
+- Rename and delete files and directories
+### Master UI
+* `http://node-stable-1.db..zerops:9333`
+The Master UI provides system status and monitoring information:
+- View cluster topology
+- Monitor volume servers
+- Check system status and health
+- View statistics and metrics
+### Volume UI
+* `http://node-stable-.db..zerops:8080/ui/index.html`
+The Volume UI allows you to monitor individual storage volumes:
+- View volume status
+- Check disk usage
+- Monitor I/O operations
+- View volume statistics
+## Monitoring
+Several options are available to help you monitor your Shared Storage:
+### Runtime Service Logs
+* Navigate to your runtime service detail page → **Runtime Logs** section → filter using the tag `zerops-mount-`
+### Shared Storage Logs
+* Access from the Shared Storage service detail page → **Runtime Logs** tab → browse or search for relevant information
+### System and Volume Status
+* Monitor replication status, disk usage, and performance metrics through the Master UI and Volume UI
+
+----------------------------------------
+
+# Shared Storage > How To > Use
+
+Once a Shared Storage is [connected](/shared-storage/how-to/connect) to a runtime service, Zerops will create a new folder `/mnt/[shared storage name]` in the runtime service's filesystem.
+For example, `/mnt/teststorage` for a `teststorage` Shared Storage:
+
+:::note
+The content of this folder is shared among all containers of the connected runtime service.
+If you connect multiple runtimes, the content of the folder will be shared among all containers of these services.
+:::
+## Mount Points and Multiple Volumes
+- Multiple storage volumes can be mounted to a single service (e.g., `/mnt/files1`, `/mnt/files2`, etc.)
+- Shared storage mount is only available in runtime containers, not during build and prepare runtime phases
+- All filesystem operations are automatically logged to runtime logs
+For technical details about mount behavior and filesystem capabilities, see the [Technical Details](/shared-storage/technical-details#mount-integration) page.
+## Use Cases
+Shared Storage is ideal for:
+- **Persistent filesystem-based databases**: SQLite, Prometheus DB, etc.
+- **Configuration sharing**: Deploy configurations once and share across multiple services
+ - Example: Deploy Apache Airflow configurations and DAG files once and share with all worker nodes
+- **Alternative to object storage**: For applications that require filesystem semantics rather than object storage
+- **Application data**: Store and serve images, documents, and other assets
+## Performance Considerations
+When using Shared Storage, keep in mind:
+- For write-heavy workloads, consider batching operations
+- Minimize operations with many small files for better performance
+For more detailed information about performance constraints and limitations, see the [Technical Details](/shared-storage/technical-details#performance-considerations) page.
+## Troubleshooting
+### Common Issues
+- The `df` command may show incorrect or misleading information when used with shared storage mounts. Please refer to the Zerops GUI for accurate storage metrics.
+
+----------------------------------------
+
+# Shared Storage > Overview
+
+# Shared Storage
+Zerops provides a fully managed and scaled **Shared Storage** service, which can be mounted to your runtime services. It offers:
+- Persistent file sharing between containers of the same service or different services
+- Standard filesystem operations through a POSIX-compatible interface
+- Built-in high-availability configuration
+## Documentation Sections
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+## Popular Guides
+
+----------------------------------------
+
+# Shared Storage > Tech Details
+
+Zerops Shared Storage is built on [SeaweedFS](https://github.com/seaweedfs/seaweedfs), a distributed filesystem optimized for high-volume storage with efficient retrieval.
+## Architecture
+Shared Storage consists of three main components:
+- **Master Server**: Manages metadata and coordinates volume servers
+- **Volume Servers**: Store the actual file data
+- **Filer**: Provides a POSIX-compatible interface for file operations
+An **automatic vacuum process** helps maintain optimal storage performance by reclaiming space from deleted files. This process is triggered when the size of deleted content exceeds 15% (reduced from the default 30%).
+### Mount Integration
+When connected to a runtime service:
+- Storage is mounted at `/mnt/`
+- Mount point is owned by the `zerops` user and group (no sudo required)
+- All filesystem operations are logged to runtime logs (tagged as `zerops-mount-`)
+- Mounting will overwrite any existing content in the mount directory
+- Shared storage mount is only available in runtime containers, not during build and prepare runtime phases
+## Deployment Modes
+Zerops provides Shared Storage in two deployment modes:
+### Highly Available
+Recommended for production environments where data reliability is critical.
+- **Architecture**: 2 volume servers with the master located on one of them
+- **Data Durability**: Data and filer metadata are replicated 1:1 across nodes
+- **Fault Tolerance**:
+ - If a node fails, an automatic repair process begins
+ - A new container replaces the failed one
+ - Data is automatically replicated to the new container (duration depends on data size)
+ - During master node failure, mounted directories become temporarily unavailable until the new master initializes (~30s)
+### Single Container
+Suitable for development environments or non-critical data storage.
+- **Architecture**: Master, volume, and filer server all located on a single container
+- **Data Durability**: All data is lost if the container fails
+- **Recommended For**: Development environments or temporary data storage
+:::warning
+The deployment mode is fixed after the service is created and cannot be changed later.
+:::
+## Filesystem Capabilities
+Shared Storage supports standard POSIX filesystem operations:
+- Create, read, update, and delete files and directories
+- Set permissions (with some limitations)
+- Standard file locking operations
+- Hard and symbolic links
+- Directory listing and traversal
+For a complete list of supported features, see the [SeaweedFS FUSE documentation](https://github.com/seaweedfs/seaweedfs/wiki/FUSE-Mount#supported-features).
+## Resource Constraints
+### Storage Limits
+- Maximum storage space: 60GB (can be increased via support request)
+- Maximum file size: Unlimited within the 60GB total storage constraint
+- Maximum upload size via Filer UI: 64MB
+### Memory Usage
+- Base memory consumption: ~60MB when idle
+- Peak memory usage: ~150MB under higher filesystem loads
+- Optimized for low RAM usage (may trade off some performance)
+### Performance Considerations
+- **Latency**: Higher latency compared to local storage due to network-based distributed architecture
+- **Write Performance**: For write-heavy workloads, consider batching operations
+- **Small Files**: Minimize operations with many small files for better performance
+## Auto Scaling Configuration
+Zerops scales Shared Storage services automatically by raising or lowering the hardware resources of each database container.
+Vertical auto scaling has the following default configuration:
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Shared Storage service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Shared Storage performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::note
+You can change the auto scaling parameters later.
+:::
+
+----------------------------------------
+
+# Static > Overview
+
+The Static service provides a streamlined way to serve static content through a pre-configured Nginx setup. It's designed to be simple to use while maintaining the flexibility needed for modern web applications.
+ Deploy an Analog app with static hosting in seconds. All you need is a Zerops account.
+
+## Quick Start
+Add a Static service to your project by including this in your `zerops.yaml`:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ run:
+ os: alpine
+ base: static
+```
+The Static service comes with sensible defaults that work out of the box for most SPAs and static websites. By default, without any `routing` configuration, the service will:
+1. Try to serve the exact path (`$uri`)
+2. Try with .html extension (`$uri.html`)
+3. Look for an index.html in the directory (`$uri/index.html`)
+4. Fall back to `/index.html`
+5. Return 404 if none of the above exist
+:::note Zero Configuration for SPAs
+This means for basic SPA deployments or static file hosting, you don't need to specify any redirects at all!
+:::
+## Routing Configuration
+The Static service allows you to configure URL routing and redirects through a simple YAML configuration, abstracting away the complexity of Nginx configuration.
+### Basic Structure
+Configure routing in the `run.routing` section of your `zerops.yaml`:
+```yaml title="zerops.yaml"
+run:
+ routing:
+ redirects:
+ - from: /*
+ to: /index.html
+ status: 302
+```
+### Redirect Types
+#### Relative Redirects
+Use relative redirects to route paths within your application. When both `from` and `to` are relative paths, you can omit the `status` code to create a masked redirect that shows the content of the target page while preserving the original URL:
+```yaml title="zerops.yaml"
+routing:
+ redirects:
+ # Masked redirect - URL stays the same but shows content from index.html
+ - from: /*
+ to: /index.html
+ # Standard redirect with status code
+ - from: /old-page
+ to: /new-page
+ status: 301
+ # Preserve the path when redirecting between directories
+ - from: /blog/*
+ to: /articles/
+ preservePath: true
+ status: 302
+ # Preserve both path and query parameters
+ - from: /posts/*
+ to: /blog/
+ preservePath: true
+ preserveQuery: true
+ status: 302
+```
+:::caution Important
+When using `preservePath` with wildcards, ensure the `to` path ends with a `/` to maintain proper path concatenation. For example, `/blog/*` to `/new-blog/` will correctly redirect `/blog/hello.html` to `/new-blog/hello.html`, while `/new-blog` would result in `/new-bloghello.html`.
+:::
+#### Absolute Redirects
+For redirecting between domains or to external URLs, use absolute redirects by including `http://` or `https://`. When using absolute URLs in either `from` or `to`, you must specify a `status` code:
+```yaml title="zerops.yaml"
+routing:
+ redirects:
+ # Redirect an old domain to a new one
+ - from: https://old-domain.com/*
+ to: https://new-domain.com
+ status: 301
+ preserveQuery: true # Optional: maintain query parameters
+ # Redirect with path preservation
+ - from: https://old-site.com/*
+ to: https://new-site.com/
+ status: 301
+ preservePath: true
+```
+### Advanced Routing Features
+#### Wildcard Matching
+Use `*` as a wildcard in your paths:
+- **At the end of a path**: Matches any subsequent content
+- **At the start of a domain** (after `https://`): Enables regex matching for subdomains
+Example of complex domain management:
+```yaml title="zerops.yaml"
+run:
+ routing:
+ redirects:
+ # Redirect a specific domain to an article
+ - from: https://promo-domain.com/*
+ to: https://main-site.com/special-offer
+ status: 302
+ # Redirect all subdomains to main site
+ - from: https://*.old-domain.com/*
+ to: https://main-site.com
+ status: 302
+```
+#### Matching Priority
+When multiple redirects are configured, they follow Nginx's matching priority system:
+1. Exact matches are checked first
+2. Simple path matches (without wildcards) are checked next
+3. Pattern matches (with wildcards) are checked last, in the order they appear in your configuration
+For example:
+```yaml title="zerops.yaml"
+routing:
+ redirects:
+ # Exact match for homepage - standard redirect
+ - from: /
+ to: /home
+ status: 302
+ # Simple path match - masked redirect
+ - from: /about
+ to: /about-us
+ # Pattern match with path preservation
+ - from: /blog/*
+ to: /articles/
+ preservePath: true
+ status: 302
+ # Catch-all pattern - masked redirect for SPA
+ - from: /*
+ to: /index.html
+```
+In this configuration:
+- `/` will redirect to `/home` with a 302 status
+- `/about` will show content from `/about-us` but keep the URL as `/about`
+- `/blog/post-123.html` will redirect to `/articles/post-123.html`
+- Any other path will show the content from `/index.html` while preserving the original URL (common for SPAs)
+## Prerender Integration
+The Static service includes built-in support for Prerender.io, making it easy to implement server-side rendering for search engines and social media crawlers.
+### Basic Prerender Setup
+1. Set the `PRERENDER_TOKEN` secret variable with your Prerender.io token
+2. The service automatically configures necessary rewrites based on user agents
+### Custom Prerender Host
+If you're using a custom Prerender host, add it to environment variables in `zerops.yaml`:
+```yaml
+run:
+ envVariables:
+ - PRERENDER_HOST=your.prerender.host
+```
+:::note Default
+The default host is `service.prerender.io` if not specified.
+:::
+## Advanced Configuration
+### Switching to Full Nginx
+If you need more control over your Nginx configuration:
+1. Go to your Static service overview in the UI
+2. Click the three vertical dots in the left panel
+3. Select **Need to switch to full Nginx service?**
+4. Copy the generated Nginx configuration
+5. Use this configuration as a starting point for a full Nginx service
+:::tip
+This allows you to graduate to a more customizable setup while maintaining your existing routing logic.
+:::
+## Best Practices
+1. **SPA Configuration**
+ ```yaml title="zerops.yaml"
+ routing:
+ redirects:
+ - from: /*
+ to: /index.html
+ status: 302
+ ```
+ Use this configuration for Single Page Applications to ensure all routes are handled by your application.
+2. **Domain Migration**
+ ```yaml title="zerops.yaml"
+ routing:
+ redirects:
+ - from: https://old-domain.com/*
+ to: https://new-domain.com
+ status: 301
+ ```
+ Use permanent (301) redirects when permanently moving content to maintain SEO value.
+3. **Complex Redirects**
+ Order your redirects from most specific to most general to ensure proper routing:
+ ```yaml title="zerops.yaml"
+ routing:
+ redirects:
+ - from: /specific-path/*
+ to: /specific-landing
+ status: 302
+ - from: /*
+ to: /index.html
+ status: 302
+ ```
+## Frontend Framework Integration
+The Static service seamlessly integrates with modern frontend frameworks. It can serve built static files from any framework while maintaining the option to add custom routing and Prerender.io integration if needed.
+### Example: Analog App Deployment
+Here's a simple configuration for deploying an [Analog application](https://github.com/zeropsio/recipe-analog-static):
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ base: nodejs@20
+ buildCommands:
+ - pnpm i
+ - pnpm build
+ deployFiles:
+ - dist/analog/public/~
+ run:
+ base: static
+```
+This configuration:
+1. Uses Node.js 20 for building the application
+2. Installs dependencies with pnpm
+3. Builds the application
+4. Deploys the resulting static files to the Static service
+You can enhance this basic setup by adding:
+- Custom redirects for URL management
+- Prerender.io integration for SEO
+- Additional routing rules as needed
+## Common Configurations
+### Multiple Domain Management
+```yaml title="zerops.yaml"
+run:
+ routing:
+ redirects:
+ # Product-specific domain
+ - from: https://product-promo.com/*
+ to: https://main-site.com/products
+ status: 302
+ # Campaign domain
+ - from: https://special-offer.com/*
+ to: https://main-site.com/campaign
+ status: 302
+ # Legacy domains and subdomains
+ - from: https://*.legacy-domain.com/*
+ to: https://main-site.com
+ status: 302
+```
+### Development Setup
+```yaml title="zerops.yaml"
+run:
+ routing:
+ redirects:
+ # API requests
+ - from: /api/*
+ to: https://api.your-domain.com
+ status: 302
+ # SPA fallback
+ - from: /*
+ to: /index.html
+ status: 302
+```
+
+----------------------------------------
+
+# Typesense > Overview
+
+Zerops provides a fully managed [Typesense search engine](https://typesense.org/) service that combines developer productivity with enterprise-grade reliability. The platform handles infrastructure complexity through automated deployment, scaling, and maintenance while providing developers full access to Typesense's native capabilities.
+## Supported Versions
+Currently supported Typesense version:
+Import configuration version:
+## Service Configuration
+Our Typesense implementation comes with carefully tuned defaults that diverge from the [standard Typesense configuration](https://typesense.org/docs/27.1/api/server-configuration.html#using-command-line-arguments) in the following ways:
+```yaml
+thread-pool-size: 16
+num-collections-parallel-load: 8
+```
+These defaults are optimized for most common use cases and managed by the platform. If you need to adjust these settings, please contact us through our [support channels](#support).
+### Data Persistence
+Typesense data is automatically persisted to disk at `/var/lib/typesense`.
+This ensures that data remains intact during service restarts (Typesense automatically reloads the persisted data into memory upon startup).
+This persistence mechanism works in both HA and non-HA deployment modes, though with different reliability guarantees as detailed below.
+### Deployment Modes
+:::warning
+The choice between HA and non-HA mode must be made during service creation and cannot be changed later. Make sure to carefully consider your requirements before deploying.
+:::
+#### Non-HA Mode
+- Suitable for development and testing
+- Data persistence not guaranteed during node failures
+- Lower resource requirements
+#### HA Mode
+- Implements Typesense's native [**Raft consensus**](https://typesense.org/docs/guide/high-availability.html) mechanism for data replication
+- Deploys as a **3-node cluster by default** for optimal reliability
+ - Scaling configuration of 3-5 or 3-7 nodes for higher workloads is possible upon request (contact [support](#support) to configure custom node ranges)
+- Includes **built-in data synchronization** across all nodes
+- Features **automatic leader election** to maintain cluster availability
+ - Recovery typically takes up to 1 minute during node failures or leader transitions
+ - During these periods, requests may temporarily receive `503 Not Ready or Lagging` or `500 Could not find a leader` responses
+ - These states automatically resolve once consensus is reestablished
+### API Key Management
+The master API key is automatically generated and managed by the platform. You can access it through:
+- The service access details in the Zerops GUI
+- The `apiKey` environment variable in your service configuration
+:::warning
+Currently, as a security-focused design decision, the master API key cannot be modified after generation.
+:::
+### CORS Configuration
+Your Typesense instance comes with CORS enabled by default, ensuring seamless integration with frontend applications. Browser-based clients can directly access the instance by providing the `X-Typesense-Api-Key` header, maintaining security while enabling straightforward client-side implementation.
+## Network Architecture & Access Patterns
+### Access Methods
+#### HTTPS Access
+When using HTTPS access (either through Zerops subdomain or custom domain), traffic is distributed across nodes via our integrated Nginx proxy layer. This provides a single access point that handles load balancing automatically.
+For enabling HTTPS access:
+1. Configure through the [Zerops access documentation](/features/access)
+2. Or use `enableSubdomainAccess: true` when [importing](/references/import#service-configuration) a Typesense service
+#### Direct Node Access
+Allows to access individual nodes using internal DNS:
+1. **Via [Zerops VPN](/references/vpn)**
+2. **Internal Project Access** - services within the same project can reach nodes directly
+Node addressing patterns:
+##### Standard format
+**Format:**```node{n}.db.{hostname}.zerops```
+- e.g. `node1.db.typesenseha.zerops`, `node2.db.typesenseha.zerops`
+##### Stable DNS records
+**Format:**```node-stable-{n}.db.{hostname}.zerops```
+- **maintain consistent IP mapping** until node retirement (scaling down or failure events)
+- e.g. `node-stable-1.db.typesenseha.zerops`, `node-stable-2.db.typesenseha.zerops`
+## Quick Start Example
+Here's a simple example of using Typesense with the JavaScript client:
+```javascript
+const client = new TypesenseClient({
+ nodes: [{
+ host: 'your-service.zerops.dev', // Your Zerops subdomain
+ port: '443',
+ protocol: 'https'
+ }],
+ apiKey: process.env.TYPESENSE_API_KEY,
+ connectionTimeoutSeconds: 2
+})
+// Create a collection
+await client.collections().create({
+ name: 'companies',
+ fields: [
+ { name: 'company_name', type: 'string' },
+ { name: 'num_employees', type: 'int32' },
+ { name: 'country', type: 'string', facet: true }
+ ],
+ default_sorting_field: 'num_employees'
+})
+// Example search query
+const searchResults = await client.collections('companies')
+ .documents()
+ .search({
+ q: 'tech',
+ query_by: 'company_name',
+ filter_by: 'country:=USA',
+ sort_by: 'num_employees:desc'
+ })
+```
+## Best Practices
+#### API Key Security
+- Never expose the master API key in client-side code
+- Generate scoped search-only API keys for frontend applications
+- Rotate API keys periodically through your service configuration
+#### High Availability
+- Implement retry logic in clients for handling temporary unavailability
+- Use stable DNS records for direct node access when needed
+#### Performance Optimization
+- Utilize batch operations for bulk updates
+- Configure appropriate timeout values based on your use case
+- Consider data volume when designing collection schemas
+## Support
+For advanced configurations or custom requirements:
+- Join our [Discord community](https://discord.gg/zeropsio)
+- Contact support via [email](mailto:support@zerops.io)
+
+----------------------------------------
+
+# Valkey > Overview
+
+Valkey is a powerful, open-source alternative to Redis, offering full compatibility with Redis clients while providing an independent development path focused on community-driven innovation. Deploy and manage Valkey on Zerops' fully managed infrastructure to get instant access to high-performance in-memory data storage.
+:::tip
+Valkey is our recommended Redis alternative as KeyDB's development has slowed significantly in recent times.
+:::
+## Supported Versions
+Currently supported Valkey versions:
+Import configuration version:
+## Service Configuration
+Zerops offers Valkey in two deployment configurations to meet different availability requirements.
+## Deployment Options
+### Non-HA Setup
+- Single node deployment on port `6379` (non-TLS) and `6380` (TLS)
+- No backup mechanism beyond Zerops infrastructure reliability
+- Data persists unless the hardware node fails
+- Suitable for development or non-critical workloads
+### HA (High Availability) Setup
+Our HA implementation uses a unique approach to ensure high availability while maintaining compatibility with all Redis clients:
+- 3-node configuration (1 master + 2 replicas)
+- Access ports:
+ - `6379` - read/write operations (non-TLS, routed to master)
+ - `6380` - read/write operations over TLS (routed to master)
+ - `7000` - read-only operations (non-TLS)
+ - `7001` - read-only operations over TLS
+- Implementation details:
+ - All nodes are configured identically and listen on standard ports
+ - First node in the cluster is designated as the master
+ - On replica nodes, ports `6379`/`6380` traffic is forwarded to the master
+ - Ports `7000`/`7001` are mapped locally to each node for direct replica access
+ - When a master fails, a replica is promoted and routing is updated automatically
+ - DNS entries are updated for seamless client connection
+ - This implementation provides traffic forwarding to master (not natively supported by Valkey)
+:::note
+Be aware that replica data may lag slightly behind the master due to asynchronous replication.
+:::
+## Learn More
+- [Official Valkey Documentation](https://valkey.io/docs) - Comprehensive guide to Valkey features
+## Support
+For advanced configurations or custom requirements:
+- Join our [Discord community](https://discord.gg/zeropsio)
+- Contact support via [email](mailto:support@zerops.io)
+
+----------------------------------------
+
+# Zerops Yaml > Base List
+
+This is a list of all currently supported versions of technologies that can be used for build.base and run.base sections in `zerops.yaml`.
+:::note
+Versions listed on the same line are aliases of the same underlying version.
+:::
+## Runtime services
+
+ Service Type
+ Supported OS
+ Versions
+
+ Build / Runtime
+
+ Bun
+ `ubuntu` / `alpine`
+
+ Deno
+ `ubuntu`
+
+ .NET
+ `ubuntu` / `alpine`
+
+ Elixir
+ `ubuntu` / `alpine`
+
+ Gleam
+ `ubuntu`
+
+ Go
+ `ubuntu` / `alpine`
+
+ Java
+ `ubuntu` / `alpine`
+
+ Node.js
+ `ubuntu` / `alpine`
+
+ Python
+ `ubuntu` / `alpine`
+
+ Rust
+ `ubuntu` / `alpine`
+
+
+
+ Build
+ Runtime
+
+ PHP + Apache
+ `ubuntu` / `alpine`
+
+ PHP + nginx
+ `ubuntu` / `alpine`
+
+## Static services
+
+ Service Type
+ Supported OS
+ Versions
+
+ Build
+ Runtime
+
+ nginx
+ `ubuntu`/`alpine`
+ -
+
+ static
+ `ubuntu`/`alpine`
+ -
+
+## Containers and virtual machines
+
+ Service Type
+ Supported OS
+ Versions
+
+ Build / Runtime
+
+ Alpine
+ `alpine`
+
+ Ubuntu
+ `ubuntu`
+
+
+----------------------------------------
+
+# Zerops Yaml > Cron
+
+Cron jobs are scheduled commands that execute automatically inside a service's containers based on defined timing rules.
+In Zerops, these jobs are configured in the `run` section of `zerops.yaml` file under the `crontab` key.
+## Parameters
+### command
+*string, REQUIRED*
+The shell command to execute at the scheduled time. This can be any valid command.
+### timing
+*string, REQUIRED*
+The schedule for when the task should run, specified in standard cron format using five space-separated fields:
+ - Minute (0–59)
+ - Hour (0–23)
+ - Day of the month (1–31)
+ - Month (1–12)
+ - Day of the week (0–7; both 0 and 7 represent Sunday)
+#### Examples
+ - `"0 5 * * *"` – Runs daily at 5:00 AM.
+ - `"*/10 * * * *"` – Runs every 10 minutes.
+### allContainers
+*boolean, REQUIRED*
+**Options:**
+- `true` – Command runs on all containers.
+- `false` – Command runs on only one container.
+### workingDir
+*string, REQUIRED*
+Specifies the directory where the command will be executed. If not set, it defaults to `/var/www`.
+## Example Configurations
+Here’s a basic example of how to set up a cron job in your service's `zerops.yaml`:
+```yaml
+run:
+ crontab:
+ - command: "date >> /var/log/cron.log"
+ timing: "0 * * * *"
+```
+This configuration logs the current date to `/var/log/cron.log` every hour.
+### Running on Multiple Containers
+By default, cron jobs run on a single container, even if multiple containers exist for the service. To execute a command across all containers, you can use the `allContainers` parameter:
+```yaml
+run:
+ crontab:
+ - command: "rm -rf /tmp/*"
+ timing: "0 0 * * *"
+ allContainers: true
+```
+This example removes temporary files from all containers every day at midnight.
+### Custom Working Directory
+You can also specify a custom working directory for your commands using the `workingDir` parameter:
+```yaml
+run:
+ crontab:
+ - command: "php artisan schedule:run"
+ timing: "* * * * *"
+ workingDir: /var/www/html
+```
+In this case, the command runs every minute in the `/var/www/html` directory.
+### Multiple Cronjobs
+It is possible to define multiple cron jobs as a YAML object list under the `crontab` key.
+```yaml
+run:
+ crontab:
+ - command: ...
+ ...
+ - command: ...
+ ...
+```
+
+----------------------------------------
+
+# Zerops Yaml > Specification
+
+export const languages = [
+ { name: "Node.js", link: "/nodejs/how-to/build-pipeline" },
+ { name: "PHP", link: "/php/how-to/build-pipeline" },
+ { name: "Python", link: "/python/how-to/build-pipeline" },
+ { name: "Go", link: "/go/how-to/build-pipeline" },
+ { name: ".NET", link: "/dotnet/how-to/build-pipeline" },
+ { name: "Rust", link: "/rust/how-to/build-pipeline" },
+ { name: "Java", link: "/java/how-to/build-pipeline" },
+ { name: "Nginx", link: "/nginx/how-to/build-pipeline" }
+]
+The `zerops.yaml` file is crucial for defining how Zerops should [build and deploy](/features/pipeline) your application.
+Add the `zerops.yaml` file to the **root of your repository** and customize it to suit your application's needs.
+---
+## Basic Structure
+```yaml title="zerops.yaml"
+zerops:
+ - setup:
+ build: ...
+ run: ...
+```
+- The top-level element is always `zerops`.
+- `setup` contains the **hostname** of your service (must exist in Zerops).
+- Multiple services can be defined in a single `zerops.yaml` (useful for monorepos):
+```yaml
+zerops:
+ - setup: app
+ build: ...
+ run: ...
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration requires `build` and `run` sections. An optional `deploy` section can be added for readiness checks.
+## Service Inheritance
+### extends
+The `extends` key allows you to inherit configuration from another service defined in the same `zerops.yaml` file. This is useful for creating environment-specific configurations while maintaining a common base.
+```yaml
+zerops:
+ - setup: base
+ build:
+ buildCommands:
+ - echo "hello"
+ deployFiles: ./
+ run:
+ start: server run
+ - setup: prod
+ extends: base
+ run:
+ crontab:
+ - command: xyz
+ allContainers: false
+ timing: "* * * * *"
+ - setup: dev
+ extends: base
+ run:
+ crontab:
+ - command: different command
+ allContainers: false
+ timing: "* * * * *"
+```
+When using `extends`:
+- The `extends` value must refer to another service's `setup` value in the same file
+- The child service inherits all configuration from the base service
+- Configuration is merged at the section level (`build`, `run`, `deploy`)
+- You can override specific sections by redefining them
+:::tip
+Create a base service with common configuration and extend it for environment-specific services to keep your `zerops.yaml` file DRY (Don't Repeat Yourself).
+:::
+## Build Configuration
+### base
+Sets the base technology for the build environment. [See available options](/zerops-yaml/base-list).
+```yaml
+build:
+ base: nodejs@latest
+```
+You can specify multiple technologies:
+```yaml
+build:
+ base:
+ - nodejs@latest
+ prepareCommands:
+ - zsc add python@3.9
+```
+### os
+Sets the operating system for the build environment. Options:
+- `alpine` (default)
+- `ubuntu`
+Current versions:
+- {data.alpine.default}
+- {data.ubuntu.default}
+```yaml
+build:
+ os: ubuntu
+```
+### prepareCommands
+Customizes the build environment by installing additional dependencies or tools.
+```yaml
+build:
+ prepareCommands:
+ - apt-get update
+ - apt-get install -y some-package
+```
+### buildCommands
+Defines the commands to build your application.
+```yaml
+build:
+ buildCommands:
+ - npm install
+ - npm run build
+```
+#### Running commands in a single shell instance:
+```yaml
+buildCommands:
+ - |
+ npm install
+ npm run build
+```
+### deployFiles
+Specifies which files or folders to deploy after a successful build.
+```yaml
+build:
+ deployFiles:
+ - dist
+ - package.json
+ - node_modules
+```
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Using wildcards:
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`.
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+Defines which files or folders to cache for subsequent builds.
+```yaml
+build:
+ cache: node_modules
+```
+For more information, see our detailed [guide on build cache](/features/build-cache), complete with extensive examples.
+### envVariables
+Sets environment variables for the build environment.
+```yaml
+build:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+:::info
+The `yamlPreprocessor` option in your project & service import YAML allows you to generate random secret values, passwords, and public/private key pairs. For more information, see the [yamlPreprocessor](/references/import-yaml/pre-processor) page.
+:::
+## Runtime Configuration
+### base
+Sets the base technology for the runtime environment. If not specified, the current version is maintained.
+```yaml
+run:
+ base: nodejs@latest
+```
+### os
+Sets the operating system for the runtime environment. Options and versions are the same as for the build environment.
+### ports
+Specifies the internal ports on which your application will listen.
+```yaml
+run:
+ ports:
+ - port: 8080
+ protocol: TCP # Optional
+ httpSupport: true # Optional
+ - port: 8081
+ ...
+```
+Available parameters:
+#### port
+Defines the port number on which your application listens. Must be between *10* and *65435*, as ports outside this range are reserved for internal Zerops systems.
+#### protocol
+Specifies the network protocol to use:
+- Allowed values: `TCP` *(default)* or `UDP`
+#### httpSupport
+Indicates whether the port is running a web server:
+- Default value: `true`
+- Set to `false` if a web server isn't running on the port
+- Only available with TCP protocol
+- Used by Zerops for [public access](/features/access) configuration
+### prepareCommands
+Customizes the runtime environment by installing additional dependencies or tools.
+### addToRunPrepare
+Defines files or folders to be copied from the build container to the prepare runtime container.
+### initCommands
+Defines commands to run each time a new runtime container starts or restarts.
+```yaml
+run:
+ initCommands:
+ - rm -rf ./cache
+```
+### start
+Defines the start command for your application.
+```yaml
+run:
+ start: npm start
+```
+### startCommands
+Defines start commands
+Unlike `start`, you can define multiple commands that starts their own processes.
+```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
+```
+See [start-commands-example](https://github.com/zeropsio/start-commands-example)
+### documentRoot
+Customizes the root folder for publicly accessible web server content (available only for webserver runtimes).
+### siteConfigPath
+Sets the custom webserver configuration (available only for webserver runtimes).
+### envVariables
+Defines environment variables for the runtime environment.
+```yaml
+ run:
+ base: nodejs@20
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+### healthCheck
+Defines a health check for your application.
+```yaml
+run:
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+### crontab
+ Defines scheduled commands to run as cron jobs within a service.
+ ```yaml
+ run:
+ crontab:
+ - command: "date >> /var/log/cron.log"
+ timing: "0 * * * *"
+ ```
+Setup cron jobs. See [examples](/references/cron).
+## Deploy Configuration
+### readinessCheck
+Defines a readiness check for your application. (See [readiness checks](/features/pipeline#readiness-checks))
+```yaml
+deploy:
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ host: 127.0.0.1
+ scheme: https
+ # Or use commands
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+:::note
+For more detailed information on specific configurations, refer to the runtime-specific guides linked at the beginning of this document.
+:::
+---
+
+----------------------------------------
+
diff --git a/apps/docs/static/llms-small.txt b/apps/docs/static/llms-small.txt
new file mode 100644
index 000000000..3b2a1bde1
--- /dev/null
+++ b/apps/docs/static/llms-small.txt
@@ -0,0 +1,28309 @@
+----------------------------------------
+
+# Bun > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing Bun application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](bun/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple Bun web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Bun > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](bun/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](bun/how-to/build-pipeline#ports) `3000`, simply use `http://app:3000`
+:::info
+Do not use `https://` when communicating with Bun from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use Bun environment variables
+Zerops creates default environment variables for each Bun service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](bun/how-to/env-variables#generated-env-variables) of the Bun service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](bun/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your Bun application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access Bun application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](bun/how-to/env-variables) are available when connected through VPN. To connect to your Bun application in Zerops set the hostname and [internal port](bun/how-to/build-pipeline#ports) e.g. http://app:3000
+:::info
+Do not use `https://` when communicating with Bun over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your Bun service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your Bun service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](bun/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Bun > How To > Build Pipeline
+
+Zerops provides a customizable build and runtime environment for your Bun application.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: bun@latest
+ # OPTIONAL. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customise the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # REQUIRED. Build your application
+ buildCommands:
+ - bun i
+ - bun run build
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - dist
+ - package.json
+ - node_modules
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ cache: node_modules
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: bun@latest
+ # OPTIONAL. Sets the internal port(s) your app listens on:
+ ports:
+ # port number
+ - port: 3000
+ # OPTIONAL. Customise the runtime Bun environment by installing additional
+ # dependencies to the base Bun runtime environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Bun application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # REQUIRED. Your Bun application start command
+ start: bun start
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your Bun application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Build pipeline configuration
+### base
+_REQUIRED._ Sets the base technology for the build environment.
+Following options are available for Bun builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: bun@latest
+ ...
+```
+ The base build environment contains {data.alpine.default}, the selected
+ major version of Bun,
+ Zerops command line tool, `npm`,
+ `yarn`, `git` and `npx` tools.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base:
+ - bun@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
+To customise your build environment use the [prepareCommands](bun/how-to/build-pipeline#preparecommands) attribute.
+:::note
+Modifying the base technology will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### os
+_OPTIONAL._ Sets the operating system for the build environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+:::note
+Changing the OS setting will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache behavior.
+:::
+### prepareCommands
+_OPTIONAL._ Customises the build environment by installing additional dependencies or tools to the base build environment.
+The base build environment contains:
+- {data.alpine.default}
+- selected version of Bun defined in the [base](bun/how-to/build-pipeline#base) attribute
+- [Zerops command line tool](/references/cli)
+- `npm`, `yarn`, `git` and `npx` tools
+To install additional packages or tools add one or more prepare commands:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: bun@latest
+ # OPTIONAL. Customise the build environment by installing additional packages
+ # or tools to the base build environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first build is triggered, Zerops will
+1. create a build container
+2. download your application code from your repository
+3. run the prepare commands in the defined order
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::note
+These commands are skipped when using cached environment. Modifying `prepareCommands` will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache invalidation.
+:::
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](bun/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all prepare commands are finished, your custom build environment is ready for the build phase.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### buildCommands
+_REQUIRED._ Defines build commands.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: bun@latest
+ # REQUIRED. Build your application
+ buildCommands:
+ - bun i
+ - bun run build
+ ...
+```
+At least one command is required. Zerops triggers each command in the defined order in a dedicated build container.
+Before the build commands are triggered the build container contains:
+1. base environment defined by the [base](bun/how-to/build-pipeline#base) attribute
+2. optional customisation of the base environment defined in the [prepareCommands](bun/how-to/build-pipeline#preparecommands) attribute
+3. your application code
+#### Run build commands as a single shell instance
+Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it.
+```yaml
+buildCommands:
+ - |
+ bun i
+ bun run build
+```
+#### Run build commands as a separate shell instances
+When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command.
+```yaml
+buildCommands:
+ - bun i
+ - bun run build
+```
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](bun/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the --verbose option.
+```yaml
+buildCommands:
+ - bun i --verbose
+ - bun run build
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the deploy phase.
+### deployFiles
+_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
+```yaml
+# REQUIRED. Select which files / folders to deploy after
+# the build has successfully finished
+deployFiles:
+ - dist
+ - package.json
+ - node_modules
+```
+Determines files or folders produced by your build, which should be deployed to your runtime service containers.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Examples
+Deploys a folder, and a file from the project root directory:
+```yaml
+deployFiles:
+ - dist
+ - package.json
+```
+Deploys the whole content of the build container:
+```yaml
+deployFiles: .
+```
+Deploys a folder, and a file in a defined path:
+```yaml
+deployFiles:
+ - ./path/to/file.txt
+ - ./path/to/dir/
+```
+#### How to use a wildcard in the path
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+Deploys all folders that are located in any path that begins with `/path/to/`
+```yaml
+deployFiles: ./path/to/~/
+```
+Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/
+```
+:::note Example
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+:::
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+_OPTIONAL._ Defines which files or folders will be cached for the next build.
+```yaml
+# OPTIONAL. Which files / folders you want to cache for the next build.
+# Next builds will be faster when the cache is used.
+cache: file.txt
+```
+The cache attribute helps optimize build times by preserving specified files between builds.
+The cache attribute supports the [~ wildcard character](#how-to-use-a-wildcard-in-the-path).
+Learn more about the [build cache system](/features/build-cache) in Zerops.
+### envVariables
+_OPTIONAL._ Defines the environment variables for the build environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ base: bun@latest
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](bun/how-to/env-variables) in Zerops.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current Bun version for your runtime.
+Following options are available for Bun runtimes:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: bun@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: bun@latest
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the
+ selected major version of Bun, Zerops command line tool, `npm`, `yarn`, `git` and `npx` tools.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: bun@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base:
+ - bun@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customise your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a Bun service with hostname = "app" and port = 3000 from another service of the same project, simply use `app:3000`. Read more about [how to access a Bun service](bun/how-to/access).
+Each port has following attributes:
+| parameter | description |
+| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| port | Defines the port number. You can set any port number between _10_ and _65435_. Ports outside this interval are reserved for internal Zerops systems. |
+| protocol | **Optional.** Defines the protocol. Allowed values are `TCP` or `UDP`. Default value is `TCP`. |
+| httpSupport | **Optional.** `httpSupport = true` is the default setting for TCP protocol. Set `httpSupport = false` if a web server isn't running on the port. Zerops uses this information for the configuration of [public access](/features/access). `httpSupport = true` is available only in combination with the TCP protocol. |
+| httpSupport | **Optional.** `httpSupport = true` is the default setting for TCP protocol. Set `httpSupport = false` if a web server isn't running on the port. Zerops uses this information for the configuration of [public access](/features/access). `httpSupport = true` is available only in combination with the TCP protocol. |
+### prepareCommands
+_OPTIONAL._ Customises the Bun runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base Bun environment contains {data.alpine.default} the selected
+ major version of Bun, Zerops command line tool and `npm`, `yarn`, `git` and `npx` tools. To install
+ additional packages or tools add one or more prepare commands:
+```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 Bun runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](bun/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](bun/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the custom runtime cache go to `yyy`
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.default}, the selected major version of Bun, Zerops command line tool and `npm`,
+ `yarn`, `git` and `npx` tools.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare: ./runtime-config.yaml
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base Bun runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Bun application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your Bun application is started via the [start command](bun/how-to/build-pipeline#start).
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](bun/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](bun/how-to/build-pipeline#preparecommands1) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](bun/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](bun/how-to/env-variables) in Zerops.
+### start
+_REQUIRED._ Defines the start command for your Bun application.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Bun application start command
+ start: bun start
+```
+We recommend starting your Bun application using `bun start`.
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Bun application start command
+ start: bun start
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+| Parameter | Description |
+| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **command** | Defines a local command to be run.
+The command has access to the same [environment variables](bun/how-to/create#set-secret-environment-variables) as your Bun application.
+A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below. |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Bun application start command
+ start: bun start
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+### crontab
+_OPTIONAL._ Defines cron jobs.
+Setup cron jobs in the following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ crontab:
+ # REQUIRED. Sets the command to execute:
+ - command: ""
+ # REQUIRED. Sets the interval time to execute:
+ timing: "0 * * * *"
+```
+Read more about setting up [cron](/references/cron) in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](bun/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](bun/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+| Parameter | Description |
+| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **command** | Defines a local command to be run.
+The command has access to the same [environment variables](bun/how-to/create#set-secret-environment-variables) as your Bun application.
+A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below. |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](bun/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Bun > How To > Build Process
+
+
+## Description of the build process
+Zerops starts a temporary build container and performs following actions:
+1. Installs the build environment:
+ - Sets up base system and Go runtime
+ - Restores cached files if available (based on `build.cache` configuration)
+ - Validates cache against current `build.os`, `build.base`, and `build.prepareCommands`
+2. Downloads your application source code from [GitHub ↗](https://www.github.com), [GitLab ↗](https://www.gitlab.com) or via [Zerops CLI](/references/cli)
+3. Optionally [customizes the build environment](#customize-bun-build-environment)
+4. Runs the build commands
+5. Uploads the application artefact to the internal Zerops storage
+6. Preserves specified files for future builds (based on `build.cache` configuration)
+7. Optionally [customizes the runtime environment](/bun/how-to/customize-runtime)
+8. [Deploys your application](/bun/how-to/deploy-process)
+The build container is automatically deleted after the build has finished or failed.
+## Cancel running build
+When you know that the running build is not correct and you want to cancel it, you can do it in Zerops GUI. Go to the service detail, open the list of running processes and click on the **Open pipeline detail** button. Then click on the **Cancel build** button.
+
+:::caution
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+:::
+## Customize Bun build environment
+The default Bun build environment contains:
+- {data.alpine.default}
+- selected version of Bun defined in `zerops.yaml` [build.base](bun/how-to/build-pipeline#base) parameter
+- [zCLI](/references/cli), Zerops command line tool
+- `npm`, `yarn`, `git` and `npx` tools
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/bun/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](bun/how-to/build-pipeline#preparecommands) commands to your `zerops.yaml`.
+:::info
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::
+## Bun build hardware resources
+Build of your Bun application is run in a separate build container with following resource configuration:
+| HW resource | Minimum | Maximum |
+| ------------- | ------- | ------- |
+| **CPU cores** | 6 | 20 |
+| **RAM** | 8 GB | 8 GB |
+| **Disk** | 1 GB | 100 GB |
+| **Disk** | 1 GB | 100 GB |
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+## Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops will terminate the build pipeline and delete the build container.
+## Troubleshooting build-related problems
+### Failure of a build prepare command
+If any [prepare command](bun/how-to/build-pipeline#preparecommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](bun/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom build environment is ready for the build phase.
+### Invalidate the build cache
+If you encounter unexpected build behavior or dependency issues, the problem might be related to [cached build data](/features/build-cache). While Zerops maintains the build cache to speed up deployments, sometimes you may need to start fresh.
+To invalidate the build cache:
+1. Go to your service detail in Zerops GUI
+2. Choose **Pipelines & CI/CD Settings** from the left menu
+3. Click on the **Invalidate build cache** button
+This will force Zerops to run the next build clean, including all prepare commands, which can help resolve cache-related issues. After invalidation, your next build will also create a fresh cache.
+### Failure of a build command
+If any [build command](bun/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](bun/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `--verbose` option.
+```yaml
+buildCommands:
+ - npm i --verbose
+ - npm run build
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the [deploy](bun/how-to/deploy-process) phase.
+
+----------------------------------------
+
+# Bun > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart Bun service in Zerops GUI
+To stop the Bun service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped Bun service choose the **Start** item from the same menu.
+To restart the Bun service choose the **Restart** item from the same menu.
+## Stop and start Bun using zCLI
+zCLI is the Zerops command-line tool. To stop and start the Bun service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Bun > How To > Create
+
+Zerops provides a powerful Bun runtime service with extensive build support. The Bun runtime is highly scalable and customizable to suit your development and production needs. With just a few clicks or commands, you can have a production-ready Bun environment up and running in no time.
+## Create a Bun service using Zerops GUI
+First, set up a project in the Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu under the **Services** section. From there, you can add a new Bun service:
+### Choose a Bun version
+Zerops supports the following Bun versions:
+:::info
+You can easily [upgrade](bun/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app", "cache", "gui", etc. Duplicate services with the same name within the same project are not allowed.
+#### Limitations:
+- Maximum 25 characters
+- Must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created and cannot be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as passwords, tokens, salts, certificates, etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting secret environment variables is optional. You can always set them later in the Zerops GUI.
+Read more about the [different types of environment variables](bun/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Configure auto scaling
+Zerops automatically scales Bun services both vertically and horizontally. Vertical scaling adjusts the hardware resources (CPU, RAM, and disk) of a Bun container, while horizontal scaling adds or removes entire containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. The power your application receives depends on the other applications running on the same CPU core. In the best-case scenario, your application gets 10/10 of the CPU core power, and 1/10 in the worst-case scenario.
+**Dedicated**
+The CPU core is dedicated exclusively to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+You can choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has the following default configuration:
+Bun services always start with the minimal resources.
+In most cases, the default parameters will work without issues. If you need to limit the cost of the Bun service, you can lower the maximum resources. Zerops will never scale above the selected maximums.
+If you experience insufficient Bun performance or capacity, you can increase the minimum resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine-tune](bun/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application's needs.
+:::
+:::info
+You can change the vertical auto scaling parameters at any time.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but is already consuming the maximum resources defined for vertical auto scaling, Zerops will add a new container to your Bun service. When your Bun service doesn't need as much power and all containers are vertically scaled down such that their CPU allocation is near the minimum resources, Zerops will gradually remove entire containers.
+Horizontal auto scaling has the following default configuration:
+
+ Minimum containers
+
+ 1
+
+ Maximum containers
+
+ 6
+
+Bun services always start with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](bun/how-to/scaling) about Bun auto scaling in Zerops.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will automatically start a new container and deploy your application. However, the application will be unavailable for a short period. This mode is recommended for non-critical applications or development environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers based on your application's load. An application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed down to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents temporary outages in case any of the Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically, and the broken container will be deleted.
+:::caution
+Make sure your application is designed to run in multiple containers.
+:::
+## Create a Bun service using zCLI
+zCLI is the Zerops command-line tool. To create a new Bun service via the command line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](bun/how-to/create#create-a-project-description-file)
+3. [Create a project with a Bun and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a YAML format to describe the project infrastructure.
+#### Basic example:
+Create a directory called `my-project`. Inside the `my-project` directory, create a `description.yaml` file with the following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in Bun@{version} format
+ type: bun@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one Bun version 20 service with default [auto scaling](bun/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](bun/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Bun and PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in Bun@{version} format
+ type: bun@latest
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+ - # second service hostname
+ hostname: db
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain a Bun service and a [PostgreSQL](/postgresql/overview) service.
+Bun service with "app" hostname, the internal port(s) the service listens on will be defined later in the [zerops.yaml](bun/how-to/build-pipeline#ports). Bun service will run on version 20 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+| Parameter | Description | Limitations |
+| --------------- | ------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
+| **name** | The name of the new project. Duplicates are allowed. | |
+| **description** | **Optional.** Description of the new project. | Maximum 255 characters. |
+| **tags** | **Optional.** One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects. |
+| **tags** | **Optional.** One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects. |
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains Bun and PostgreSQL services but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [Bun service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+ All verticalAutoscaling attributes are optional. Not specified attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers
+ for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value
+ map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add Bun service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in Bun@{version} format
+ type: bun@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Bun service version 20 with default [auto scaling](bun/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Bun > How To > Customize Runtime
+
+
+The default Bun runtime environment contains:
+- {data.alpine.default}
+- selected version of Bun selected when the runtime service was created.
+-
+ `zCLI`
+
+ , Zerops command line tool
+- `npm`, `yarn`, `git` and `npx` tools
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/bun/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more `run.prepareCommands` commands to your `zerops.yaml`.
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](bun/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `run.prepareCommands` commands in the defined order
+### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](bun/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+The prepare runtime container is automatically deleted after the prepare runtime phase has finished or failed.
+### Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the `build.addToRunPrepare` and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the custom runtime cache go to `yyy`
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+
+----------------------------------------
+
+# Bun > How To > Delete
+
+## Delete Bun service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete Bun using zCLI
+zCLI is the Zerops command-line tool. To delete the Bun service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Bun > How To > Deploy Process
+
+
+## Application artefact
+When the [build phase](bun/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](bun/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](bun/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](bun/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](bun/how-to/build-pipeline#initcommands)
+4. Starts your application using the [start command](bun/how-to/build-pipeline#start)
+5. Optionally waits until the [readiness check](bun/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](bun/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customise the runtime environment](bun/how-to/build-pipeline#preparecommands-1).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The Bun process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready to handle requests right after it is started via the [start command](bun/how-to/build-pipeline#start), configure a [readiness check](bun/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your Bun service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](bun/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Bun > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+| environment | type | defined in |
+| ----------- | ------ | --------------------------------------------------------------------------------- |
+| build | basic | [zerops.yaml](bun/how-to/build-pipeline#envvariables) |
+| runtime | basic | [zerops.yaml](bun/how-to/build-pipeline#envvariables-1) |
+| runtime | secret | [Zerops GUI](bun/how-to/env-variables#set-secret-env-variables-in-zerops-gui) |
+| runtime | secret | [Zerops GUI](bun/how-to/env-variables#set-secret-env-variables-in-zerops-gui) |
+Use the [secret env variables](bun/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](bun/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](bun/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](bun/how-to/create) a new Bun service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made in the list of env variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The Bun process running in the container receives the list env variables only when it starts. Update of the env variables while the Bun process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+These restrictions apply to all [types of env variables](bun/how-to/env-variables#types-of-env-variables-in-zerops).
+## Referencing other env variables
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your Bun runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the Bun service. The Bun process running in the container receives the list env variables only when it starts. Update of the env variables while the Bun process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a Bun service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your Bun app
+Zerops passes all environment variables from all project services when your Bun app is deployed and started.
+To access the local environment variable i.e. the variable set to this Bun service in your app, use:
+```sh
+process.env.YOUR_VARIABLE_KEY_HERE
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+
+----------------------------------------
+
+# Bun > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Bun > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](bun/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](bun/how-to/build-pipeline#preparecommands-1) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the runtime containers in Zerops CLI use
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## Bun logging configuration
+Zerops logs all messages sent
+- to the standard error (`stderr`)
+- to the standard output (`stdout`)
+- via the Bun `console.log` method
+### Severity level
+By default the `console.log` creates a message with the `Informational (6)` severity.
+Add a severity number in the `` format as a prefix to set a custom severity as shown below:
+```js
+console.log('A message with the informational severity ...');
+console.log('Emergency (0) severity > system is unusable.');
+console.log('Alert (1) severity > action must be taken immediately.');
+console.log('Critical (2) severity > critical conditions.');
+console.log('Error (3) severity > error conditions.');
+console.log('Warning (4) severity > warning conditions.');
+console.log('Notice (5) severity > normal, but significant, condition.');
+console.log('Informational (6) severity > informational message.');
+console.log('Debug (7) severity > debug-level message.');
+```
+:::info
+`console.info`, `console.warn`, `console.debug`
+, and `console.error` are just aliases to the `
+ console.log
+` method. They don't set the appropriate severity number. Use the `
+ <N>
+` prefix instead. :::
+
+----------------------------------------
+
+# Bun > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the Bun service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Bun service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Bun service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Bun performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Bun service. When your Bun service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Bun service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each Bun service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the Bun service.
+### Not enough resources to scale up
+If one of the Bun containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the Bun service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor Bun resources
+Zerops provides information about how much hardware resources the Bun service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Bun > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your Bun service directly when creating a new shared storage service. Just select your Bun service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the Bun service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create Bun service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new Bun service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](bun/how-to/shared-storage#create-a-project-description-file)
+3. [Create a project with a Bun service and a shared storage](bun/how-to/shared-storage#create-a-project-with-a-bun-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](bun/how-to/create#create-a-project-description-file) how to define the Bun service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Bun and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in Bun@{version} format
+ type: bun@latest
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the Bun service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with a Bun service and a shared storage
+Follow the article [How to create a project based on the description.yaml](bun/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Bun > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](bun/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](bun/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](bun/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Bun > How To > Upgrade
+
+You can upgrade or downgrade your Bun service to a different major Bun version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](bun/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Bun version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Bun version for your runtime.
+If you want to build your application with a different major Bun version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
+
+----------------------------------------
+
+# Bun > Overview
+
+[Bun ↗](https:/bun.org/en) is an asynchronous event-driven JavaScript runtime, which is designed to build scalable network applications.
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-bun), a **_recipe_**, containing the most simple Bun web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of Bun app running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-bun/blob/main/zerops-project-import.yaml)):
+```yaml
+project:
+ name: recipe-bun
+ tags:
+ - zerops-recipe
+services:
+ - hostname: api
+ type: bun@1.1
+ enableSubdomainAccess: true
+ buildFromGit: https://github.com/zeropsio/recipe-bun
+ - hostname: db
+ type: postgresql@16
+ mode: NON_HA
+ priority: 1
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://api-806-3000.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+{"message":"This is a simple, basic Bun application running on Zerops.io,\n each request adds an entry to the PostgreSQL database and returns a count.\n See the source repository (https://github.com/zeropsio/recipe-bun) for more information.","newEntry":"dfd1e873-bfc8-4f36-af07-e32561820b93","count":"1"}
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+## How to start
+It doesn't matter whether it's your first curious introduction to Zerops, you have already mastered the basics and are looking for a tiny detail or inspiration. Below, choose a section that fits your needs:
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Deno > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing Deno application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](/deno/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple Deno web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Deno > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](/deno/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](/deno/how-to/build-pipeline#ports) `3000`, simply use `http://app:3000`
+:::info
+Do not use `https://` when communicating with Deno from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use Deno environment variables
+Zerops creates default environment variables for each Deno service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](/deno/how-to/env-variables#generated-env-variables) of the Deno service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](/deno/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your Deno application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access Deno application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/deno/how-to/env-variables) are available when connected through VPN. To connect to your Deno application in Zerops set the hostname and [internal port](/deno/how-to/build-pipeline#ports) e.g. http://app:3000
+:::info
+Do not use `https://` when communicating with Deno over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your Deno service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your Deno service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/deno/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Deno > How To > Build Pipeline
+
+Zerops provides a customizable build and runtime environment for your Deno application.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define 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. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customise the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # REQUIRED. Build your application
+ buildCommands:
+ - deno task build
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - dist
+ - deno.jsonc
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ # cache: directory
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: deno@latest
+ # OPTIONAL. Sets the internal port(s) your app listens on:
+ ports:
+ # port number
+ - port: 3000
+ # OPTIONAL. Customise the runtime Deno environment by installing additional
+ # dependencies to the base Deno runtime environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Deno application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # REQUIRED. Your Deno application start command
+ start: deno task start
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your Deno application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Build pipeline configuration
+### base
+_REQUIRED._ Sets the base technology for the build environment.
+Following options are available for Deno builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: deno@latest
+ ...
+```
+ The base build environment contains {data.alpine.default}, the selected
+ major version of Deno, Zerops command line tool, `npm`, `yarn`, `git` and `npx` tools.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base:
+ - deno@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
+To customise your build environment use the [prepareCommands](/deno/how-to/build-pipeline#preparecommands) attribute.
+:::note
+Modifying the base technology will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### os
+_OPTIONAL._ Sets the operating system for the build environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+:::note
+Changing the OS setting will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache behavior.
+:::
+### prepareCommands
+_OPTIONAL._ Customises the build environment by installing additional dependencies or tools to the base build environment.
+The base build environment contains:
+- {data.alpine.default}
+- selected version of Deno defined in the [base](/deno/how-to/build-pipeline#base) attribute
+- [Zerops command line tool](/references/cli)
+- `npm`, `yarn`, `git` and `npx` tools
+To install additional packages or tools add one or more prepare commands:
+```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:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first build is triggered, Zerops will
+1. create a build container
+2. download your application code from your repository
+3. run the prepare commands in the defined order
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::note
+These commands are skipped when using cached environment. Modifying `prepareCommands` will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache invalidation.
+:::
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/deno/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all prepare commands are finished, your custom build environment is ready for the build phase.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### buildCommands
+_REQUIRED._ Defines build commands.
+```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
+ # REQUIRED. Build your application
+ buildCommands:
+ - deno task build
+ ...
+```
+At least one command is required. Zerops triggers each command in the defined order in a dedicated build container.
+Before the build commands are triggered the build container contains:
+1. base environment defined by the [base](/deno/how-to/build-pipeline#base) attribute
+2. optional customisation of the base environment defined in the [prepareCommands](/deno/how-to/build-pipeline#preparecommands) attribute
+3. your application code
+#### Run build commands as a single shell instance
+Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it.
+```yaml
+buildCommands:
+ - |
+ deno test
+ deno task build
+```
+#### Run build commands as a separate shell instances
+When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command.
+```yaml
+buildCommands:
+ - deno task build
+```
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/deno/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the --verbose option.
+```yaml
+buildCommands:
+ - npm i --verbose
+ - npm run build
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the deploy phase.
+### deployFiles
+_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
+```yaml
+# REQUIRED. Select which files / folders to deploy after
+# the build has successfully finished
+deployFiles:
+ - dist
+ - package.json
+ - node_modules
+```
+Determines files or folders produced by your build, which should be deployed to your runtime service containers.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Examples
+Deploys a folder, and a file from the project root directory:
+```yaml
+deployFiles:
+ - dist
+ - package.json
+```
+Deploys the whole content of the build container:
+```yaml
+deployFiles: .
+```
+Deploys a folder, and a file in a defined path:
+```yaml
+deployFiles:
+ - ./path/to/file.txt
+ - ./path/to/dir/
+```
+#### How to use a wildcard in the path
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+Deploys all folders that are located in any path that begins with `/path/to/`
+```yaml
+deployFiles: ./path/to/~/
+```
+Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/
+```
+:::note Example
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+:::
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+_OPTIONAL._ Defines which files or folders will be cached for the next build.
+```yaml
+# OPTIONAL. Which files / folders you want to cache for the next build.
+# Next builds will be faster when the cache is used.
+cache: file.txt
+```
+The cache attribute helps optimize build times by preserving specified files between builds.
+The cache attribute supports the [~ wildcard character](#how-to-use-a-wildcard-in-the-path).
+Learn more about the [build cache system](/features/build-cache) in Zerops.
+### envVariables
+_OPTIONAL._ Defines the environment variables for the build environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ base: deno@latest
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/deno/how-to/env-variables) in Zerops.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current Deno version for your runtime.
+Following options are available for Deno builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: deno@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: deno@latest
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the
+ selected major version of Deno, Zerops command line tool, `npm`, `yarn`, `git` and `npx` tools.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: deno@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base:
+ - deno@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customise your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a Deno service with hostname = "app" and port = 3000 from another service of the same project, simply use `app:3000`. Read more about [how to access a Deno service](/deno/how-to/access).
+Each port has following attributes:
+| parameter | description |
+| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| port | Defines the port number. You can set any port number between _10_ and _65435_. Ports outside this interval are reserved for internal Zerops systems. |
+| protocol | **Optional.** Defines the protocol. Allowed values are `TCP` or `UDP`. Default value is `TCP`. |
+| httpSupport | **Optional.** `httpSupport = true` is the default setting for TCP protocol. Set `httpSupport = false` if a web server isn't running on the port. Zerops uses this information for the configuration of [public access](/features/access). `httpSupport = true` is available only in combination with the TCP protocol. |
+| httpSupport | **Optional.** `httpSupport = true` is the default setting for TCP protocol. Set `httpSupport = false` if a web server isn't running on the port. Zerops uses this information for the configuration of [public access](/features/access). `httpSupport = true` is available only in combination with the TCP protocol. |
+### prepareCommands
+_OPTIONAL._ Customises the Deno runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base Deno environment contains {data.alpine.default} the selected
+ major version of Deno, Zerops command line tool and `npm`, `yarn`, `git` and `npx` tools. To install
+ additional packages or tools add one or more prepare commands:
+```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 Deno runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/deno/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/deno/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the custom runtime cache go to `yyy`
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.default}, the
+ selected major version of Deno, Zerops command line tool and `npm`, `yarn`, `git` and `npx` tools.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare: ./runtime-config.yaml
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base Deno runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Deno application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your Deno application is started via the [start command](/deno/how-to/build-pipeline#start).
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](/deno/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](/deno/how-to/build-pipeline#preparecommands-1) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](/deno/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/deno/how-to/env-variables) in Zerops.
+### start
+_REQUIRED._ Defines the start command for your Deno application.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Deno application start command
+ start: deno task start
+```
+We recommend starting your Deno application using `deno task start`.
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Deno application start command
+ start: deno task start
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+| Parameter | Description |
+| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **command** | Defines a local command to be run.
+The command has access to the same [environment variables](/deno/how-to/create#set-secret-environment-variables) as your Deno application.
+A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below. |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Deno application start command
+ start: deno task start
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+### crontab
+_OPTIONAL._ Defines cron jobs.
+Setup cron jobs in the following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ crontab:
+ # REQUIRED. Sets the command to execute:
+ - command: ""
+ # REQUIRED. Sets the interval time to execute:
+ timing: "0 * * * *"
+```
+Read more about setting up [cron](/references/cron) in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](/deno/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](/deno/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+| Parameter | Description |
+| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **command** | Defines a local command to be run.
+The command has access to the same [environment variables](/deno/how-to/create#set-secret-environment-variables) as your Deno application.
+A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below. |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](/deno/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Deno > How To > Build Process
+
+
+## Description of the build process
+Zerops starts a temporary build container and performs following actions:
+1. Installs the build environment:
+ - Sets up base system and Go runtime
+ - Restores cached files if available (based on `build.cache` configuration)
+ - Validates cache against current `build.os`, `build.base`, and `build.prepareCommands`
+2. Downloads your application source code from [GitHub ↗](https://www.github.com), [GitLab ↗](https://www.gitlab.com) or via [Zerops CLI](/references/cli)
+3. Optionally [customizes the build environment](#customize-deno-build-environment)
+4. Runs the build commands
+5. Uploads the application artefact to the internal Zerops storage
+6. Preserves specified files for future builds (based on `build.cache` configuration)
+7. Optionally [customizes the runtime environment](/deno/how-to/customize-runtime)
+8. [Deploys your application](/deno/how-to/deploy-process)
+The build container is automatically deleted after the build has finished or failed.
+## Cancel running build
+When you know that the running build is not correct and you want to cancel it, you can do it in Zerops GUI. Go to the service detail, open the list of running processes and click on the **Open pipeline detail** button. Then click on the **Cancel build** button.
+
+:::caution
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+:::
+## Customize Deno build environment
+The default Deno build environment contains:
+- {data.alpine.default}
+- selected version of Deno defined in `zerops.yaml` [build.base](/deno/how-to/build-pipeline#base) parameter
+- [zCLI](/references/cli), Zerops command line tool
+- `npm`, `yarn`, `git` and `npx` tools
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/deno/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](/deno/how-to/build-pipeline#preparecommands) commands to your `zerops.yaml`.
+:::info
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::
+## Deno build hardware resources
+Build of your Deno application is run in a separate build container with following resource configuration:
+| HW resource | Minimum | Maximum |
+| ------------- | ------- | ------- |
+| **CPU cores** | 6 | 20 |
+| **RAM** | 8 GB | 8 GB |
+| **Disk** | 1 GB | 100 GB |
+| **Disk** | 1 GB | 100 GB |
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+## Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops will terminate the build pipeline and delete the build container.
+## Troubleshooting build-related problems
+### Failure of a build prepare command
+If any [prepare command](/deno/how-to/build-pipeline#preparecommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/deno/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom build environment is ready for the build phase.
+### Invalidate the build cache
+If you encounter unexpected build behavior or dependency issues, the problem might be related to [cached build data](/features/build-cache). While Zerops maintains the build cache to speed up deployments, sometimes you may need to start fresh.
+To invalidate the build cache:
+1. Go to your service detail in Zerops GUI
+2. Choose **Pipelines & CI/CD Settings** from the left menu
+3. Click on the **Invalidate build cache** button
+This will force Zerops to run the next build clean, including all prepare commands, which can help resolve cache-related issues. After invalidation, your next build will also create a fresh cache.
+### Failure of a build command
+If any [build command](/deno/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/deno/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `--verbose` option.
+```yaml
+buildCommands:
+ - npm i --verbose
+ - npm run build
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the [deploy](/deno/how-to/deploy-process) phase.
+
+----------------------------------------
+
+# Deno > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart Deno service in Zerops GUI
+To stop the Deno service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped Deno service choose the **Start** item from the same menu.
+To restart the Deno service choose the **Restart** item from the same menu.
+## Stop and start Deno using zCLI
+zCLI is the Zerops command-line tool. To stop and start the Deno service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Deno > How To > Create
+
+Zerops provides a powerful Deno runtime service with extensive build support. The Deno runtime is highly scalable and customizable to suit your development and production needs. With just a few clicks or commands, you can have a production-ready Deno environment up and running in no time.
+## Create a Deno service using Zerops GUI
+First, set up a project in the Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu under the **Services** section. From there, you can add a new Deno service:
+### Choose a Deno version
+Zerops supports the following Deno versions:
+:::info
+You can easily [upgrade](/deno/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app", "cache", "gui", etc. Duplicate services with the same name within the same project are not allowed.
+#### Limitations:
+- Maximum 25 characters
+- Must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created and cannot be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as passwords, tokens, salts, certificates, etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting secret environment variables is optional. You can always set them later in the Zerops GUI.
+Read more about the [different types of environment variables](/deno/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Configure auto scaling
+Zerops automatically scales Deno services both vertically and horizontally. Vertical scaling adjusts the hardware resources (CPU, RAM, and disk) of a Deno container, while horizontal scaling adds or removes entire containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. The power your application receives depends on the other applications running on the same CPU core. In the best-case scenario, your application gets 10/10 of the CPU core power, and 1/10 in the worst-case scenario.
+**Dedicated**
+The CPU core is dedicated exclusively to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+You can choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has the following default configuration:
+Deno services always start with the minimal resources.
+In most cases, the default parameters will work without issues. If you need to limit the cost of the Deno service, you can lower the maximum resources. Zerops will never scale above the selected maximums.
+If you experience insufficient Deno performance or capacity, you can increase the minimum resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine-tune](/deno/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application's needs.
+:::
+:::info
+You can change the vertical auto scaling parameters at any time.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but is already consuming the maximum resources defined for vertical auto scaling, Zerops will add a new container to your Deno service. When your Deno service doesn't need as much power and all containers are vertically scaled down such that their CPU allocation is near the minimum resources, Zerops will gradually remove entire containers.
+Horizontal auto scaling has the following default configuration:
+
+ Minimum containers
+
+ 1
+
+ Maximum containers
+
+ 6
+
+Deno services always start with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](/deno/how-to/scaling) about Deno auto scaling in Zerops.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will automatically start a new container and deploy your application. However, the application will be unavailable for a short period. This mode is recommended for non-critical applications or development environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers based on your application's load. An application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed down to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents temporary outages in case any of the Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically, and the broken container will be deleted.
+:::caution
+Make sure your application is designed to run in multiple containers.
+:::
+## Create a Deno service using zCLI
+zCLI is the Zerops command-line tool. To create a new Deno service via the command line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/deno/how-to/create#create-a-project-description-file)
+3. [Create a project with a Deno and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a YAML format to describe the project infrastructure.
+#### Basic example:
+Create a directory called `my-project`. Inside the `my-project` directory, create a `description.yaml` file with the following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in deno@{version} format
+ type: deno@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one Deno version 20 service with default [auto scaling](/deno/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/deno/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Deno and PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in deno@{version} format
+ type: deno@latest
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+ - # second service hostname
+ hostname: db
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain a Deno service and a [PostgreSQL](/postgresql/overview) service.
+Deno service with "app" hostname, the internal port(s) the service listens on will be defined later in the [zerops.yaml](/deno/how-to/build-pipeline#ports). Deno service will run on version 20 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+| Parameter | Description | Limitations |
+| --------------- | ------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
+| **name** | The name of the new project. Duplicates are allowed. | |
+| **description** | **Optional.** Description of the new project. | Maximum 255 characters. |
+| **tags** | **Optional.** One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects. |
+| **tags** | **Optional.** One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects. |
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains Deno and PostgreSQL services but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [Deno service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+ All verticalAutoscaling attributes are optional. Not specified
+ attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers
+ for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value
+ map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add Deno service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in deno@{version} format
+ type: deno@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Deno service version 20 with default [auto scaling](/deno/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Deno > How To > Customize Runtime
+
+
+The default Deno runtime environment contains:
+- {data.alpine.default}
+- selected version of Deno selected when the runtime service was created.
+-
+ `zCLI`
+
+ , Zerops command line tool
+- `npm`, `yarn`, `git` and `npx` tools
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/deno/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more `run.prepareCommands` commands to your `zerops.yaml`.
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/deno/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `run.prepareCommands` commands in the defined order
+### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/deno/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+The prepare runtime container is automatically deleted after the prepare runtime phase has finished or failed.
+### Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the `build.addToRunPrepare` and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the custom runtime cache go to `yyy`
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+
+----------------------------------------
+
+# Deno > How To > Delete
+
+## Delete Deno service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete Deno using zCLI
+zCLI is the Zerops command-line tool. To delete the Deno service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Deno > How To > Deploy Process
+
+
+## Application artefact
+When the [build phase](/deno/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](/deno/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/deno/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/deno/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/deno/how-to/build-pipeline#initcommands)
+4. Starts your application using the [start command](/deno/how-to/build-pipeline#start)
+5. Optionally waits until the [readiness check](/deno/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/deno/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customise the runtime environment](/deno/how-to/build-pipeline#preparecommands-1).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The Deno process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready to handle requests right after it is started via the [start command](/deno/how-to/build-pipeline#start), configure a [readiness check](/deno/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your Deno service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/deno/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Deno > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+| environment | type | defined in |
+| ----------- | ------ | --------------------------------------------------------------------------------- |
+| build | basic | [zerops.yaml](/deno/how-to/build-pipeline#envvariables) |
+| runtime | basic | [zerops.yaml](/deno/how-to/build-pipeline#envvariables-1) |
+| runtime | secret | [Zerops GUI](#set-secret-env-variables-in-zerops-gui) |
+| runtime | secret | [Zerops GUI](#set-secret-env-variables-in-zerops-gui) |
+Use the [secret env variables](/deno/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](/deno/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/deno/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](/deno/how-to/create) a new Deno service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made to environment variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The Deno process running in the container receives the list env variables only when it starts. Update of the env variables while the Deno process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+These restrictions apply to all [types of env variables](/deno/how-to/env-variables#types-of-env-variables-in-zerops).
+## Referencing other env variables
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your Deno runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the Deno service. The Deno process running in the container receives the list env variables only when it starts. Update of the env variables while the Deno process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a Deno service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your Deno app
+Zerops passes all environment variables from all project services when your Deno app is deployed and started.
+To access the local environment variable i.e. the variable set to this Deno service in your app, use:
+```sh
+process.env.YOUR_VARIABLE_KEY_HERE
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+
+----------------------------------------
+
+# Deno > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Deno > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](/deno/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](/deno/how-to/build-pipeline#preparecommands-1) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the runtime containers in Zerops CLI use
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## Deno logging configuration
+Zerops logs all messages sent
+- to the standard error (`stderr`)
+- to the standard output (`stdout`)
+- via the Deno `console.log` method
+### Severity level
+By default the `console.log` creates a message with the `Informational (6)` severity.
+Add a severity number in the `` format as a prefix to set a custom severity as shown below:
+```js
+console.log('A message with the informational severity ...');
+console.log('Emergency (0) severity > system is unusable.');
+console.log('Alert (1) severity > action must be taken immediately.');
+console.log('Critical (2) severity > critical conditions.');
+console.log('Error (3) severity > error conditions.');
+console.log('Warning (4) severity > warning conditions.');
+console.log('Notice (5) severity > normal, but significant, condition.');
+console.log('Informational (6) severity > informational message.');
+console.log('Debug (7) severity > debug-level message.');
+```
+:::info
+`console.info`, `console.warn`, `console.debug`
+, and `console.error` are just aliases to the `
+ console.log
+` method. They don't set the appropriate severity number. Use the `
+ <N>
+` prefix instead. :::
+
+----------------------------------------
+
+# Deno > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the Deno service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Deno service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Deno service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Deno performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Deno service. When your Deno service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Deno service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each Deno service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the Deno service.
+### Not enough resources to scale up
+If one of the Deno containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the Deno service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor Deno resources
+Zerops provides information about how much hardware resources the Deno service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Deno > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your Deno service directly when creating a new shared storage service. Just select your Deno service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the Deno service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create Deno service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new Deno service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/deno/how-to/shared-storage#create-a-project-description-file)
+3. [Create a project with a Deno service and a shared storage](/deno/how-to/shared-storage#create-a-project-with-a-deno-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](/deno/how-to/create#create-a-project-description-file) how to define the Deno service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Deno and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in deno@{version} format
+ type: deno@latest
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the Deno service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with a Deno service and a shared storage
+Follow the article [How to create a project based on the description.yaml](/deno/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Deno > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](/deno/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](/deno/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](/deno/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Deno > How To > Upgrade
+
+You can upgrade or downgrade your Deno service to a different major Deno version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/deno/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Deno version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Deno version for your runtime.
+If you want to build your application with a different major Deno version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
+
+----------------------------------------
+
+# Deno > Overview
+
+[Deno ↗](https://deno.org/en) is an asynchronous event-driven JavaScript runtime, which is designed to build scalable network applications.
+:::tip
+Have you got any additional question? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-deno), a **_recipe_**, containing the most simple Deno web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of Deno app running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-deno/blob/main/zerops-project-import.yaml)):
+```yaml
+project:
+ name: recipe-deno
+ tags:
+ - zerops-recipe
+services:
+ - hostname: api
+ type: deno@1
+ buildFromGit: https://github.com/zeropsio/recipe-deno
+ enableSubdomainAccess: true
+ - hostname: db
+ type: postgresql@16
+ mode: NON_HA
+ priority: 1
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://api-7f6-8000.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+{"message":"This is a simple, basic Deno / Oak application running on Zerops.io,\n each request adds an entry to the PostgreSQL database and returns a count.\n See the source repository (https://github.com/zeropsio/recipe-deno) for more information.","newEntry":"274b0cc1-5b6d-4351-b8ec-53cf82bd9d0f","count":1}
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+## How to start
+It doesn't matter whether it's your first curious introduction to Zerops, you have already mastered the basics and are looking for a tiny detail or inspiration. Below, choose a section that fits your needs:
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Docker > Overview
+
+Zerops provides Docker support through dedicated Virtual Machine (VM) environments, ensuring maximum compatibility and isolation while maintaining integration with the broader Zerops ecosystem. This guide explains how to effectively use Docker services on Zerops, including best practices and important considerations.
+## Why VMs
+While Zerops primarily uses native Linux containers for optimal performance, this VM-based approach allows you to run virtually any Docker container while maintaining Zerops' robust infrastructure management.
+You can learn more about [differences](/features/container-vs-vm) between Containers and Virtual Machines on Zerops.
+Before using Docker services, consider these important aspects:
+### Virtual Machine Environment
+Docker services on Zerops operate in a full VM environment, which has several implications:
+- **Slower Boot Times**: VMs require more time to initialize due to full kernel boot
+- **Higher Resource Usage**: VMs include additional system overhead compared to native containers
+- **Scaling Limitations**:
+ - Vertical scaling requires VM restart
+ - Resources must be set as fixed values (no min-max ranges)
+ - Zerops automatically restarts the VM when resource values are changed in UI
+- **Storage Management**: Disk space can only be increased, not decreased without recreation
+- **Build Phase Limitations**: Build phase runs in containers, not in the VM environment
+### Advantages
+Despite these limitations, Docker services offer some benefits:
+- **Broad Compatibility**: Run almost any Docker container with minimal modification
+- **Familiar Environment**: Standard Docker runtime environment
+## Configuration Guide
+### Supported Version
+Currently supported Docker versions:
+### Basic Structure
+Docker services in Zerops are configured through the `zerops.yaml` file. Here's a typical configuration pattern:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ run:
+ prepareCommands:
+ - docker image pull
+ start: docker run --network=host
+ ports:
+ - port:
+ httpSupport: true
+```
+Refer to the [Docker recipe repository](https://github.com/zeropsio/recipe-docker) for an example configuration.
+:::note
+We are actively working on improving the speed of image caching after `run.prepareCommands` and reducing the startup time of runtime VMs. These improvements will be released in future updates.
+:::
+### Network Configuration
+Docker services require the `--network=host` flag for proper integration with Zerops:
+- **Direct Port Management**: Ports are managed through `zerops.yaml`
+- **Simplified Configuration**: Avoids double port exposure in Docker and Zerops
+- **Native Performance**: Direct access to host networking
+### Docker Compose Support
+For projects using Docker Compose, additional configuration is required:
+1. **File Deployment**:
+ ```yaml title="zerops.yaml"
+ build:
+ deployFiles: ./docker-compose.yaml
+ addToRunPrepare: ./docker-compose.yaml
+ ```
+2. **Network Mode**:
+ ```yaml title="docker-compose.yaml"
+ services:
+ your-service:
+ network_mode: host
+ ```
+3. **Start Command**:
+ ```yaml title="zerops.yaml"
+ run:
+ start: docker compose up --force-recreate
+ ```
+### Environment Variables
+When using Docker services, there's an additional layer to consider since environment variables defined in Zerops must be explicitly passed to your Docker containers.
+#### 1. Defining Variables in Zerops
+Define your environment variables in the `run.envVariables` section of your `zerops.yaml` (example uses [referenced](/features/env-variables#referencing-variables) variables):
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ run:
+ envVariables:
+ DB_HOST: ${db_hostname}
+ DB_PORT: ${db_port}
+```
+#### 2. Passing Variables to Docker Containers
+For single containers, pass variables using the `-e` flag:
+```yaml title="zerops.yaml"
+run:
+ prepareCommands:
+ - docker image pull my-application:latest
+ start: docker run -e DB_HOST -e DB_PORT --network=host my-application:latest
+```
+For Docker Compose setups, pass environment variables in your `docker-compose.yaml`:
+```yaml title="docker-compose.yaml"
+services:
+ api:
+ image: my-application:latest
+ network_mode: host
+ environment:
+ - DB_HOST
+ - DB_PORT
+```
+## Implementation Examples
+### Single Container
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ run:
+ prepareCommands:
+ - docker image pull crccheck/hello-world
+ start: docker run --network=host crccheck/hello-world
+ ports:
+ - port: 8000
+ httpSupport: true
+```
+### Single Service with Docker Compose
+```yaml title="zerops.yaml"
+zerops:
+ - setup: api
+ build:
+ deployFiles: ./docker-compose.yaml
+ addToRunPrepare: ./docker-compose.yaml
+ run:
+ prepareCommands:
+ - docker compose pull api
+ start: docker compose up api --force-recreate
+ ports:
+ - port: 8000
+ httpSupport: true
+```
+### Multiple Services with Docker Compose
+```yaml title="zerops.yaml"
+zerops:
+ - setup: apps
+ build:
+ deployFiles: ./docker-compose.yaml
+ addToRunPrepare: ./docker-compose.yaml
+ run:
+ prepareCommands:
+ - docker compose pull
+ start: docker compose up --force-recreate
+ ports:
+ - port: 8000
+ httpSupport: true
+```
+## Best Practices
+#### Image Management
+- Use `prepareCommands` for image pulling
+- Consider using specific image tags instead of `latest`
+#### Resource Planning
+- Account for VM overhead in resource allocation
+- Plan for longer initialization times
+- Consider the impact on scaling operations
+#### Migration Consideration
+- Evaluate if your workload could run on native containers
+- Consider gradual migration for complex applications
+- Balance development effort against operational benefits
+## Limitations and Workarounds
+### Build Phase
+Since the build phase runs in containers rather than VMs:
+- Use `run.prepareCommands` for Docker-specific build steps
+- Consider external CI/CD for complex Docker builds
+- Leverage pre-built images when possible
+### Scaling Operations
+Docker services on Zerops have specific scaling characteristics that differ from native containers:
+#### Vertical Scaling
+- Resources must be defined with **fixed** values instead of min-max ranges
+- CPU, RAM, and disk are specified as single values:
+ ```yaml
+ verticalAutoscaling:
+ cpu: 3
+ ram: 2
+ disk: 20
+ ```
+- Any change to these values through the UI triggers an automatic VM restart
+- Plan your resource allocation carefully to minimize scaling operations
+#### Horizontal Scaling
+- Still supports multiple containers through `minContainers` and `maxContainers`
+- Consider breaking large services into smaller components
+- Implement proper health checks for reliable scaling
+- Use horizontal scaling when possible to avoid VM restarts
+
+----------------------------------------
+
+# Dotnet > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing .NET application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](/dotnet/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple .NET web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Dotnet > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](/dotnet/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](/dotnet/how-to/build-pipeline#ports) `5000`, simply use `http://app:5000`
+:::info
+Do not use `https://` when communicating with .NET from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use .NET environment variables
+Zerops creates default environment variables for each .NET service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](/dotnet/how-to/env-variables#generated-env-variables) of the .NET service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](/dotnet/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your .NET application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access .NET application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/dotnet/how-to/env-variables) are available when connected through VPN. To connect to your .NET application in Zerops set the hostname and [internal port](/dotnet/how-to/build-pipeline#ports) e.g. http://app:5000
+:::info
+Do not use `https://` when communicating with .NET over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your .NET service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your .NET service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/dotnet/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Dotnet > How To > Build Pipeline
+
+Zerops provides a customizable build and runtime environment for your .NET application.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: dotnet@6
+ # OPTIONAL. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # REQUIRED. Build your application
+ buildCommands:
+ - npm i
+ - npm run build
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - dist
+ - package.json
+ - node_modules
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ cache: node_modules
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: dotnet@latest
+ # OPTIONAL. Sets the internal port(s) your app listens on:
+ ports:
+ # port number
+ - port: 5000
+ # OPTIONAL. Customize the runtime .NET environment by installing additional
+ # dependencies to the base .NET runtime environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your .NET application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # REQUIRED. Your .NET application start command
+ start: npm start
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your .NET application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Build pipeline configuration
+### base
+_REQUIRED._ Sets the base technology for the build environment.
+Following options are available for .NET builds:
+```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
+ ...
+```
+ The base build environment contains {data.alpine.default}, the selected
+ major version of .NET, Zerops command line tool, `ASP .NET` and `git`.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
+```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
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
+To customize your build environment use the [prepareCommands](/dotnet/how-to/build-pipeline#preparecommands) attribute.
+:::note
+Modifying the base technology will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### os
+_OPTIONAL._ Sets the operating system for the build environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customized.
+:::
+:::note
+Changing the OS setting will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache behavior.
+:::
+### prepareCommands
+_OPTIONAL._ Customizes the build environment by installing additional dependencies or tools to the base build environment.
+The base build environment contains:
+- {data.alpine.default}
+- selected version of .NET defined in the [base](/dotnet/how-to/build-pipeline#base) attribute
+- [Zerops command line tool](/references/cli)
+- `ASP .NET` and `git`
+To install additional packages or tools add one or more prepare commands:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: dotnet@6
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first build is triggered, Zerops will
+1. create a build container
+2. download your application code from your repository
+3. run the prepare commands in the defined order
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::note
+These commands are skipped when using cached environment. Modifying `prepareCommands` will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache invalidation.
+:::
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/dotnet/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all prepare commands are finished, your custom build environment is ready for the build phase.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### buildCommands
+_REQUIRED._ Defines build commands.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: dotnet@6
+ # REQUIRED. Build your application
+ buildCommands:
+ - dotnet build -o app
+ ...
+```
+At least one command is required. Zerops triggers each command in the defined order in a dedicated build container.
+Before the build commands are triggered the build container contains:
+1. base environment defined by the [base](/dotnet/how-to/build-pipeline#base) attribute
+2. optional customisation of the base environment defined in the [prepareCommands](/dotnet/how-to/build-pipeline#preparecommands) attribute
+3. your application code
+#### Run build commands as a single shell instance
+Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it.
+```yaml
+buildCommands:
+ - |
+ apt-get -y install dotnet-runtime-6.0 aspnetcore-runtime-6.0 dotnet-sdk-6.0 # already installed for .NET service
+ dotnet build -o app
+```
+#### Run build commands as a separate shell instances
+When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command.
+```yaml
+buildCommands:
+ - apt-get -y install dotnet-runtime-6.0 aspnetcore-runtime-6.0 dotnet-sdk-6.0 # already installed for .NET service
+ - dotnet build -o app
+```
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/dotnet/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `--verbosity ` option.
+```yaml
+buildCommands:
+ - dotnet build --verbosity detailed
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the deploy phase.
+### deployFiles
+_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
+```yaml
+# REQUIRED. Select which files / folders to deploy after
+# the build has successfully finished
+deployFiles:
+ - app
+```
+Determines files or folders produced by your build, which should be deployed to your runtime service containers.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Examples
+Deploys a folder, and a file from the project root directory:
+```yaml
+deployFiles:
+ - app
+ - file.txt
+```
+Deploys the whole content of the build container:
+```yaml
+deployFiles: .
+```
+Deploys a folder, and a file in a defined path:
+```yaml
+deployFiles:
+ - ./path/to/file.txt
+ - ./path/to/dir/
+```
+#### How to use a wildcard in the path
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+Deploys all folders that are located in any path that begins with `/path/to/`
+```yaml
+deployFiles: ./path/to/~/
+```
+Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/
+```
+:::note Example
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+:::
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+_OPTIONAL._ Defines which files or folders will be cached for the next build.
+```yaml
+# OPTIONAL. Which files / folders you want to cache for the next build.
+# Next builds will be faster when the cache is used.
+cache: file.txt
+```
+The cache attribute helps optimize build times by preserving specified files between builds.
+The cache attribute supports the [~ wildcard character](#how-to-use-a-wildcard-in-the-path).
+Learn more about the [build cache system](/features/build-cache) in Zerops.
+### envVariables
+_OPTIONAL._ Defines the environment variables for the build environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ base: dotnet@6
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ DOTNET_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/dotnet/how-to/env-variables) in Zerops.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current .NET version for your runtime.
+Following options are available for .NET builds:
+```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
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the
+ selected major version of .NET, Zerops command line tool and `ASP .NET` and `git`.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```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
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customise your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a .NET service with hostname = "app" and port = 5000 from another service of the same project, simply use `app:5000`. Read more about [how to access a .NET service](/dotnet/how-to/access).
+Each port has following attributes:
+
+ Parameter
+ Description
+
+ port
+ Defines the port number. You can set any port number between 10 and 65435. Ports outside this interval are reserved for internal Zerops systems.
+
+ protocol
+ Optional. Defines the protocol. Allowed values are TCP or UDP. Default value is TCP.
+
+ httpSupport
+ Optional. httpSupport = true is the default setting for TCP protocol. Set httpSupport = false if a web server isn't running on the port. Zerops uses this information for the configuration of public access. httpSupport = true is available only in combination with the TCP protocol.
+
+### prepareCommands
+_OPTIONAL._ Customises the .NET runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base .NET environment contains {data.alpine.default}, the selected
+ major version of .NET, Zerops command line tool and `ASP .NET` and `git`. To install additional packages
+ or tools add one or more prepare commands:
+```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 .NET runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/dotnet/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/dotnet/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+When the prepare cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.default}, the
+ selected major version of .NET,
+ Zerops command line tool and
+ `ASP .NET` and `git`.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare: ./runtime-config.yaml
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base .NET runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your .NET application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your .NET application is started via the [start command](/dotnet/how-to/build-pipeline#start).
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](/dotnet/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](/dotnet/how-to/build-pipeline#preparecommands-1) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](/dotnet/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ DOTNET_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/dotnet/how-to/env-variables) in Zerops.
+### start
+_REQUIRED._ Defines the start command for your .NET application.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your .NET application start command
+ start: cd app && dotnet dnet.dll
+```
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your .NET application start command
+ start: cd app && dotnet dnet.dll
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your .NET application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your .NET application start command
+ start: cd app && dotnet dnet.dll
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+### crontab
+_OPTIONAL._ Defines cron jobs.
+Setup cron jobs in the following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ crontab:
+ # REQUIRED. Sets the command to execute:
+ - command: ""
+ # REQUIRED. Sets the interval time to execute:
+ timing: "0 * * * *"
+```
+Read more about setting up [cron](/references/cron) in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](/dotnet/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](/dotnet/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your .NET application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](/dotnet/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Dotnet > How To > Build Process
+
+
+## Description of the build process
+Zerops starts a temporary build container and performs following actions:
+1. Installs the build environment:
+ - Sets up base system and Go runtime
+ - Restores cached files if available (based on `build.cache` configuration)
+ - Validates cache against current `build.os`, `build.base`, and `build.prepareCommands`
+2. Downloads your application source code from [GitHub ↗](https://www.github.com), [GitLab ↗](https://www.gitlab.com) or via [Zerops CLI](/references/cli)
+3. Optionally [customizes the build environment](#customize-net-build-environment)
+4. Runs the build commands
+5. Uploads the application artefact to the internal Zerops storage
+6. Preserves specified files for future builds (based on `build.cache` configuration)
+7. Optionally [customizes the runtime environment](/dotnet/how-to/customize-runtime)
+8. [Deploys your application](/dotnet/how-to/deploy-process)
+The build container is automatically deleted after the build has finished or failed.
+## Cancel running build
+When you know that the running build is not correct and you want to cancel it, you can do it in Zerops GUI. Go to the service detail, select **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Cancel build** button.
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+## Customize .NET build environment
+The default .NET build environment contains:
+- {data.alpine.default}
+- selected version of .NET defined in `zerops.yaml` [build.base](/dotnet/how-to/build-pipeline#base) parameter
+- [zCLI](/references/cli)
+- ASP .NET and Git
+:::note
+To use Ubuntu instead of the default Alpine, set the [build.os](/zerops-yaml/specification#os-) attribute.
+Additional packages and tools can be installed using [build.prepareCommands](/zerops-yaml/specification#preparecommands-).
+:::
+:::info
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::
+## .NET build hardware resources
+Build of your .NET application is run in a separate build container with following resource configuration:
+| HW resource | Minimum | Maximum |
+| ------------- | ------- | ------- |
+| **CPU cores** | 6 | 20 |
+| **RAM** | 8 GB | 8 GB |
+| **Disk** | 1 GB | 100 GB |
+| **Disk** | 1 GB | 100 GB |
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+## Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops will terminate the build pipeline and delete the build container.
+## Troubleshooting build-related problems
+### Failure of a build prepare command
+If any [prepare command](/dotnet/how-to/build-pipeline#preparecommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/dotnet/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom build environment is ready for the build phase.
+### Invalidate the build cache
+If you encounter unexpected build behavior or dependency issues, the problem might be related to [cached build data](/features/build-cache). While Zerops maintains the build cache to speed up deployments, sometimes you may need to start fresh.
+To invalidate the build cache:
+1. Go to your service detail in Zerops GUI
+2. Choose **Pipelines & CI/CD Settings** from the left menu
+3. Click on the **Invalidate build cache** button
+This will force Zerops to run the next build clean, including all prepare commands, which can help resolve cache-related issues. After invalidation, your next build will also create a fresh cache.
+### Failure of a build command
+If any [build command](/dotnet/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/dotnet/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `--verbosity ` option.
+```yaml
+buildCommands:
+ - dotnet build --verbosity detailed
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the [deploy](/dotnet/how-to/deploy-process) phase.
+
+----------------------------------------
+
+# Dotnet > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart .NET service in Zerops GUI
+To stop the .NET service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped .NET service choose the **Start** item from the same menu.
+To restart the .NET service choose the **Restart** item from the same menu.
+## Stop and start .NET using zCLI
+zCLI is the Zerops command-line tool. To stop and start the .NET service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Dotnet > How To > Create
+
+Zerops provides a .NET runtime service with extensive build support. .NET runtime is highly scalable and customisable to suit both development and production.
+## Create .NET service using Zerops GUI
+First, set up a project in Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new .NET service:
+### Choose .NET version
+Following .NET versions are currently supported:
+:::info
+You can [change](/dotnet/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app","cache", "gui" etc. Duplicate services with the same name in the same project are forbidden.
+#### Limitations:
+- maximum 25 characters
+- must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created. It can't be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as password, tokens, salts, certificates etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting the secret environment variables is optional. You can set them later in Zerops GUI.
+Read more about [different types of env variables](/dotnet/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Set auto scaling configuration
+Zerops scales the .NET services automatically both vertically and horizontally. Vertical scaling means increasing or decreasing the hardware resources (CPU, RAM and disk) of a .NET container. Horizontal scaling adds or removes whole containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+.NET service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the .NET service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient .NET performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/dotnet/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+:::info
+You can change the vertical auto scaling parameters later.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your .NET service. When your .NET service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+.NET service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](/dotnet/how-to/scaling) about .NET auto scaling.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Create .NET service using zCLI
+zCLI is the Zerops command-line tool. To create a new .NET service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/dotnet/how-to/create#create-a-project-description-file)
+3. [Create a project with a .NET and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### Basic example:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in dotnet@6 format
+ type: dotnet@6
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one .NET version 6 service with default [auto scaling](/dotnet/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/dotnet/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a .NET and PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in dotnet@6 format
+ type: dotnet@6
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create secret env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+ - # second service hostname
+ hostname: db
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain a .NET service and a [PostgreSQL](/postgresql/overview) service.
+.NET service with "app" hostname, the internal port(s) the service listens on will be defined later in the [zerops.yaml](/dotnet/how-to/build-pipeline#ports). .NET service will run on version 6 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+ Limitations
+
+ name
+ The name of the new project. Duplicates are allowed.
+
+ description
+ Optional. Description of the new project.
+ Maximum 255 characters.
+
+ tags
+ Optional. One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects.
+
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains .NET and PostgreSQL services but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ The hostname of the new database will be set to the `hostname` value.
+
+ Limitations:
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+ See what [.NET service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+
+ All verticalAutoscaling attributes are optional. Not specified attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add .NET service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in dotnet@6 format
+ type: dotnet@6
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one .NET service version 6 with default [auto scaling](/dotnet/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Dotnet > How To > Customize Runtime
+
+
+The default .NET runtime environment contains:
+- {data.alpine.default}
+- Selected version of .NET when the runtime service was created.
+- [zCLI](/references/cli)
+- ASP .NET and Git
+:::note
+To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yaml/specification#os--1) attribute.
+Additional packages and tools can be installed using [run.prepareCommands](/zerops-yaml/specification#preparecommands--1).
+:::
+## Runtime Flow
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. Create a prepare runtime container
+2. Optionally: [copy selected folders or files from your build container](/dotnet/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. Run the `prepareCommands` in the defined order
+## Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/dotnet/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+The prepare runtime container is automatically deleted after the prepare runtime phase has finished or failed.
+## Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the build.addToRunPrepare and run.prepareCommands attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+:::tip
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+:::
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+
+----------------------------------------
+
+# Dotnet > How To > Delete
+
+## Delete .NET service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete .NET using zCLI
+zCLI is the Zerops command-line tool. To delete the .NET service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects to choose from.
+
+----------------------------------------
+
+# Dotnet > How To > Deploy Process
+
+
+## Application artefact
+When the [build phase](/dotnet/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](/dotnet/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/dotnet/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/dotnet/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/dotnet/how-to/build-pipeline#initcommands)
+4. Starts your application using the [start command](/dotnet/how-to/build-pipeline#start)
+5. Optionally waits until the [readiness check](/dotnet/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/dotnet/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customize the runtime environment](/dotnet/how-to/customize-runtime).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The .NET process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready to handle requests right after it is started via the [start command](/dotnet/how-to/build-pipeline#start), configure a [readiness check](/dotnet/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your .NET service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/dotnet/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Dotnet > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+
+ Type
+ Environment
+ Defined in
+
+ basic
+ build
+ zerops.yaml
+
+ basic
+ runtime
+ zerops.yaml
+
+ secret
+ runtime
+ Zerops GUI
+
+Use the [secret env variables](/dotnet/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](/dotnet/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/dotnet/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](/dotnet/how-to/create) a new .NET service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made to environment variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The .NET process running in the container receives the list env variables only when it starts. Update of the env variables while the .NET process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+These restrictions apply to all [types of env variables](/dotnet/how-to/env-variables#types-of-env-variables-in-zerops).
+## Referencing other env variables
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your .NET runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the .NET service. The .NET process running in the container receives the list env variables only when it starts. Update of the env variables while the .NET process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a .NET service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your .NET app
+Zerops passes all environment variables from all project services when your .NET app is deployed and started.
+To access the local environment variable i.e. the variable set to this .NET service in your app, use:
+```sh
+Environment.GetEnvironmentVariable("YOUR_VARIABLE_KEY_HERE");
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+
+----------------------------------------
+
+# Dotnet > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Dotnet > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](/dotnet/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](/dotnet/how-to/build-pipeline#preparecommands-1) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the runtime containers in Zerops CLI use
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## .NET logging configuration
+Zerops logs all messages sent
+- to the standard error (`stderr`)
+- to the standard output (`stdout`)
+- via the .NET `Console` logging provider and `Log{LogLevel}` method
+### Severity level
+By default the `Log{LogLevel}` methods create messages with the `Informational (6)` severity.
+Add a severity number in the `` format as a prefix to set a custom severity as shown below:
+```csharp
+builder.Logging.AddConsole();
+var app = builder.Build();
+app.Logger.LogInformation('A message with the informational severity ...');
+app.Logger.LogInformation('Emergency (0) severity > system is unusable.');
+app.Logger.LogInformation('Alert (1) severity > action must be taken immediately.');
+app.Logger.LogInformation('Critical (2) severity > critical conditions.');
+app.Logger.LogInformation('Error (3) severity > error conditions.');
+app.Logger.LogInformation('Warning (4) severity > warning conditions.');
+app.Logger.LogInformation('Notice (5) severity > normal, but significant, condition.');
+app.Logger.LogInformation('Informational (6) severity > informational message.');
+app.Logger.LogInformation('Debug (7) severity > debug-level message.');
+```
+:::info
+`logger.LogTrace`, `logger.LogInformation`,
+`logger.LogWarning`, `logger.LogDebug`, `
+ logger.LogError
+` and `logger.LogCritical` are just aliases to the `
+ logger.LogInformation
+` method. They don't set the appropriate severity number. Use the `
+ <N>
+` prefix instead. :::
+
+----------------------------------------
+
+# Dotnet > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the .NET service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+.NET service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the .NET service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient .NET performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your .NET service. When your .NET service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+.NET service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each .NET service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the .NET service.
+### Not enough resources to scale up
+If one of the .NET containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the .NET service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor .NET resources
+Zerops provides information about how much hardware resources the .NET service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Dotnet > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your .NET service directly when creating a new shared storage service. Just select your .NET service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the .NET service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create .NET service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new .NET service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/dotnet/how-to/shared-storage#create-a-project-description-file)
+3. [Create a project with a .NET service and a shared storage](/dotnet/how-to/shared-storage#create-a-project-with-a-net-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](/dotnet/how-to/create#create-a-project-description-file) how to define the .NET service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a .NET and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in dotnet@6 format
+ type: dotnet@6
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the .NET service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with a .NET service and a shared storage
+Follow the article [How to create a project based on the description.yaml](/dotnet/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Dotnet > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](/dotnet/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](/dotnet/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](/dotnet/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Dotnet > How To > Upgrade
+
+You can upgrade or downgrade your .NET service to a different major .NET version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/dotnet/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required .NET version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current .NET version for your runtime.
+If you want to build your application with a different major .NET version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
+
+----------------------------------------
+
+# Dotnet > Overview
+
+[.NET ↗](https://dotnet.microsoft.com/en-us/) is the free, open-source, cross-platform framework for building modern apps and powerful cloud services..
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-dotnet-hello-world), a **_recipe_**, containing the most simple .NET web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of .NET running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-dotnet-hello-world/blob/main/import-project/description.yaml)):
+```yaml
+project:
+ name: my-first-project
+services:
+ - hostname: helloworld
+ type: dotnet@latest
+ minContainers: 1
+ maxContainers: 3
+ buildFromGit: https://github.com/zeropsio/recipe-dotnet-hello-world@main
+ enableSubdomainAccess: true
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://helloworld-24-8080.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+Hello, World!
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+## How to start
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Elasticsearch > Overview
+
+Deploy [Elasticsearch] instances in Zerops with flexible scaling options, from standalone to highly available clusters.
+## Connection
+- **Port**: 9200
+- **Protocol**: HTTP only
+- **Internal Access**: `http://hostname:9200`
+- **Note**: When accessing from another service within the same project, use the service hostname
+## Configuration
+### How to install/uninstall plugins
+Configure Elasticsearch plugins using a comma-separated list:
+```yaml
+envSecrets:
+ PLUGINS: "analysis-icu,ingest-attachment"
+```
+- **Description**: Defines plugins to install at startup
+- **Format**: `plugin1,plugin2,...`
+- **Note**: Removing a plugin from this list triggers uninstallation on service restart
+### How to adjust JVM heap allocation
+Control JVM heap size as a percentage of container memory:
+```yaml
+envSecrets:
+ HEAP_PERCENT: "75"
+```
+- **Description**: Percentage of container memory allocated to JVM heap
+- **Default**: 50
+- **Range**: 1-100
+- **Note**: To increase available memory, adjust the service's RAM allocation in scaling configuration
+- **Important**: Changes to HEAP_PERCENT require a service restart to take effect
+## Backup
+- **Format:** .gz
+- **Implementation:** Created using elasticdump and compressed using gzip
+For detailed information about backup configuration and management, see [Backup Management](/features/backup)
+## Example Configuration
+```yaml
+services:
+ - hostname: elasticsearch
+ type: elasticsearch@8.16
+ mode: HA
+ envSecrets:
+ PLUGINS: "analysis-icu,ingest-attachment"
+ HEAP_PERCENT: "75"
+```
+## Related Resources
+- [Elasticsearch Official Documentation](https://www.elastic.co/guide/index.html)
+- [Available Elasticsearch Plugins](https://www.elastic.co/guide/en/elasticsearch/plugins/current/index.html)
+
+----------------------------------------
+
+# Elixir > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing Elixir application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](/elixir/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple Elixir web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Elixir > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](/elixir/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](/elixir/how-to/build-pipeline#ports) `3000`, simply use `http://app:3000`
+:::info
+Do not use `https://` when communicating with Elixir from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use Elixir environment variables
+Zerops creates default environment variables for each Elixir service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](/elixir/how-to/env-variables#generated-env-variables) of the Elixir service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](/elixir/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your Elixir application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access Elixir application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/elixir/how-to/env-variables) are available when connected through VPN. To connect to your Elixir application in Zerops set the hostname and [internal port](/elixir/how-to/build-pipeline#ports) e.g. http://app:3000
+:::info
+Do not use `https://` when communicating with Elixir over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your Elixir service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your Elixir service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/elixir/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Elixir > How To > Build Pipeline
+
+Zerops provides a customizable build and runtime environment for your Elixir application.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: elixir@latest
+ # OPTIONAL. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customise the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # REQUIRED. Build your application
+ buildCommands:
+ - mix deps.get --only prod
+ - mix compile
+ - mix release
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles: _build/prod/rel/app/
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ cache: node_modules
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: elixir@latest
+ # OPTIONAL. Sets the internal port(s) your app listens on:
+ ports:
+ # port number
+ - port: 3000
+ # OPTIONAL. Customise the runtime Elixir environment by installing additional
+ # dependencies to the base Elixir runtime environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Elixir application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # REQUIRED. Your Elixir application start command
+ start: npm start
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your Elixir application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Build pipeline configuration
+### base
+_REQUIRED._ Sets the base technology for the build environment.
+Following options are available for Elixir builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: elixir@latest
+ ...
+```
+ The base build environment contains {data.alpine.default}, the selected
+ major version of Elixir, Zerops command line tool, `npm`, `yarn`, `git` and `npx` tools.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base:
+ - elixir@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
+To customise your build environment use the [prepareCommands](/elixir/how-to/build-pipeline#preparecommands) attribute.
+:::note
+Modifying the base technology will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### os
+_OPTIONAL._ Sets the operating system for the build environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+:::note
+Changing the OS setting will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache behavior.
+:::
+### prepareCommands
+_OPTIONAL._ Customises the build environment by installing additional dependencies or tools to the base build environment.
+The base build environment contains:
+- {data.alpine.default}
+- selected version of Elixir defined in the [base](/elixir/how-to/build-pipeline#base) attribute
+- [Zerops command line tool](/references/cli)
+- `npm`, `yarn`, `git` and `npx` tools
+To install additional packages or tools add one or more prepare commands:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: elixir@latest
+ # OPTIONAL. Customise the build environment by installing additional packages
+ # or tools to the base build environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first build is triggered, Zerops will
+1. create a build container
+2. download your application code from your repository
+3. run the prepare commands in the defined order
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::note
+These commands are skipped when using cached environment. Modifying `prepareCommands` will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache invalidation.
+:::
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/elixir/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all prepare commands are finished, your custom build environment is ready for the build phase.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### buildCommands
+_REQUIRED._ Defines build commands.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: elixir@latest
+ # REQUIRED. Build your application
+ buildCommands:
+ - npm i
+ - npm run build
+ ...
+```
+At least one command is required. Zerops triggers each command in the defined order in a dedicated build container.
+Before the build commands are triggered the build container contains:
+1. base environment defined by the [base](/elixir/how-to/build-pipeline#base) attribute
+2. optional customisation of the base environment defined in the [prepareCommands](/elixir/how-to/build-pipeline#preparecommands) attribute
+3. your application code
+#### Run build commands as a single shell instance
+Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it.
+```yaml
+buildCommands:
+ - |
+ npm i
+ npm run build
+```
+#### Run build commands as a separate shell instances
+When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command.
+```yaml
+buildCommands:
+ - npm i
+ - npm run build
+```
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/elixir/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the --verbose option.
+```yaml
+buildCommands:
+ - npm i --verbose
+ - npm run build
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the deploy phase.
+### deployFiles
+_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
+```yaml
+# REQUIRED. Select which files / folders to deploy after
+# the build has successfully finished
+deployFiles:
+ - dist
+ - package.json
+ - node_modules
+```
+Determines files or folders produced by your build, which should be deployed to your runtime service containers.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Examples
+Deploys a folder, and a file from the project root directory:
+```yaml
+deployFiles:
+ - dist
+ - package.json
+```
+Deploys the whole content of the build container:
+```yaml
+deployFiles: .
+```
+Deploys a folder, and a file in a defined path:
+```yaml
+deployFiles:
+ - ./path/to/file.txt
+ - ./path/to/dir/
+```
+#### How to use a wildcard in the path
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+Deploys all folders that are located in any path that begins with `/path/to/`
+```yaml
+deployFiles: ./path/to/~/
+```
+Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/
+```
+:::note Example
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+:::
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+_OPTIONAL._ Defines which files or folders will be cached for the next build.
+```yaml
+# OPTIONAL. Which files / folders you want to cache for the next build.
+# Next builds will be faster when the cache is used.
+cache: file.txt
+```
+The cache attribute helps optimize build times by preserving specified files between builds.
+The cache attribute supports the [~ wildcard character](#how-to-use-a-wildcard-in-the-path).
+Learn more about the [build cache system](/features/build-cache) in Zerops.
+### envVariables
+_OPTIONAL._ Defines the environment variables for the build environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ base: elixir@latest
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/elixir/how-to/env-variables) in Zerops.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current Elixir version for your runtime.
+Following options are available for Elixir builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: elixir@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: elixir@latest
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the
+ selected major version of Elixir, Zerops command line tool, `npm`, `yarn`, `git` and `npx` tools.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: elixir@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base:
+ - elixir@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customise your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a Elixir service with hostname = "app" and port = 3000 from another service of the same project, simply use `app:3000`. Read more about [how to access a Elixir service](/elixir/how-to/access).
+Each port has following attributes:
+| parameter | description |
+| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| port | Defines the port number. You can set any port number between _10_ and _65435_. Ports outside this interval are reserved for internal Zerops systems. |
+| protocol | **Optional.** Defines the protocol. Allowed values are `TCP` or `UDP`. Default value is `TCP`. |
+| httpSupport | **Optional.** `httpSupport = true` is the default setting for TCP protocol. Set `httpSupport = false` if a web server isn't running on the port. Zerops uses this information for the configuration of [public access](/features/access). `httpSupport = true` is available only in combination with the TCP protocol. |
+| httpSupport | **Optional.** `httpSupport = true` is the default setting for TCP protocol. Set `httpSupport = false` if a web server isn't running on the port. Zerops uses this information for the configuration of [public access](/features/access). `httpSupport = true` is available only in combination with the TCP protocol. |
+### prepareCommands
+_OPTIONAL._ Customises the Elixir runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base Elixir environment contains {data.alpine.default} the selected
+ major version of Elixir, Zerops command line tool and `npm`, `yarn`, `git` and `npx` tools. To install
+ additional packages or tools add one or more prepare commands:
+```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 Elixir runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/elixir/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/elixir/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the custom runtime cache go to `yyy`
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.default}, the
+ selected major version of Elixir, Zerops command line tool and `npm`, `yarn`, `git` and `npx` tools.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare: ./runtime-config.yaml
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base Elixir runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Elixir application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your Elixir application is started via the [start command](/elixir/how-to/build-pipeline#start).
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](/elixir/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](/elixir/how-to/build-pipeline#preparecommands-1) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](/elixir/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/elixir/how-to/env-variables) in Zerops.
+### start
+_REQUIRED._ Defines the start command for your Elixir application.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Elixir application start command
+ start: npm start
+```
+We recommend starting your Elixir application using `npm start`.
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Elixir application start command
+ start: npm start
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+| Parameter | Description |
+| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **command** | Defines a local command to be run.
+The command has access to the same [environment variables](/elixir/how-to/create#set-secret-environment-variables) as your Elixir application.
+A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below. |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Elixir application start command
+ start: npm start
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+### crontab
+_OPTIONAL._ Defines cron jobs.
+Setup cron jobs in the following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ crontab:
+ # REQUIRED. Sets the command to execute:
+ - command: ""
+ # REQUIRED. Sets the interval time to execute:
+ timing: "0 * * * *"
+```
+Read more about setting up [cron](/references/cron) in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](/elixir/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](/elixir/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+| Parameter | Description |
+| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **command** | Defines a local command to be run.
+The command has access to the same [environment variables](/elixir/how-to/create#set-secret-environment-variables) as your Elixir application.
+A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below. |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](/elixir/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Elixir > How To > Build Process
+
+
+## Description of the build process
+Zerops starts a temporary build container and performs following actions:
+1. Installs the build environment:
+ - Sets up base system and Go runtime
+ - Restores cached files if available (based on `build.cache` configuration)
+ - Validates cache against current `build.os`, `build.base`, and `build.prepareCommands`
+2. Downloads your application source code from [GitHub ↗](https://www.github.com), [GitLab ↗](https://www.gitlab.com) or via [Zerops CLI](/references/cli)
+3. Optionally [customizes the build environment](#customize-elixir-build-environment)
+4. Runs the build commands
+5. Uploads the application artefact to the internal Zerops storage
+6. Preserves specified files for future builds (based on `build.cache` configuration)
+7. Optionally [customizes the runtime environment](/elixir/how-to/customize-runtime)
+8. [Deploys your application](/elixir/how-to/deploy-process)
+The build container is automatically deleted after the build has finished or failed.
+## Cancel running build
+When you know that the running build is not correct and you want to cancel it, you can do it in Zerops GUI. Go to the service detail, open the list of running processes and click on the **Open pipeline detail** button. Then click on the **Cancel build** button.
+
+:::caution
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+:::
+## Customize Elixir build environment
+The default Elixir build environment contains:
+- {data.alpine.default}
+- selected version of Elixir defined in `zerops.yaml` [build.base](/elixir/how-to/build-pipeline#base) parameter
+- [zCLI](/references/cli), Zerops command line tool
+- `npm`, `yarn`, `git` and `npx` tools
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/elixir/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](/elixir/how-to/build-pipeline#preparecommands) commands to your `zerops.yaml`.
+:::info
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::
+## Elixir build hardware resources
+Build of your Elixir application is run in a separate build container with following resource configuration:
+| HW resource | Minimum | Maximum |
+| ------------- | ------- | ------- |
+| **CPU cores** | 6 | 20 |
+| **RAM** | 8 GB | 8 GB |
+| **Disk** | 1 GB | 100 GB |
+| **Disk** | 1 GB | 100 GB |
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+## Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops will terminate the build pipeline and delete the build container.
+## Troubleshooting build-related problems
+### Failure of a build prepare command
+If any [prepare command](/elixir/how-to/build-pipeline#preparecommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/elixir/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom build environment is ready for the build phase.
+### Invalidate the build cache
+If you encounter unexpected build behavior or dependency issues, the problem might be related to [cached build data](/features/build-cache). While Zerops maintains the build cache to speed up deployments, sometimes you may need to start fresh.
+To invalidate the build cache:
+1. Go to your service detail in Zerops GUI
+2. Choose **Pipelines & CI/CD Settings** from the left menu
+3. Click on the **Invalidate build cache** button
+This will force Zerops to run the next build clean, including all prepare commands, which can help resolve cache-related issues. After invalidation, your next build will also create a fresh cache.
+### Failure of a build command
+If any [build command](/elixir/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/elixir/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `--verbose` option.
+```yaml
+buildCommands:
+ - npm i --verbose
+ - npm run build
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the [deploy](/elixir/how-to/deploy-process) phase.
+
+----------------------------------------
+
+# Elixir > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart Elixir service in Zerops GUI
+To stop the Elixir service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped Elixir service choose the **Start** item from the same menu.
+To restart the Elixir service choose the **Restart** item from the same menu.
+## Stop and start Elixir using zCLI
+zCLI is the Zerops command-line tool. To stop and start the Elixir service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Elixir > How To > Create
+
+Zerops provides a powerful Elixir runtime service with extensive build support. The Elixir runtime is highly scalable and customizable to suit your development and production needs. With just a few clicks or commands, you can have a production-ready Elixir environment up and running in no time.
+## Create a Elixir service using Zerops GUI
+First, set up a project in the Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu under the **Services** section. From there, you can add a new Elixir service:
+### Choose a Elixir version
+Zerops supports the following Elixir versions:
+:::info
+You can easily [upgrade](/elixir/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app", "cache", "gui", etc. Duplicate services with the same name within the same project are not allowed.
+#### Limitations:
+- Maximum 25 characters
+- Must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created and cannot be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as passwords, tokens, salts, certificates, etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting secret environment variables is optional. You can always set them later in the Zerops GUI.
+Read more about the [different types of environment variables](/elixir/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Configure auto scaling
+Zerops automatically scales Elixir services both vertically and horizontally. Vertical scaling adjusts the hardware resources (CPU, RAM, and disk) of a Elixir container, while horizontal scaling adds or removes entire containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. The power your application receives depends on the other applications running on the same CPU core. In the best-case scenario, your application gets 10/10 of the CPU core power, and 1/10 in the worst-case scenario.
+**Dedicated**
+The CPU core is dedicated exclusively to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+You can choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has the following default configuration:
+Elixir services always start with the minimal resources.
+In most cases, the default parameters will work without issues. If you need to limit the cost of the Elixir service, you can lower the maximum resources. Zerops will never scale above the selected maximums.
+If you experience insufficient Elixir performance or capacity, you can increase the minimum resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine-tune](/elixir/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application's needs.
+:::
+:::info
+You can change the vertical auto scaling parameters at any time.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but is already consuming the maximum resources defined for vertical auto scaling, Zerops will add a new container to your Elixir service. When your Elixir service doesn't need as much power and all containers are vertically scaled down such that their CPU allocation is near the minimum resources, Zerops will gradually remove entire containers.
+Horizontal auto scaling has the following default configuration:
+
+ Minimum containers
+
+ 1
+
+ Maximum containers
+
+ 6
+
+Elixir services always start with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](/elixir/how-to/scaling) about Elixir auto scaling in Zerops.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will automatically start a new container and deploy your application. However, the application will be unavailable for a short period. This mode is recommended for non-critical applications or development environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers based on your application's load. An application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed down to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents temporary outages in case any of the Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically, and the broken container will be deleted.
+:::caution
+Make sure your application is designed to run in multiple containers.
+:::
+## Create a Elixir service using zCLI
+zCLI is the Zerops command-line tool. To create a new Elixir service via the command line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/elixir/how-to/create#create-a-project-description-file)
+3. [Create a project with a Elixir and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a YAML format to describe the project infrastructure.
+#### Basic example:
+Create a directory called `my-project`. Inside the `my-project` directory, create a `description.yaml` file with the following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in elixir@{version} format
+ type: elixir@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one Elixir version 20 service with default [auto scaling](/elixir/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/elixir/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Elixir and PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in elixir@{version} format
+ type: elixir@latest
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+ - # second service hostname
+ hostname: db
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain a Elixir service and a [PostgreSQL](/postgresql/overview) service.
+Elixir service with "app" hostname, the internal port(s) the service listens on will be defined later in the [zerops.yaml](/elixir/how-to/build-pipeline#ports). Elixir service will run on version 20 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+| Parameter | Description | Limitations |
+| --------------- | ------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
+| **name** | The name of the new project. Duplicates are allowed. | |
+| **description** | **Optional.** Description of the new project. | Maximum 255 characters. |
+| **tags** | **Optional.** One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects. |
+| **tags** | **Optional.** One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects. |
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains Elixir and PostgreSQL services but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [Elixir service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+ All verticalAutoscaling attributes are optional. Not specified
+ attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers
+ for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value
+ map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add Elixir service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in elixir@{version} format
+ type: elixir@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Elixir service version 20 with default [auto scaling](/elixir/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Elixir > How To > Customize Runtime
+
+
+The default Elixir runtime environment contains:
+- {data.alpine.default}
+- selected version of Elixir selected when the runtime service was created.
+-
+ `zCLI`
+
+ , Zerops command line tool
+- `npm`, `yarn`, `git` and `npx` tools
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/elixir/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more `run.prepareCommands` commands to your `zerops.yaml`.
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/elixir/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `run.prepareCommands` commands in the defined order
+### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/elixir/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+The prepare runtime container is automatically deleted after the prepare runtime phase has finished or failed.
+### Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the `build.addToRunPrepare` and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the custom runtime cache go to `yyy`
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+
+----------------------------------------
+
+# Elixir > How To > Delete
+
+## Delete Elixir service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete Elixir using zCLI
+zCLI is the Zerops command-line tool. To delete the Elixir service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Elixir > How To > Deploy Process
+
+
+## Application artefact
+When the [build phase](/elixir/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](/elixir/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/elixir/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/elixir/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/elixir/how-to/build-pipeline#initcommands)
+4. Starts your application using the [start command](/elixir/how-to/build-pipeline#start)
+5. Optionally waits until the [readiness check](/elixir/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/elixir/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customize the runtime environment](/elixir/how-to/build-pipeline#preparecommands-1).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The Elixir process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready to handle requests right after it is started via the [start command](/elixir/how-to/build-pipeline#start), configure a [readiness check](/elixir/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your Elixir service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/elixir/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Elixir > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+| environment | type | defined in |
+| ----------- | ------ | --------------------------------------------------------------------------------- |
+| build | basic | [zerops.yaml](/elixir/how-to/build-pipeline#envvariables) |
+| runtime | basic | [zerops.yaml](/elixir/how-to/build-pipeline#envvariables-1) |
+| runtime | secret | [Zerops GUI](#set-secret-env-variables-in-zerops-gui) |
+| runtime | secret | [Zerops GUI](#set-secret-env-variables-in-zerops-gui) |
+Use the [secret env variables](/elixir/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](/elixir/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/elixir/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](/elixir/how-to/create) a new Elixir service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made to environment variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The Elixir process running in the container receives the list env variables only when it starts. Update of the env variables while the Elixir process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+These restrictions apply to all [types of env variables](/elixir/how-to/env-variables#types-of-env-variables-in-zerops).
+## Referencing other env variables
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your Elixir runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the Elixir service. The Elixir process running in the container receives the list env variables only when it starts. Update of the env variables while the Elixir process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a Elixir service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your Elixir app
+Zerops passes all environment variables from all project services when your Elixir app is deployed and started.
+To access the local environment variable i.e. the variable set to this Elixir service in your app, use:
+```sh
+process.env.YOUR_VARIABLE_KEY_HERE
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+
+----------------------------------------
+
+# Elixir > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Elixir > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](/elixir/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](/elixir/how-to/build-pipeline#preparecommands-1) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the runtime containers in Zerops CLI use
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## Elixir logging configuration
+Zerops logs all messages sent
+- to the standard error (`stderr`)
+- to the standard output (`stdout`)
+- via the Elixir `console.log` method
+### Severity level
+By default the `console.log` creates a message with the `Informational (6)` severity.
+Add a severity number in the `` format as a prefix to set a custom severity as shown below:
+```js
+console.log('A message with the informational severity ...');
+console.log('Emergency (0) severity > system is unusable.');
+console.log('Alert (1) severity > action must be taken immediately.');
+console.log('Critical (2) severity > critical conditions.');
+console.log('Error (3) severity > error conditions.');
+console.log('Warning (4) severity > warning conditions.');
+console.log('Notice (5) severity > normal, but significant, condition.');
+console.log('Informational (6) severity > informational message.');
+console.log('Debug (7) severity > debug-level message.');
+```
+:::info
+`console.info`, `console.warn`, `console.debug`
+, and `console.error` are just aliases to the `
+ console.log
+` method. They don't set the appropriate severity number. Use the `
+ <N>
+` prefix instead. :::
+
+----------------------------------------
+
+# Elixir > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the Elixir service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Elixir service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Elixir service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Elixir performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Elixir service. When your Elixir service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Elixir service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each Elixir service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the Elixir service.
+### Not enough resources to scale up
+If one of the Elixir containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the Elixir service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor Elixir resources
+Zerops provides information about how much hardware resources the Elixir service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Elixir > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your Elixir service directly when creating a new shared storage service. Just select your Elixir service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the Elixir service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create Elixir service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new Elixir service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/elixir/how-to/shared-storage#create-a-project-description-file)
+3. [Create a project with a Elixir service and a shared storage](/elixir/how-to/shared-storage#create-a-project-with-a-elixir-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](/elixir/how-to/create#create-a-project-description-file) how to define the Elixir service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Elixir and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in elixir@{version} format
+ type: elixir@latest
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the Elixir service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with a Elixir service and a shared storage
+Follow the article [How to create a project based on the description.yaml](/elixir/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Elixir > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](/elixir/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](/elixir/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](/elixir/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Elixir > How To > Upgrade
+
+You can upgrade or downgrade your Elixir service to a different major Elixir version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/elixir/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Elixir version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Elixir version for your runtime.
+If you want to build your application with a different major Elixir version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
+
+----------------------------------------
+
+# Elixir > Overview
+
+[Elixir ↗](https://elixir.org/en) is an asynchronous event-driven JavaScript runtime, which is designed to build scalable network applications.
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-elixir), a **_recipe_**, containing the most simple Elixir web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of Elixir app running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-elixir/blob/main/zerops-project-import.yaml)):
+```yaml
+project:
+ name: recipe-elixir
+ tags:
+ - zerops-recipe
+services:
+ - hostname: api
+ type: elixir@1.16
+ enableSubdomainAccess: true
+ buildFromGit: https://github.com/zeropsio/recipe-elixir
+ - hostname: db
+ type: postgresql@16
+ mode: NON_HA
+ priority: 1
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://api-808-4000.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+{"message":"This is a simple Elixir application running on Zerops.io, each request adds an entry to the PostgreSQL database and returns a count. See the source repository (https://github.com/zeropsio/recipe-elixir) for more information.","newEntry":"e64be640-d6c2-4be8-93ac-d1e40e56fa06","count":1}
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+## How to start
+It doesn't matter whether it's your first curious introduction to Zerops, you have already mastered the basics and are looking for a tiny detail or inspiration. Below, choose a section that fits your needs:
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Features > Access
+
+export const languages = [
+ { name: "Bun", link: "/java/how-to/build-pipeline#ports" },
+ { name: "Deno", link: "/go/how-to/build-pipeline#ports" },
+ { name: ".NET", link: "/dotnet/how-to/build-pipeline#ports" },
+ { name: "Elixir", link: "/php/how-to/build-pipeline#ports" },
+ { name: "Gleam", link: "/dotnet/how-to/build-pipeline#ports" },
+ { name: "Go", link: "/go/how-to/build-pipeline#ports" },
+ { name: "Java", link: "/java/how-to/build-pipeline#ports" },
+ { name: "Node.js", link: "/nodejs/how-to/build-pipeline#ports" },
+ { name: "PHP", link: "/php/how-to/build-pipeline#ports" },
+ { name: "Python", link: "/python/how-to/build-pipeline#ports" },
+ { name: "Rust", link: "/rust/how-to/build-pipeline#ports" },
+]
+Zerops provides three ways to make your application accessible from the internet:
+- [Zerops subdomain](#public-access-through-zerops-subdomain) - ideal for testing and development
+- [Custom domain](#public-access-through-your-domain) - recommended for production deployments
+- [Direct port access](#opening-public-ports) - for non-HTTP protocols and specialized use cases
+Each method serves different needs and comes with its own configuration options.
+:::note
+By default, your runtime service is not publicly accessible until you configure one of these methods.
+:::
+## Public Access Through Zerops Subdomain
+For development and testing purposes, Zerops offers a quick way to make your application accessible through a `.zerops.app` subdomain. This option requires minimal configuration and includes automatic SSL certificate management.
+### Configuration Steps
+1. Navigate to your service detail page in Zerops GUI
+2. Select **Public access & internal ports** from the left menu
+3. Toggle the **Zerops subdomain access** switch
+
+Once enabled, Zerops assigns a unique subdomain for your application. If you've defined multiple [internal ports](/zerops-yaml/specification#ports-) with HTTP support in your `zerops.yaml`, each port receives its own unique `.zerops.app` subdomain.
+### Technical Details
+When using Zerops subdomains:
+- Access your application using the `https://` protocol (Zerops automatically manages SSL certificates)
+- Traffic flows through a central HTTP balancer that:
+ - Terminates SSL connections
+ - Forwards requests to your application via HTTP
+ - Handles all security certificates
+:::warning Production Limitations
+- The central HTTPS balancer is shared across all Zerops projects, which creates a scalability bottleneck
+- Maximum upload size is limited to 50MB
+- Not recommended for production traffic
+:::
+## Public Access Through Your Domain
+When your application is ready for production or you need to test with your actual domain, configure custom domain access. This method provides better performance, scalability, and full control over your domain settings.
+
+### IP Address Configuration
+Before setting up domain access, you'll need public IP addresses. Zerops offers the following IP options:
+#### IPv4 Options
+##### Dedicated IPv4 Address ($3/30 days)
+- Dedicated to your project and shared across all project services
+- One IPv4 address per project limit
+- Protects against blacklisting risks associated with shared IPs
+- Subscription automatically renews every 30 days *(cannot be purchased with promo credit)*
+ - Fee is non-refundable but address can be reused in another project until subscription ends
+- **Recommended for production workloads**
+##### Shared IPv4 Address (Free)
+- Available at no cost
+- Shared across all Zerops users and their projects
+- Limitations:
+ - Restricted number of open connections
+ - Shorter connection timeouts
+- **Not recommended for production use**
+#### IPv6 Address (Free)
+- Dedicated to your project and shared across all project services
+- One IPv6 address per project limit
+- Automatically activated with first domain setup
+- Available for all projects at no additional cost
+:::tip
+Since IPv6 support is not universal, using both IPv4 and IPv6 is recommended for maximum accessibility.
+:::
+### Configuring HTTP Routing
+To set up domain access:
+1. Go to your service detail in Zerops GUI and select **Public access & internal ports**
+2. Click **Setup first domain access**
+3. Configure your domain settings:
+ - Enter domain names (e.g., `mydomain.com`, `app.mydomain.com`)
+ - Add multiple domains if needed (useful for multi-language sites)
+ - Choose SSL certificate management
+4. Define routing rules:
+ - Source: The public path (the part of URL after your domain)
+ - Destination: Choose which application and internal port receives the traffic
+ - Add multiple routing configurations as needed
+All settings can be modified later as your needs change.
+### DNS Configuration
+After setting up domain access in Zerops, you'll need to configure your DNS records with your domain registrar.
+For detailed instructions on DNS configuration, including specific implementation details for Cloudflare, please refer to the [DNS and Proxy Setup](/features/dns) guide.
+### HTTPS Configuration
+When using Let's Encrypt certificates (recommended):
+#### Certificate Management
+- Zerops handles all certificate installation and renewal
+- Certificates are free of charge
+- No manual certificate management required
+#### Traffic Flow
+1. Traffic arrives at your public IPv4/IPv6 addresses
+2. Requests route through your project's dedicated HTTPS balancer
+3. SSL termination occurs at the balancer level
+4. Internal traffic uses HTTP protocol for optimal performance
+#### Balancer Architecture
+- Deployed in two containers for redundancy
+- Scales vertically based on traffic demands
+- Cannot be directly modified
+- Included free of charge
+## Opening Public Ports
+For applications requiring direct port access or non-HTTP protocols, Zerops provides flexible port configuration options.
+:::important
+Currently, direct public port access is only available for runtime services and PostgreSQL databases.
+:::
+
+### Port Configuration
+1. Navigate to service detail page in Zerops GUI
+ - For runtime services select **Subdomain & domain & IP access**
+ - For PostgreSQL select **Direct access through IP address**
+2. Configure your port settings:
+ - Either **Setup first access through IPv6** or activate **Unique IPv4 add-on** (if needed)
+ - Choose any port from 10-65435 (except 80 and 443)
+ - Select destination service and internal port
+ - Each public port can be mapped to any internal service port
+ - Multiple public ports can point to the same internal port if needed
+ - Port configurations can be set independently for IPv4 and IPv6
+### Firewall Configuration
+Optionally secure your ports with firewall rules:
+1. Enable firewall for specific ports
+2. Choose policy type:
+ - **Blacklist**: Block specific IPs/ranges
+ - **Whitelist**: Allow only specific IPs/ranges
+3. Configure IP rules:
+ - Single IP format affects only the specific IP
+ - IP range format affects all IPs in that CIDR range
+
+
+----------------------------------------
+
+# Features > Backup
+
+Zerops provides data backup for certain services.
+Whether a service supports backups is specified on the documentation page of each service. Technical details about backup implementation for each service are also described on their respective service pages.
+## Frequency and volume
+By default, your data is backed up automatically **every day** between 00:00:00 UTC and 01:00:00 UTC, unless you update your settings.
+### Managing Backups in GUI
+To manage backups, go to the service detail and choose **Backups List & Configuration** section in the left menu.
+#### Configure Backup Settings
+From this section, you can:
+- Do a one-time backup of your data
+- Change the frequency of your automatic backups
+- Turn off backing up your data completely
+
+#### Backup Frequency Options
+You can configure backups with several preset schedules:
+- **No backups**: Disable automatic backups (not recommended)
+- **Once a day**: Daily backups at the specified time
+- **Once a week**: Weekly backups on the specified day and time
+- **Once a month**: Monthly backups on the specified day and time
+- **Custom CRON**: Define a custom schedule using CRON syntax
+For the Custom CRON option, you can use the following syntax:
+
+ Field name
+ Allowed values
+
+ Minute
+ 0-59
+
+ Hour
+ 0-23
+
+ Day
+ 1-31
+
+ Month
+ 1-12
+
+ Week Day
+ 0–7; both 0 and 7 represent Sunday
+
+Examples:
+- `0 2 * * *` - Every day at 2:00 AM
+- `0 4 * * 0` - Every Sunday at 4:00 AM
+- `0 0 1 * *` - First day of every month at midnight
+#### View and Manage Backup Files
+In the same section, you can:
+- View all of your backups
+- Download a backup
+- Delete a backup
+
+### Limits
+- Each backup is stored for a maximum period of **1 month**
+- For each **service** a maximum of **100 backups** is stored
+- For each **project** a maximum of **25 GiB** of backup volume is stored. Only full backups are stored, the backup that exceeds the limit by its part is not stored
+If you need more backup storage space, contact our support team.
+#### Examples
+1. If you backup your data every day, and the total volume is less than 25 GiB, the maximum number of backups is ~30 for the last month. A new backup is stored every day (with the oldest one being deleted), unless you exceed the 25 GiB limit.
+2. If you backup your data every hour, and the total volume is less than 25 GiB, the total number of backups is 100 for the last 100 hours. A new backup is stored every hour (with the oldest one being deleted), unless you exceed the 25 GiB limit.
+3. If you backup your data every hour, and your backups exceed 25 GiB after 50 hours, the total number of backups is 50, unless you delete some of your backups or wait the oldest one is older than 1 month.
+## Persistence
+When deleting a service or a project:
+* Project deletion affects backups of **all** services within that project
+* Backups remain accessible for 7 days
+* After 7 days, all backups are permanently removed
+## High Availability Setup
+For services running in HA mode, the backup is created on one of the nodes at random. Other nodes report that the backup is running on another node.
+## Encryption and Security
+Backups are encrypted as soon as they are created. Here is the process:
+* **Key Generation:** We use asymmetric cryptography (X25519) to generate a private key, which is then encrypted using our secret key (RSA-OAEP) and securely stored in our database.
+* **Public Key Usage:** The public key is sent to the application, which uses it to encrypt the backup.
+* **Decryption:** When a user downloads a backup, it is decrypted using the private key stored safely in our database.
+This ensures your data remains secure during both storage and transmission.
+All backups are stored in a separate ObjectStorage instance, isolated from the instance accessible by users.
+After a project is deleted and the 7-day retention period expires, the project's encryption key is permanently deleted. Once this happens, there is no way to decrypt or restore the backup data.
+
+----------------------------------------
+
+# Features > Build Cache
+
+# Understanding Zerops Build Cache
+> Zerops implements a sophisticated two-layer caching strategy that optimizes build times while maintaining complete control over the build environment. This documentation explores the architecture, configuration patterns, and practical implementation of the build cache system.
+## Architecture Overview
+The build cache operates through two distinct layers:
+1. **Base Layer**: Comprises the OS, installed dependencies, and prepare commands
+2. **Build Layer**: Contains the state after executing build commands
+The layers work together to create an efficient and predictable build environment, though they are currently coupled in their cache invalidation behavior (invalidating one layer affects the other).
+### Cache Implementation
+The caching mechanism is implemented through an efficient file movement strategy. This approach ensures near-instantaneous cache operations through simple directory relocation within the container, implementing the following characteristics:
+- Files are moved between `/build/source` and `/build/cache` using container-level rename operations
+- No packaging, compression, or network transfer is involved
+- Cache preservation is achieved through simple directory relocation within the container
+- Files maintain their original state and permissions throughout the process
+:::note
+See detailed [build process lifecycle](#build-process-lifecycle).
+:::
+## Configuration Guide
+### Essential zerops.yaml Fields
+The following fields in `zerops.yaml` affect build cache behavior:
+**Direct Cache Configuration**:
+- `build.cache`: Explicitly defines what should be cached through paths or patterns
+**Cache Invalidation Triggers**:
+These parameters trigger cache invalidation when modified:
+- `build.os`: Base operating system selection
+- `build.base`: Pre-installed software stacks and runtimes
+- `build.prepareCommands`: System preparation and dependency installation
+- `build.cache`: Changes to cache configuration
+**Build Artifact Generation**:
+- `build.buildCommands`: Generates the build artifact that will be deployed.
+## Cache Configuration Patterns
+### Pattern 1: System-Wide Cache Control
+```yaml
+build:
+ cache: true # Cache everything
+ # OR
+ cache: false # Intended to disable all caching
+```
+The boolean values provide system-wide cache control:
+`cache: true`:
+- Preserves the entire build container state
+- Maintains system-level package installations
+- Ideal for globally installed packages (Python/PHP packages, Go modules)
+`cache: false`:
+- Intended to disable all caching
+- Currently, due to layer coupling, only files within `/build/source` are not cached
+- Everything outside `/build/source` remains cached (see [Common Pitfalls: Layer Coupling](#current-pitfalls))
+### Pattern 2: Path-Specific Caching
+```yaml
+# Single path
+build:
+ cache: node_modules
+# Multiple paths
+build:
+ cache:
+ - node_modules
+ - package-lock.json
+ - .build
+```
+Execution flow:
+1. Source code extraction to `/build/source`
+2. Build command execution
+3. Specified path preservation in `/build/cache`
+4. Cached content restoration (no-clobber mode - source files take precedence)
+:::tip
+Ideal for non-versioned dependencies in your working directory (e.g., `node_modules`, `vendor`, `.venv`).
+:::
+## Path Pattern Reference
+Zerops supports [Go's filepath.Match](https://pkg.go.dev/path/filepath#Match) syntax. Consider this example structure:
+```
+├── node_modules/
+├── package.json
+├── package-lock.json
+└── subdir/
+ ├── file1.txt
+ ├── file2.txt
+ └── file3.md
+```
+Pattern examples and matches:
+```yaml
+build:
+ cache:
+ - "subdir/*.txt" # Matches: subdir/file1.txt, subdir/file2.txt
+ - "package*" # Matches: package.json, package-lock.json
+ - "node_modules" # Matches: entire node_modules directory recursively
+```
+:::note
+All patterns resolve relative to `/build/source`. Path variations like `./node_modules`, `node_modules`, and `node_modules/` are treated identically.
+:::
+## Build Process Lifecycle
+1. **Initialization Phase**
+ - Build container startup
+ - Builder process launch
+ - Source code loading into `/build/source`
+2. **Cache Restoration Phase**
+ - Cached file movement to `/build/source` (no-clobber mode)
+ - Source file precedence handling
+ - Conflict logging (no build interruption)
+ - Cache directory cleanup
+3. **Build Execution Phase**
+ - Build command processing
+ - Artifact packaging (`build.deployFiles`)
+4. **Cache Preservation Phase**
+ - Specific cache files movement outside `/build/source`
+ - `/build/source` directory cleanup
+ - Container termination
+## Cache Invalidation Reference
+The build cache invalidates under these conditions:
+1. **Manual Triggers**
+ - API call: `DELETE /service-stack/{id}/build-cache`
+ - GUI: Manual cache clear action
+2. **Version Management**
+ - Backup app version activation via `PUT /app-version/{id}/deploy`
+3. **Configuration Changes**
+ Any modifications to:
+ ```yaml
+ build.os
+ build.base
+ build.prepareCommands
+ build.cache
+ ```
+### Current Pitfalls
+The current implementation has some important characteristics:
+1. **Layer Coupling**
+ ```yaml
+ build:
+ base: go@1
+ prepareCommands:
+ - sudo apk update
+ - sudo apk add sqlite
+ buildCommands:
+ - go build -o app main.go
+ cache: false
+ ```
+ Even with `cache: false`, Go modules outside `/build/source` remain cached.
+2. **Cascade Invalidation**
+ ```yaml
+ build:
+ base: node@22
+ prepareCommands:
+ - sudo apk update
+ - sudo apk add sqlite vim # Adding 'vim' invalidates everything
+ buildCommands:
+ - npm install
+ - npm build
+ cache:
+ - node_modules
+ ```
+ Modifying `prepareCommands` invalidates both layers, including cached `node_modules`.
+## Real-World Implementation Examples
+### Node.js Project with TypeScript
+```yaml
+build:
+ base: node@22
+ buildCommands:
+ - npm ci
+ - npm run build
+ cache:
+ - node_modules
+ - .next
+ - .turbo
+ - package-lock.json
+```
+### Go Project with Multiple Dependencies
+```yaml
+build:
+ base: go@1
+ prepareCommands:
+ - sudo apk add build-base
+ buildCommands:
+ - go mod download
+ - go build -o bin/app cmd/main.go
+ cache: true # Caches entire Go modules directory
+```
+### PHP/Laravel Project
+```yaml
+build:
+ base: php@8.3
+ buildCommands:
+ - composer install --no-dev
+ - php artisan optimize
+ cache:
+ - vendor
+ - composer.lock
+```
+## Debugging and Monitoring
+* **Build Logs**
+ - Cache operations are detailed in build logs
+ - File conflicts during restoration are logged
+ - Cache preservation status is visible
+## Implementation Best Practices
+### Cache Strategy Optimization
+1. **Layer Management**
+ - Maintain stable `prepareCommands` to prevent cache invalidation
+ - Group related prepare commands logically
+2. **Performance Optimization**:
+ - Cache package manager lock files alongside dependency directories
+ - Use system-wide caching (`cache: true`) for languages with global package managers
+3. **Performance Tuning**
+ - Leverage system-wide caching for complex builds
+ - Monitor build logs for cache operations and potential conflicts
+ - Use explicit patterns for precise control
+ - Don't over-optimize – the system handles large caches efficiently
+## Future Development
+Planned system enhancements include:
+- Layer independence implementation
+- Granular cache control mechanisms
+- Enhanced layer management capabilities
+- Improved cache invalidation patterns
+
+----------------------------------------
+
+# Features > Cdn
+
+Zerops CDN is a global content delivery network that brings your static content closer to your users, resulting in faster load times and improved user experience. Built on Nginx and Cloudflare geo-steering technology, our CDN automatically routes users to the nearest server location based on their DNS request.
+## Key Benefits
+- **Global Reach**: Serve content from strategic locations across the world
+- **Reduced Latency**: Content is delivered from the server closest to your users
+- **Simple Integration**: No complex configuration required
+## Global CDN Infrastructure
+Zerops CDN operates across **6 strategic regions** to ensure your content is always delivered from a location close to your users:
+
+ Region
+ Location
+ Coverage Area
+
+ EU
+ CZ
+ Prague, Czech Republic
+ Primary European coverage + failover for all regions
+
+ DE
+ Falkenstein, Germany
+
+ UK
+ London, United Kingdom
+ UK and surrounding areas
+
+ AU
+ Sydney, Australia
+ Australia and Oceania
+
+ SG
+ Singapore, Singapore
+ Southeast Asia
+
+ CA
+ Beauharnois, Canada
+ North America
+
+### Geo-Steering Technology
+Zerops CDN's geo-steering technology automatically routes users to the server location closest to them. Here's how it works:
+* **Automatic routing**: Users are directed to the optimal CDN node based on their geographic location
+* **Quick failover**: The DNS TTL is set to just 30 seconds, allowing fast recovery if a node fails
+* **Redundancy**: If any node becomes unavailable, Cloudflare automatically redirects traffic to the next closest node
+* **Reliable backup**: The EU region serves as the ultimate fallback - if all other nodes go down, EU will always be served in DNS
+## CDN Modes and Implementation
+Zerops CDN currently supports two distinct usage modes (with a third mode coming soon), each designed for specific content delivery needs.
+### Object Storage Mode
+Perfect for efficiently delivering media files, documents, and other static assets stored in Zerops [Object Storage](/object-storage/overview) to users across different geographical regions.
+**Setup process:**
+1. Create an Object Storage service or select an existing one
+2. Enable the CDN option for this service
+3. Set appropriate public read access policies for objects you want to serve via CDN
+**Accessing content:**
+```txt
+https://storage.cdn.zerops.app/your-bucket/path/to/file
+```
+:::tip
+Access the storage CDN URL via the `storageCdnUrl` **project** environment variable `${storageCdnUrl}/your-bucket/path/to/file`.
+:::
+### Static Mode
+Ideal for caching and delivering static website assets like HTML, CSS, JavaScript, and images served from your custom domains.
+**Setup process:**
+1. Configure domain access for your service
+2. Ensure your domains are DNS-verified and have active SSL certificates
+3. Enable CDN for the domain group
+**Accessing content:**
+```txt
+https://static.cdn.zerops.app/your-domain.com/path/to/file
+```
+:::tip
+Access the static CDN URL via the `staticCdnUrl` **project** environment variable `${staticCdnUrl}/your-domain.com/path/to/file`.
+:::
+:::warning Wildcard Domains Not Supported
+Static CDN cannot be activated for wildcard domains (e.g., *.example.com). You must use specific domain names.
+:::
+### API Mode *(Coming Soon)*
+Designed for caching API responses to reduce load on your backend services and deliver faster responses to clients.
+**Environment variable:** Once available, you'll be able to access the API CDN URL via the `apiCdnUrl` **project** environment variable.
+:::warning
+API Mode is currently under development and will be available in a future release.
+:::
+### HTML Implementation Examples
+Here's how to integrate CDN URLs in your HTML code:
+```html
+```
+### Testing Specific CDN Nodes
+For testing or debugging purposes, you can bypass the automatic geo-steering and access a specific CDN node directly:
+```
+https://{region}-{mode}.cdn.zerops.app/path/to/content
+```
+Available region prefixes: `cz`, `de`, `au`, `sg`, `uk`, and `ca`
+**Examples:**
+- Test Australia node: `https://au-storage.cdn.zerops.app/my-bucket/test.jpg`
+- Test UK node: `https://uk-static.cdn.zerops.app/my-domain.com/index.html`
+## Managing CDN Content
+### Cache Lifecycle
+Content served through Zerops CDN follows this lifecycle:
+1. **First Request**: When a user requests content not yet in the CDN cache, the request goes to the origin server (your Zerops service), and the response is cached at the CDN node
+2. **Subsequent Requests**: Further requests for the same content are served directly from the CDN cache, reducing latency and origin server load
+3. **Cache Expiration**: By default, content remains cached for 30 days unless explicitly purged
+4. **Automatic Management**: When CDN storage reaches capacity, the least recently used content is automatically removed
+:::note Important Cache Behavior
+Zerops CDN implements a fixed 30-day TTL policy. Currently, HTTP caching headers such as `Cache-Control`, `Expires`, `Pragma`, etc. do not influence CDN caching behavior. To refresh content sooner than the 30-day period, use the [purge API](#api-reference).
+Your `Cache-Control` headers will still affect browser caching behavior.
+:::
+### When to Purge Cache
+You should consider purging cached content when:
+- **Content Updates**: You've updated content but kept the same URL (e.g., updated images, CSS files)
+- **Deployment Rollouts**: You've deployed a new version of your application
+- **Emergency Removal**: You need to immediately remove content that was accidentally made public
+- **Testing Changes**: You want to ensure users see the latest version during testing
+### Purging Cached Content
+Zerops provides multiple ways to manage and purge cached content before its normal expiration:
+- **Command Line**: Use the `zsc cdn purge` [command](/references/zsc#cdn) available in all Zerops containers:
+ ```sh
+ # Purge all content for a domain
+ zsc cdn purge example.com
+ # Purge all content (wildcard)
+ zsc cdn purge example.com "/*"
+ # Purge specific file
+ zsc cdn purge example.com "/path/to/my-file$"
+ ```
+ :::important
+ - This command must be executed in any container within the project that has the CDN-enabled domain active
+ - Currently only works for [Static Mode](#static-mode) CDN
+ :::
+- **API Endpoints**: For programmatic control, use the [API endpoints](#api-reference). Here are ready-to-use curl examples for quickly purging content in your scripts:
+ ```sh
+ # Static mode: Purge all content for a domain
+ curl --location --request PUT "https://api.app-prg1.zerops.io/api/rest/public/project/$PROJECT_ID/purge-cdn/static/$DOMAIN/*" \
+ --header "Authorization: Bearer $USER_OR_ACCESS_TOKEN"
+ ```
+ ```sh
+ # Storage mode: Purge all content for object storage
+ curl --location --request PUT "https://api.app-prg1.zerops.io/api/rest/public/service-stack/$OBJECT_STORAGE_SERVICE_ID/purge-cdn/*" \
+ --header "Authorization: Bearer $USER_OR_ACCESS_TOKEN"
+ ```
+#### Purge Pattern Examples
+
+ Pattern
+ Description
+ Example
+
+ `/*`
+ Purges all content
+ Useful after major updates
+
+ `/images/*`
+ Purges all content in a directory
+ Clear all cached images
+
+ `/css/main.css$`
+ Purges a specific file
+ Update a single CSS file
+
+ `/2023*`
+ Purges content starting with pattern
+ Clear content with date prefix
+
+:::warning Pattern Rules
+- Wildcards (`*`) must be at the end of the pattern
+- Specific files must include `$` at the end
+- Nested wildcards (e.g., `/dir/*.jpg`) are not supported
+:::
+## API Reference
+Zerops provides a comprehensive set of API endpoints to manage your CDN configuration and content. For complete information about base URLs, authorization, and general API usage, please refer to our [API specification](/references/api).
+The endpoint links below will take you to the Swagger documentation with detailed request/response schemas and examples:
+### CDN Management API
+- **[Enable CDN for Storage ↗](https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicServiceStack/EnableStorageCdn)** `PUT /api/rest/public/service-stack/{id}/cdn`
+- **[Disable CDN for Storage ↗](https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicServiceStack/DisableStorageCdn)** `DELETE /api/rest/public/service-stack/{id}/cdn`
+- **[Create Object Storage with CDN ↗](https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicServiceStackObjectStorage/CreateObjectStorageV1)** `POST /api/rest/public/service-stack/object_storage_v1`
+- **[Create Domain Routing with CDN ↗](https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicPublicHttpRouting/CreatePublicHttpRouting)** `POST /api/public/public-http-routing`
+- **[Update Domain Routing with CDN ↗](https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicPublicHttpRouting/UpdatePublicHttpRouting)** `PUT /api/public/public-http-routing/{id}`
+### Cache Purge API
+- **[Purge Storage Mode Cache ↗](https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicServiceStack/PurgeStorageCdn)** `PUT /api/rest/public/service-stack/{id}/purge-cdn/{path}`
+- **[Purge Static Mode Cache ↗](https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicProject/PurgeStaticCdn)** `PUT /api/rest/public/project/{id}/purge-cdn/static/{domain}/{path}`
+- **Purge Api Mode Cache *(Coming soon)***
+## Troubleshooting
+Having issues with your CDN? Here are solutions to the most common problems:
+#### Content Not Updated After Changes
+* **Issue:** You've updated content, but users still see the old version.
+* **Possible Cause:** The CDN cache is continuing to serve the previously cached version.
+* **Solution:**
+ - Use the [purge API](#api-reference) with the specific content path
+ - For immediate changes, use versioned file names (e.g., `style.v2.css` instead of just `style.css`)
+#### Content Not Being Cached
+* **Issue:** Your content isn't being cached by the CDN.
+* **Possible Cause:** Missing public read permissions on objects.
+* **Solution:**
+ - For object storage: Check bucket and object access policies
+ - Verify the object is accessible directly before attempting CDN access
+:::note
+Remember that only publicly accessible objects will be cached by the CDN. Private objects will always be fetched directly from the origin.
+:::
+#### Environment Variables Not Available
+* **Issue:** You can't access the new CDN-related project level environment variables in your containers.
+* **Possible Cause:** When new environment variables are created, existing services need to be restarted to access them. Services created before the CDN feature release require special handling.
+* **Solution:**
+ - For services created after CDN release: Restart the service to apply the new environment variables
+ - For services created before CDN release: Add and then remove a dummy environment variable in the project settings adn restart the service
+#### Unexpected 404 Errors
+* **Issue:** Users receive 404 errors when accessing content via CDN.
+* **Possible Cause:** Incorrect CDN URL formatting or missing content at origin.
+* **Solution:**
+ - Double-check your [URL structure](#) (pay attention to domain names and paths)
+ - Verify content exists at the origin before attempting CDN access
+ - Test accessing the content directly from origin first
+**Correct URL patterns:**
+- Object Storage: `https://storage.cdn.zerops.app/your-bucket/path/to/file`
+- Static Mode: `https://static.cdn.zerops.app/your-domain.com/path/to/file`
+---
+*Need help implementing CDN in your project? Join our [Discord community](https://discord.gg/zeropsio) where our team and other Zerops users can assist you!*
+
+----------------------------------------
+
+# Features > Container Vs Vm
+
+Ever wondered why container technologies like Docker took over the development world so quickly? Let's break down the real differences between traditional VMs and containers - and why you might want to use one over the other.
+## Key Distinctions
+**Containers** are like lightweight packages that contain just your app and what it needs to run, sharing resources with your main system.
+**Virtual Machines** are like having a whole computer inside your computer. Complete with its own operating system, memory, and everything else.
+### Why Developers Love Containers
+#### They're Fast
+- Start up in seconds (not minutes)
+- Take up way less space
+- You can run many more of them on the same hardware
+#### They're Consistent
+- Works on your machine? Will work on everyone's machine
+- No more "but it works locally" problems
+- Same environment from development to production
+#### They're Simple
+- Easy to share with your team
+- Quick to update and modify
+- Less configuration headaches
+### When VMs Still Make Sense
+Sometimes you actually want a full computer-within-a-computer:
+- You need to run a completely different operating system
+- You're dealing with legacy applications that need specific system configurations
+- You require maximum isolation for security reasons
+### Real-World Comparison
+Think of it like this:
+- **Containers** are like apartments in a well-managed building (shared infrastructure, efficient, but with some limitations)
+- **VMs** are like having your own house (complete control, but with more overhead)
+## Containers and VMs in Zerops
+### Why Zerops Uses Both
+At Zerops, we use **containers** as our primary runtime environment - they're fast, efficient, and perfect for most modern development workflows. We've optimized our container infrastructure to handle nearly every type of application you might need to run.
+However, we also provide **VMs** when you need them, particularly for Docker-based workloads where the additional isolation is essential. Docker containers are a special case - on Zerops, they actually need to run inside VMs for proper security and isolation. While it's technically possible to run Docker in containers using privileged mode, this creates security vulnerabilities.
+### When to Use What
+
+ Go with Containers when:
+
+ Building modern web applications
+
+ Working with microservices
+
+ Need quick deployment and vertical scaling
+
+ Want efficient resource usage
+
+ Consider VMs when:
+
+ Running legacy applications
+
+ Need complete OS isolation
+
+ Require specific hardware access
+
+ Need to run Docker containers
+
+### Resource Allocation
+Both containers and VMs in Zerops can have guaranteed resources:
+- Specific CPU cores
+- Dedicated memory
+- Controlled disk space
+The difference isn't in resource guarantee capabilities, but rather in how these resources are managed and isolated.
+## The Bottom Line
+For most modern development work, containers are the way to go. They're faster, more efficient, and easier to work with. VMs still have their place, but unless you have a specific reason to use them, containers will usually make your life easier.
+*Remember: The goal is to spend less time managing infrastructure and more time building great applications. Choose the tool that lets you do that most effectively.*
+:::tip Pro Tip
+Not sure which to choose? Start with containers. You can always switch to VMs if you discover you need them for specific use cases.
+:::
+
+----------------------------------------
+
+# Features > Dns
+
+This guide will show you how to configure DNS records and proxy settings to work with your Zerops applications, with specific implementation details for Cloudflare.
+## DNS Configuration
+DNS records for Zerops services can be configured in two main ways:
+* **With Proxy**: Routes traffic through proxy services, providing additional security and performance features (recommended for DDoS protection)
+* **Without Proxy (DNS Only)**: Direct connection to your Zerops service's IP address
+DNS allows you to set two records based on IP address type:
+* **A** record for **IPv4** - Zerops offers either a free **shared** IPv4 or a paid **dedicated** IPv4
+* **AAAA** record for **IPv6** - Zerops provides a free **dedicated** IPv6
+### With Proxy
+#### IPv6 only
+```bash
+Type Name Content Proxy status TTL
+AAAA Proxied Auto
+```
+:::note
+Make sure your proxy service supports IPv4 to IPv6 translation for this configuration to work for **both IPv4 and IPv6** users.
+Do not add a proxied A record with shared IPv4 - doing so would prevent the proxy from properly routing IPv4 traffic to your service.
+:::
+#### Dedicated IPv4
+```bash
+Type Name Content Proxy status TTL
+A Proxied Auto
+# Optional
+AAAA Proxied Auto
+```
+:::tip
+Adding also AAAA record can be beneficial as visitors with IPv6 support will connect directly via IPv6.
+:::
+#### Shared IPv4 *(valid but NOT recommended)*
+```bash
+Type Name Content Proxy status TTL
+AAAA DNS only Auto
+A Proxied Auto
+```
+:::tip Why not?
+It does not make sense to expose your IPv6 address while proxying the shared IPv4. Use [IPv6 only](#ipv6-only) setup instead.
+:::
+### Without Proxy
+#### Shared IPv4
+```bash
+Type Name Content Proxy status TTL
+AAAA DNS only Auto
+A DNS only Auto
+```
+:::note Both A + AAAA Required
+Adding AAAA record is essential for shared IPv4 configuration as it serves as a [security measure](#understand-shared-ipv4) to prevent unauthorized domain claims.
+:::
+#### Dedicated IPv4
+```bash
+Type Name Content Proxy status TTL
+A DNS only Auto
+# Optional
+AAAA DNS only Auto
+```
+:::tip
+Adding also AAAA record can be beneficial as visitors with IPv6 support will connect directly via IPv6.
+:::
+#### IPv6 only
+```bash
+Type Name Content Proxy status TTL
+AAAA DNS only Auto
+```
+:::note
+This configuration will only work for users with IPv6 connectivity, which may limit your service accessibility.
+:::
+## Wildcard Domain Configuration
+Zerops supports wildcard domains (`*.`) that allow routing all subdomains to your project.
+### DNS Configuration
+#### Method A: Direct configuration of A and AAAA records
+Configure wildcard DNS records following the same patterns described in the [DNS Configuration](#dns-configuration) section, using `*.` in the Name field:
+```bash
+Type Name Content Proxy status TTL
+A *. DNS only/Proxied Auto
+AAAA *. DNS only/Proxied Auto
+```
+#### Method B: Using a CNAME record
+First configure A and AAAA records for your main domain (``), then set up a CNAME record:
+```bash
+Type Name Content Proxy status TTL
+CNAME *. DNS only/Proxied Auto
+```
+### Certificate Validation
+For proper HTTPS certificate functionality with wildcard domains, configure:
+```bash
+Type Name Content Proxy status TTL
+CNAME _acme-challenge. .zerops.zone DNS only Auto
+```
+This record enables Zerops to issue and verify a wildcard certificate for your domain.
+### Higher-Level Wildcard Subdomains
+You can also set up higher-level wildcard subdomains like `*..`:
+#### Method A: Direct configuration
+```bash
+Type Name Content Proxy status TTL
+A *.. DNS only/Proxied Auto
+AAAA *.. DNS only/Proxied Auto
+```
+#### Method B: Using a CNAME record
+```bash
+Type Name Content Proxy status TTL
+CNAME *.. . DNS only/Proxied Auto
+```
+or
+```bash
+Type Name Content Proxy status TTL
+CNAME *.. DNS only/Proxied Auto
+```
+For certificate validation:
+```bash
+Type Name Content Proxy status TTL
+CNAME _acme-challenge.. ..zerops.zone DNS only Auto
+```
+### Combining Main Domain and Wildcard Domain
+To use both `` and `*.`, specify both variants in your [Zerops configuration](/features/access#configuring-http-routing). Zerops automatically issues a single shared certificate for both the main domain and all its subdomains.
+## Cloudflare-Specific Configuration
+#### SSL/TLS Mode
+Set encryption mode to `Full (strict)` or `Full`
+ - Ensures end-to-end encryption
+ - *Full* mode requires any SSL certificate (even if self-signed/expired), while *Full (strict)* requires a valid certificate
+#### Certificate Management
+1. Enable Edge Certificates to allow Cloudflare to manage SSL/TLS certificates
+2. During initial setup, handle HTTPS settings in one of two ways:
+ - **Option A (Simple but Limited)**:
+ - Disable `Always Use HTTPS`
+ - **Option B (Recommended for Production)**:
+ - Keep `Always Use HTTPS` enabled
+ - Create and enable a Configuration Rule, which disables Automatic HTTPS Rewrites for this specific path:
+ ```
+ Field: URI Path
+ Operator: starts with
+ Value: /.well-known/acme-challenge/
+ ```
+ This rule disables Automatic HTTPS Rewrites for the certificate validation path.
+## Validation Steps
+Test your configuration:
+```bash
+# Check DNS resolution
+dig AAAA
+# Verify connectivity
+curl -vI https://
+# Test IPv4 access
+curl -4 -v https://
+# Test IPv6 access
+curl -6 -v https://
+```
+## Troubleshooting Guide
+1. **DNS Resolution Issues**
+ - Confirm correct record configuration
+ - Verify proxy status settings
+ - Check IPv6 address accuracy
+ - Allow time for DNS propagation (typically 5-10 minutes)
+2. **Connection Problems**
+ - Test both IPv4 and IPv6 connectivity
+ - Check proxy server status if applicable
+ - Confirm port configurations
+3. **Certificate Issues**
+ - Verify proper _acme-challenge CNAME configuration for wildcard domains
+ - Check that DNS records match the domains configured in Zerops
+ - **Cloudflare-specific certificate problems**:
+ - Verify `Always Use HTTPS` is disabled
+ - If you encounter **too many redirects** or similar SSL errors:
+ - Double-check that SSL/TLS encryption mode is set to *Full* or *Full (strict)*, not *Flexible*
+ - SSL mode might show incorrectly for newly added domains, try refreshing the page if settings appear incorrect
+## Technical Background
+### Understanding Shared IPv4 Addresses {#understand-shared-ipv4}
+Shared IPv4 allows multiple Zerops projects to use the same IPv4 address while maintaining separate routing for each project. Here's how it works:
+1. When a visitor makes a request, it first arrives at the shared IPv4 address
+2. The system looks at the domain name in the request (using SNI - Server Name Indication)
+3. For security, it checks if this domain properly resolves to your project's IPv6 address
+4. Only if IPv6 address matches your project will the traffic be routed correctly
+This is why configuring both A (IPv4) and AAAA (IPv6) records is crucial when using shared IPv4 addresses - the IPv6 record acts as a security key that helps prevent unauthorized use of the shared IPv4 address.
+### Certificate Verification Methods
+When issuing SSL/TLS certificates, different verification methods are used depending on the certificate type:
+#### HTTP-01 vs DNS-01 Verification
+- **Regular certificates** (for a single domain like ``) are typically issued using the **HTTP-01** challenge method. This verification checks that you control the domain by placing a specific file at a specific URL.
+- **Wildcard certificates** (for domains like `*.`) must be issued using the **DNS-01** challenge method. This method requires creating specific TXT records in your DNS configuration.
+### How Zerops Handles Wildcard Certificate Verification
+Zerops simplifies the DNS-01 challenge process:
+1. You create a CNAME record (e.g., `_acme-challenge. CNAME .zerops.zone`)
+2. When a certificate needs to be issued or renewed, Zerops automatically creates the required TXT records on its `zerops.zone` domain
+3. The certificate authority verifies these TXT records through the CNAME redirection
+4. Once verified, the wildcard certificate is issued without requiring manual intervention
+
+----------------------------------------
+
+# Features > Env Variables
+
+Zerops manages environment variables at two scopes: service level and project level. These variables are handled automatically without requiring `.env` files.
+## Service Variables
+Variables that are specific to individual [services](/features/infrastructure#services).
+### User-Defined Variables
+You can define service-level variables in two ways:
+#### 1. Build & Runtime Variables
+These variables are defined with `envVariables` attribute in the `build` or `run` section of your [zerops.yaml](/zerops-yaml/specification) file and are accessible within their respective containers.
+```yaml title="zerops.yaml"
+...
+ build:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: 127.0.0.1
+ DB_USER: db
+ DB_PASS: password
+ ...
+ run:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: 127.0.0.1
+ DB_USER: db
+ DB_PASS: password
+```
+See how to [reference variables](#referencing-variables) between services and between build and runtime environments.
+:::note
+Your application must be redeployed when updating environmental variables in `zerops.yaml`.
+:::
+#### 2. Secret Variables
+For storing sensitive data you don't want in your source repository. They can be updated without redeployment (though services need to be restarted).
+Secret variables can be managed through:
+##### GUI Interface
+Navigate to service details and find **Environment variables** in the menu. You can:
+- Add individual variables using the "Add secret variable" button
+- Edit individual variables through the menu that appears on hover
+- Use the bulk editor for managing multiple variables in .env format
+
+##### Import Configuration
+Create secret variables for a service with `envSecrets` attribute. See the complete [import.yaml structure](/reference/import).
+```yaml title="import.yaml"
+services:
+ ...
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'your-secret-s3-key'
+ S3_ACCESS_SECRET: 'your-s3-access-secret'
+```
+### System-Generated Variables
+Zerops automatically generates variables based on service type.
+These variables cannot be deleted and are always listed at the bottom of the environment variables page. Some are read-only (like `hostname`), while others can be edited (like `PATH`).
+These variables can also be [referenced](#referencing-variables).
+## Project Variables
+Variables that apply across all services within a [project](/features/infrastructure#projects). These provide a way to share common configuration across services.
+They work similarly to service secret variables but at project scope - they're managed through the GUI and can be updated without redeployment (though services need to be restarted).
+### User-Defined Variables
+You can set project-wide variables through:
+#### GUI Interface
+Access **Project environment variables** in your project detail to:
+- Add individual variables one by one
+- Edit individual variables
+- Use the bulk editor with .env format:
+#### Import Configuration
+Create project variables with `envVariables` attribute. See the complete [import.yaml structure](/reference/import).
+```yaml title="import.yaml"
+project:
+ ...
+ envVariables:
+ LOG_LEVEL: info
+ API_VERSION: v1
+```
+### System-Generated Variables
+Zerops automatically generates project-level variables containing that can be [referenced](#referencing-variables) from services.
+## Variable Restrictions
+All environment variables must follow these restrictions:
+### Key
+- Alphanumeric characters only (use `_` to separate words)
+- Must be unique within their scope
+- Case-sensitive
+### Value
+- ASCII characters only
+- No EOL characters
+## Variable Management
+### Variable Precedence
+When the same environment variable key exists in multiple places, Zerops follows these precedence rules:
+1. Service-level variables take precedence over project variables
+2. Within service-level:
+ - Build/runtime variables override secret variables
+ - Build and runtime containers are separate environments
+### Referencing Variables
+You can reference other variables using the `${variable_name}` syntax:
+#### Within Same Service
+```yaml
+envVariables:
+ id: 42069
+ hostname: app
+ name: ${id}-${hostname} # Results in: 42069-app
+```
+#### Across Services
+Prefix variables with their respective service name:
+```yaml
+setup: dbtest
+ run:
+ envVariables:
+ connectionString: 127.0.0.1
+setup: app
+ run:
+ envVariables:
+ dbConnection: ${dbtest_connectionString}
+```
+#### Between Build and Runtime Environments
+Build and runtime are two distinct environments in Zerops. Each environment can have its own set of variables, and you can use the same variable names in both environments since they are separate. Due to this separation, variables defined in one are not automatically accessible in the other.
+To share variables between environments, you need to use specific prefixes:
+- Use `RUNTIME_` prefix to access runtime variables during build
+- Use `BUILD_` prefix to access build variables during runtime
+Here's an example of `zerops.yaml` file showing how to reference a runtime variable during build:
+```yaml title="zerops.yaml"
+build:
+ envVariables:
+ API_KEY: ${RUNTIME_API_KEY} # Using runtime variable during build
+run:
+ envVariables:
+ API_KEY: "12345-abcde" # Referenced in build with RUNTIME_ prefix
+```
+#### Project Variables
+No prefix needed when referencing project variables:
+```yaml title="import.yaml"
+project:
+ ...
+ envVariables:
+ projectName: devel
+```
+```yaml title="zerops.yaml"
+envVariables:
+ id: 42069
+ hostname: app
+ name: ${projectName}-${hostname} # Results in: devel-app
+```
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Features > Infrastructure
+
+Zerops organizes your infrastructure into three hierarchical levels: **projects**, **services**, and **containers**.
+## Projects
+A project is the top-level entity in Zerops, functioning as a private network where services can communicate internally and share environment variables. Each project provides essential infrastructure including load balancing, routing, and container orchestration.
+:::tip
+Consider your project organization strategy carefully. You can create separate projects for different environments or consolidate multiple applications in a single project to optimize resource usage.
+:::
+### Key Project Features
+Projects provide several important capabilities:
+- **Private Networking**: All services within a project share a secure network
+- **Environment Variables**: Services can access shared environment variables
+- **IPv6/IPv4 Addressing**: Each project receives an IPv6 address, with optional IPv4 addressing
+### Project Core
+When you create a project, it requires a functioning **core** that includes:
+- Logger and statistics services
+- HTTP routing with automatic SSL certificate management
+- IP routing with integrated firewall
+Zerops offers two core types to match different needs and budgets:
+### Lightweight Core
+Our single-container solution that packs everything you need to get started quickly. Includes a project controller, L3 balancer, firewall, logger, statistics, and HTTP handling—all in one efficient package. Perfect for development projects and smaller production workloads where simplicity matters. Automatically handles SSL certificates and load balancing without complex setup.
+### Serious Core
+Enterprise-grade infrastructure designed for mission-critical applications. Separates core services across multiple containers for true redundancy and high availability. Includes redundant project controllers and balancers, dedicated statistics and logging services, and advanced HTTP management. Ideal when your production workloads demand maximum reliability and scalability without compromise.
+### Features Comparison
+Compare our core infrastructure options side-by-side to find the right fit for your project needs, from resource allocations to available features:
+
+ Lightweight Core
+ Serious Core
+
+ Infrastructure
+ Single container (limited redundancy)
+ Multi-container (highly available)
+
+ SSL Termination
+
+ Automatic Certificate Generation
+
+ Proxy / Load Balancer
+
+ IPv6 Address
+
+ Build Time
+ 15 hours
+ 150 hours
+
+ Backup Space
+ 5 GB
+ 25 GB
+
+ Egress
+ 100 GB
+ 3 TB
+
+ Failover Protection
+ Limited
+ Comprehensive
+
+For detailed pricing information on both core types, visit our [pricing page](/features/pricing#project-core-plans).
+## Services
+Services encapsulate your containers and provide specific functionality. A project can contain unlimited services, each with its own purpose.
+Services in Zerops can be:
+- **Fully managed**: Zerops handles scaling, routing, and repairs automatically
+- **Partially managed**: You maintain control over certain management aspects
+## Containers
+Containers are the most granular level of the Zerops architecture. Each service consists of one or more containers that work together to deliver functionality.
+In High Availability (HA) mode, a service may utilize multiple containers with different roles. For example, a fully managed MariaDB service might use 5 containers: 3 for the database and 2 for proxies.
+Containers in Zerops:
+- Use predefined images ranging from fully managed databases to customizable Ubuntu environments
+- Can be exposed to the public via Zerops subdomains, custom domains, or public ports (for applicable service types only)
+- Operate within the service's resource constraints
+
+----------------------------------------
+
+# Features > Pipeline
+
+export const languages = [
+ { name: "Node.js", link: "/nodejs/how-to/env-variables#how-to-read-env-variables-from-your-nodejs-app" },
+ { name: "PHP", link: "/php/how-to/env-variables#how-to-read-env-variables-from-your-php-app" },
+ { name: "Python", link: "/python/how-to/env-variables#how-to-read-env-variables-from-your-python-app" },
+ { name: "Go", link: "/go/how-to/env-variables#how-to-read-env-variables-from-your-go-app" },
+ { name: ".NET", link: "/dotnet/how-to/env-variables#how-to-read-env-variables-from-your-dotnet-app" },
+ { name: "Rust", link: "/rust/how-to/env-variables#how-to-read-env-variables-from-your-rust-app" }
+]
+export const builds = [
+ { name: "Node.js", link: "/nodejs/how-to/build-process##nodejs-build-hardware-resources" },
+ { name: "PHP", link: "/php/how-to/build-process#php-build-hardware-resources" },
+ { name: "Python", link: "/python/how-to/build-process#python-build-hardware-resources" },
+ { name: "Go", link: "/go/how-to/build-process#go-build-hardware-resources" },
+ { name: ".NET", link: "/dotnet/how-to/build-process#dotnet-build-hardware-resources" },
+ { name: "Rust", link: "/rust/how-to/build-process#rust-build-hardware-resources" },
+ { name: "Java", link: "/java/how-to/build-process#java-build-hardware-resources" },
+]
+export const customizeBuild = [
+ { name: "Node.js", link: "/nodejs/how-to/build-process#customize-nodejs-build-environment" },
+ { name: "PHP", link: "/php/how-to/build-process#customize-php-build-environment" },
+ { name: "Python", link: "/python/how-to/build-process#customize-python-build-environment" },
+ { name: "Go", link: "/go/how-to/build-process#customize-go-build-environment" },
+ { name: ".NET", link: "/dotnet/how-to/build-process#customize-net-build-environment" },
+ { name: "Rust", link: "/rust/how-to/build-process#customize-rust-build-environment" },
+ { name: "Java", link: "/java/how-to/build-process#customize-java-build-environment" },
+]
+export const customizeRuntime = [
+ { name: "Node.js", link: "/nodejs/how-to/customize-runtime" },
+ { name: "PHP", link: "/php/how-to/customize-runtime" },
+ { name: "Python", link: "/python/how-to/customize-runtime" },
+ { name: "Go", link: "/go/how-to/customize-runtime" },
+ { name: ".NET", link: "/dotnet/how-to/customize-runtime" },
+ { name: "Rust", link: "/rust/how-to/customize-runtime" },
+ { name: "Java", link: "/java/how-to/customize-runtime" },
+]
+## Configure the pipeline
+Zerops provides a customizable build and runtime environment for your application.
+Start by adding a [zerops.yaml](/zerops-yaml/specification) file to the **root of your repository** and modify it to fit your application.
+Here is a basic example for a Node.js application:
+```yaml
+zerops:
+ - setup: api
+ build:
+ base: nodejs@20
+ buildCommands:
+ - npm i
+ - npm run build
+ deployFiles: ./dist
+ cache: node_modules
+ run:
+ base: nodejs@20
+ start: npm start
+```
+The zerops.yaml in your repository tells Zerops how to build and deploy your application.
+Zerops will follow these instruction when the build & deploy pipeline is triggered for the Node.js service named `api`:
+1. Create a standard build environment with the Node.js v.20 preinstalled.
+2. Build your app using these commands: `npm i`, `npm run build`
+3. Create a standard runtime environment with the Node.js v.20 preinstalled.
+4. Deploy the built artefact from the `./dist` folder to the runtime container
+5. Cache the content of the `./node_modules` folder for the next build
+6. Start your application using the `npm start` command
+Learn more about all `zerops.yaml` parameters for your runtime:
+## Trigger the pipeline
+
+### Automatically
+Trigger the build & deploy pipeline automatically with each push to the selected branch or with a new tag. Create a new runtime service and connect it to your GitHub repository or GitLab repository.
+
+### Manually
+To start a new build & deploy pipeline manually, use the [Zerops CLI](/references/cli). zCLI is the Zerops command-line tool.
+The [zcli service push](/references/cli/commands#service-push) command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the build pipeline defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the `--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+If you just want to [deploy](#deploy-phase) your already built application to Zerops, use the zcli service deploy command instead.
+## Build phase
+
+Zerops starts a temporary build container and performs following actions:
+1. Installs the build environment.
+2. Downloads your application source code from [GitHub ↗](https://www.github.com), [GitLab ↗](https://www.gitlab.com) or via [Zerops CLI].
+3. Optionally customizes the build environment.
+4. Runs the build commands.
+5. Uploads the application artefact to the internal Zerops storage and prepares it for the deploy.
+6. Optionally [caches](/features/build-cache) the selected files for the next build.
+The build container is automatically deleted after the build has finished or failed.
+### Build hardware resources
+Each runtime service have different HW resources for build containers:
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+### Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops terminates the build pipeline and deletes the build container.
+### Customize the build environment
+Each runtime service in Zerops has a default build environment with a major version based on the [build.base](/zerops-yaml/specification#base-) attribute in `zerops.yaml`.
+To install additional packages or tools add one or more [build.prepareCommands](/zerops-yaml/specification#preparecommands-) commands to your `zerops.yaml`.
+Learn more about what is included in the default build environment:
+## Deploy phase
+
+### Application artefact
+When the [build phase](/dotnet/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](/dotnet/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/dotnet/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+### First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/go/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/go/how-to/build-pipeline#initcommands)
+4. Starts your application using the [start command](/go/how-to/build-pipeline#start)
+5. Optionally waits until the [readiness check](/go/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/go/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customize the runtime environment](/go/how-to/customize-runtime).
+:::
+### Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The PHP process inside each of the old containers is terminated and all old containers are gradually deleted.
+### Readiness checks
+If your application isn't ready to handle requests right after it is started via the [start command](/nodejs/how-to/build-pipeline#start), configure a [readiness check](/nodejs/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your Node.js service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/nodejs/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Customize the runtime environment
+Each runtime service in Zerops has a default runtime environment with a major version based on the [run.base](/zerops-yaml/specification#base--1) attribute in `zerops.yaml`.
+To install additional packages or tools add one or more [run.prepareCommands](/zerops-yaml/specification#preparecommands--1) commands to your `zerops.yaml`.
+Learn more about what is included in the default runtime environment:
+
+When the first deploy with a defined [prepareCommands](/zerops-yaml/specification#preparecommands--1) attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container]
+3. run the [run.prepareCommands](/zerops-yaml/specification#preparecommands--1) commands in the defined order
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](/zerops-yaml/specification#addtorunprepare-) and [run.prepareCommands](/zerops-yaml/specification#preparecommands--1) attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+## Manual deploy using Zerops CLI
+
+To start only a deploy pipeline, use the [Zerops CLI](/references/cli). zCLI is the Zerops command-line tool.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatically) or [manual](#manually) build process.
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+## Manage build and deploys
+### Cancel running build
+When you know that the running build is not correct and you want to cancel it, you can do it in Zerops GUI. Go to the service detail, open the list of running processes and click on the **Open pipeline detail** button. Then click on the **Cancel build** button.
+
+:::caution
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+:::
+### Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+### Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Features > Scaling Ha
+
+## What is automatic scaling?
+Zerops scales your application or a database based on the current load. If your application isn't used so often the auto scaling reduces the amount of required hardware resources and thus reduces the costs. If your application is used more, then auto scaling increases the resources for the application to make sure it runs smoothly even with the higher demand.
+On Zerops, you never pay for resources you don't need. At the same time you don't have to worry about traffic peaks or fast growth as the auto scaling feature handles this with no trouble. By default Zerops scales the applications and databases based on the best practices but you are always in control. Set the ranges for the auto scaling and fine-tune the settings so it fits the exact project and environment needs.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+## Auto scaling configuration for runtimes
+Both minimum and maximum limits for auto scaling are under your control. Technical minimums for CPU cores, RAM and Disk are preset for each runtime service. Configure the minimums and maximums CPU cores, RAM and Disk depending on the needs of your application and Zerops will scale them within defined limits.
+You can change the settings any time, Zerops will update the number of containers and their allocated resources accordingly.
+## Shared vs. dedicated CPU
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is dependent on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+Your application gets exclusive access to the full physical CPU core. This means the entire processing power is guaranteed and reserved only for your application, ensuring consistent and predictable performance without any resource contention from other applications. This mode is ideal for production environments and CPU-intensive workloads where performance stability is critical.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#shared-vs-dedicated-cpu) to dedicated to allocate the stable CPU power to your application.
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Auto scaling configuration for databases
+Vertical auto scaling configuration for databases is identical to runtime services. Technical minimums for CPU cores, RAM and Disk are preset according to the database type and version.
+You can choose 2 modes for each database: **Single Container** or **Highly Available** mode. The mode cannot be changed after the database is created.
+### Database in the Single Container mode
+In the **Single Container** mode the database is deployed in a single container. The number of containers cannot be increased. This mode is useful for non-essential data or dev environments.
+Your data is stored only in a single container. If the container or the underlying physical machine fails, your data since the last backup will be lost. Zerops is not able to provide any automatic repair of single container mode databases.
+### Database in the Highly Available mode
+If the **Highly Available** mode is chosen, Zerops will deploy the database cluster with a fixed number of containers and control mechanisms for automatic cluster repair.
+The KeyDB (Redis) cluster consists of 2 containers in the master-master replica. MariaDB and PostgreSQL databases are deployed in 3 containers connected in the High Availability cluster with 2 additional load balancers which ensures high reliability.
+You are not charged for the resources consumed by load balancers.
+This mode is highly recommended for production use.
+### Prevent the data loss by using the HA mode
+Zerops always keeps the database containers on different physical machines. All your data is stored redundantly in 3 identical copies (2 in case of Redis). In case of a failure of a container or the underlying physical machine, Zerops automatically disconnects the failed container from the cluster, creates a new container and syncs all data from the remaining copies. Finally the broken container is automatically deleted.
+## Auto scaling configuration for shared storage
+Vertical auto scaling configuration for shared storage is identical to database. Technical minimums for CPU cores, RAM and Disk are preset.
+You can choose 2 modes for a shared storage service: Single Container or Highly Available mode. The mode cannot be changed after the shared storage is created.
+### Single Container mode shared storage
+In the **Single Container** mode the shared storage is deployed in a single container. The number of containers cannot be increased. This mode is useful for non-essential data or dev environments.
+Your data is stored only in a single container. If the container or the underlying physical machine fails, your data since the last backup will be lost. Zerops is not able to provide any automatic repair of single container mode shared storages.
+### Highly Available mode shared storage
+If the **Highly Available** mode is chosen, Zerops will deploy the shared storage cluster with 3 containers and control mechanisms for automatic cluster repair.
+This mode is highly recommended for production use.
+### Prevent the data loss by using the HA mode
+Zerops always keeps the shared storage containers on different physical machines. All your data is stored redundantly in 3 identical copies. In case of a failure of a container or the underlying physical machine, Zerops automatically disconnects the failed container from the cluster, creates a new container and syncs all data from the remaining copies. Finally the broken container is automatically deleted.
+
+----------------------------------------
+
+# Frameworks > Laravel
+
+# Laravel on Zerops
+> Modern Laravel development demands infrastructure that doesn't get in your way. Zerops provides the foundation that lets you focus on building great apps, not wrestling with environment configuration or resource management.
+## Why Zerops for Laravel?
+Zerops implements what we call "transparent infrastructure" - you get enterprise-grade capabilities with development-friendly ergonomics. This means:
+- **Full system access** across all environments
+- **Granular resource control** starting at 0.125GB RAM
+- **True environment parity** from local to production
+- **Zero-downtime deployments** by default
+*No artificial limitations, no framework-specific compromises - just solid infrastructure that lets Laravel do what it does best.*
+:::tip
+New Zerops accounts receive $15 in free credits for testing. After verifying your account with a $10 initial payment, you'll get an additional $50 in credits.
+:::
+## Quick Start
+Choose a recipe that matches your needs and deploy with a single click. Each recipe sets up a complete environment with all necessary services preconfigured.
+All recipes include:
+- **PHP 8.3 + Nginx**
+- **PostgreSQL 16**
+- **L3/L7 balancers**
+- **Logging & metrics**
+
+ The most bare-bones examples of Laravel app including core services + PostgreSQL.
+
+ A full-stack setup including Redis, Object Storage, and Mailpit.
+
+ Admin panel optimized setup including Redis, Object Storage, and Mailpit.
+
+ Content management focused setup including Redis, Object Storage, and Mailpit.
+
+## Core Features
+### Infrastructure and Security
+Each project runs in its own isolated network with enterprise-level security features automatically configured.
+What makes this special is how it combines security with simplicity - this infrastructure requires zero configuration from you – it's all handled automatically when you create your project.
+### Native Service Discovery
+Services within your project communicate seamlessly using internal hostnames:
+```php title=".env"
+DB_HOST=${db_hostname}
+REDIS_HOST=${cache_hostname}
+```
+*Environment variables are automatically injected and synchronized across all containers.*
+### Intelligent Scaling
+One of Zerops' most powerful features is its intelligent autoscaling system, which:
+* Scales resources (CPU, RAM, Disk) up and down based on actual usage
+* Maintains minimum required resources to optimize costs
+* Handles both vertical and horizontal scaling automatically
+* Manages disk space dynamically (a unique feature in the industry)
+Through a simple configuration, you define resource boundaries while Zerops automatically handles the complex scaling decisions:
+```yaml
+# Example scaling configuration
+services:
+ - hostname: app
+ minContainers: 2
+ maxContainers: 6
+ cpu:
+ min: 1
+ max: 4
+ ram:
+ min: 0.25
+ max: 4
+```
+### Zero-Downtime Deployments
+Deploy with confidence using our battle-tested pipeline:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ base: php@8.3
+ buildCommands:
+ - composer install --no-dev --optimize-autoloader
+ deployFiles: ./
+ cache: vendor
+ run:
+ base: php-nginx@8.3
+ initCommands:
+ - php artisan config:cache
+ - php artisan route:cache
+ - php artisan migrate --force --isolated
+```
+### High Availability
+Every service can run in HA mode with automatic failover.
+```yaml
+services:
+ - hostname: db
+ type: postgresql@16
+ mode: HA # Automatic primary-replica setup
+ - hostname: cache
+ type: valkey@7.2
+ mode: HA # Redis cluster configuration
+```
+Setting up a production-grade HA database cluster typically requires deep DevOps expertise. Zerops automates this complexity, giving you an enterprise-grade setup with a single configuration flag:
+* **Database Cluster** distributed across multiple physical servers
+* **Automatic failover** and data replication
+* **Enhanced performance** through load distribution
+* **Production-grade reliability** out of the box
+## Development Workflow
+### Team Collaboration
+Zerops enables seamless team development through:
+* **Declarative Infrastructure** - version control your entire setup
+* **Identical Environments** - every team member gets production-parity
+* **Automated Setup** - new team members are productive in minutes
+* **Transparent Configuration** - easily review and audit changes
+### Local Development
+Connect to your production-grade databases without any local setup through Zerops' VPN.
+Start with
+```
+zcli vpn up
+```
+and select your project. Get your database credentials from the service's **Access details** in your project dashboard and update your local `.env`. See PostgreSQL example below:
+```yaml
+DB_CONNECTION=pgsql
+DB_HOST=db.zerops # References the service's hostname
+DB_PORT=5432
+DB_DATABASE=db
+DB_USERNAME=db
+DB_PASSWORD=[password from Access details]
+```
+With this configuration, you can use any database tool - no local installation needed.
+### Deployment Options
+Choose the workflow that fits your team:
+1. **GitHub/GitLab Integration**
+ - Automatic deployments on push/merge
+ - Branch-specific environments
+ - Build caching and artifacts
+2. **CLI-Driven Pipeline**
+ ```bash
+ # Deploy from your terminal
+ zcli push
+ ```
+3. **Manual Triggers**
+ - Deploy specific versions
+ - Roll back to previous states
+ - Test deployment configurations
+## Next Steps
+- [Environment Variables](/frameworks/laravel/env-variables)
+- [Database Migrations](/frameworks/laravel/migrations)
+- [Cache & Queue with Redis](/frameworks/laravel/redis)
+- [Schedule Jobs & CRON](//frameworks/laravel/cron)
+- [SMTP Configuration](/frameworks/laravel/smtp)
+- [Logs](/frameworks/laravel/logs)
+## Resources
+- [Laravel Documentation](https://laravel.com/docs)
+- [Laravel Recipe Repository](https://github.com/zeropsio/recipe-laravel-minimal)
+- [zCLI Documentation](/references/cli)
+*Need help? Join our [Discord community](https://discord.gg/zeropsio) or check out our [quickstart guide](/frameworks/laravel/introduction).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Cron
+
+Zerops provides a convenient way for managing scheduled tasks through CRON jobs, configured directly in your `zerops.yaml` file. These tasks can be scheduled to run on single or multiple containers with granular timing control.
+## Basic Configuration
+Cron jobs are defined in the `run.crontab` section of your `zerops.yaml`. Each job requires two essential parameters:
+- **command**: The command to execute
+- **timing**: The CRON schedule expression
+```yaml
+run:
+ crontab:
+ - command: "date >> /var/log/cron.log"
+ timing: "0 * * * *"
+```
+This example logs the current timestamp every hour.
+:::tip Detailed Configuration
+For comprehensive configuration options and examples, refer to our [CRON configuration guide](/zerops-yaml/cron).
+:::
+## Common Implementation Patterns
+### Laravel Scheduler
+To run Laravel's scheduler, configure it to execute every minute:
+```yaml
+run:
+ crontab:
+ - command: "php artisan schedule:run"
+ timing: "* * * * *"
+ workingDir: /var/www/html
+```
+### Cleanup Tasks
+Execute maintenance tasks on all containers:
+```yaml
+run:
+ crontab:
+ - command: "rm -rf /tmp/*"
+ timing: "0 0 * * *"
+ allContainers: true
+```
+### Multiple Jobs
+Configure multiple scheduled tasks within a single service:
+```yaml
+run:
+ crontab:
+ - command: "php artisan schedule:run"
+ timing: "* * * * *"
+ workingDir: /var/www/html
+
+ - command: "php artisan cache:clear"
+ timing: "0 0 * * *"
+ workingDir: /var/www/html
+
+ - command: "php artisan queue:restart"
+ timing: "0 */6 * * *"
+ workingDir: /var/www/html
+```
+## Best Practices
+1. **Log Output**: Implement comprehensive logging for debugging and monitoring:
+ ```yaml
+ command: "php artisan schedule:run >> /var/log/scheduler.log 2>&1"
+ ```
+2. **Working Directory**: Always specify `workingDir` for Laravel commands to ensure they are executed from the correct location.
+3. **Container Selection**: Use `allContainers: true` carefully to avoid duplicate operations in a multi-container setup.
+4. **Timing Considerations**: Schedule intensive tasks during off-peak hours.
+## Monitoring
+Enable detailed scheduler [logging](/frameworks/laravel/logs) in your `.env`:
+```
+LOG_CHANNEL=daily
+```
+
+----------------------------------------
+
+# Frameworks > Laravel > Env Variables
+
+Zerops manages environment variables without requiring manual `.env` files, enabling application deployment across different environments (development, staging, production) while keeping environment-specific configurations isolated from your code.
+Read more about how [environment variables](/features/env-variables) work in Zerops.
+## Laravel Environment Variables in Zerops
+### Secret Variables
+Some Laravel variables contain sensitive information that should never be exposed as plain text. Manage these using Zerops Secret Variables by:
+* Creating and managing them through the Zerops GUI
+* Defining them in a configuration file when importing a project or service (allows [automatic generation](#automatic-generation-during-import))
+When importing a project or service, you can define secret variables directly in your import configuration:
+```yaml
+services:
+ - hostname: app
+ type: php-nginx@8.4
+ envSecrets:
+ APP_KEY: your-secret-key
+```
+:::tip
+Secret variables can be updated at any time without requiring application redeployment.
+:::
+#### Automatic Generation During Import
+If you prefer to have certain secrets **generated automatically**, you can use the [yaml preprocessor](/references/import-yaml/pre-processor). This is optional and only available during import:
+```yaml
+#yamlPreprocessor=on
+services:
+ - hostname: app
+ type: php-nginx@8.4
+ envSecrets:
+ APP_KEY: )>
+```
+### Runtime Variables
+These variables, defined in `zerops.yaml`, are typically environment-specific but not sensitive.
+:::note
+Changes to runtime variables require application redeployment to take effect.
+:::
+Below is a complete working example of `envVariables` in `zerops.yaml` (sourced from [Laravel Jetstream recipe](https://github.com/zeropsio/recipe-laravel-jetstream/blob/main/zerops.yaml)):
+```yaml title="zerops.yaml"
+run:
+ envVariables:
+ APP_LOCALE: en
+ APP_FAKER_LOCALE: en_US
+ APP_FALLBACK_LOCALE: en
+ APP_MAINTENANCE_DRIVER: file
+ APP_MAINTENANCE_STORE: database
+ APP_TIMEZONE: UTC
+ APP_URL: ${zeropsSubdomain} # References generated variable
+ ASSET_URL: ${APP_URL}
+ VITE_APP_NAME: ${APP_NAME}
+ # PostgreSQL connection settings
+ DB_CONNECTION: pgsql
+ DB_DATABASE: db
+ DB_HOST: db # References database service hostname
+ DB_PASSWORD: ${db_password} # References database password
+ DB_PORT: 5432
+ DB_USERNAME: ${db_user} # References database user
+ # S3-compatible object storage settings
+ AWS_ACCESS_KEY_ID: ${storage_accessKeyId}
+ AWS_REGION: us-east-1
+ AWS_BUCKET: ${storage_bucketName} # References bucket name of service 'storage'
+ AWS_ENDPOINT: ${storage_apiUrl}
+ AWS_SECRET_ACCESS_KEY: ${storage_secretAccessKey} # Safely references secret
+ AWS_URL: ${storage_apiUrl}/${storage_bucketName}
+ AWS_USE_PATH_STYLE_ENDPOINT: true
+ FILESYSTEM_DISK: s3
+ # Logging Configuration
+ LOG_CHANNEL: syslog
+ LOG_LEVEL: debug
+ LOG_STACK: single
+ # SMTP settings for email delivery
+ MAIL_FROM_ADDRESS: hello@example.com
+ MAIL_FROM_NAME: ZeropsLaravel
+ MAIL_HOST: mailpit # References mail service hostname
+ MAIL_MAILER: smtp
+ MAIL_PORT: 1025
+ # Redis-based caching and session management
+ BROADCAST_CONNECTION: redis
+ CACHE_PREFIX: cache
+ CACHE_STORE: redis
+ QUEUE_CONNECTION: redis
+ REDIS_CLIENT: phpredis
+ REDIS_HOST: valkey # References Redis service hostname
+ REDIS_PORT: 6379
+ SESSION_DRIVER: redis
+ SESSION_ENCRYPT: false
+ SESSION_LIFETIME: 120
+ SESSION_PATH: /
+ # Security Configuration
+ BCRYPT_ROUNDS: 12
+ TRUSTED_PROXIES: "*"
+```
+Let's look at variable configurations that may need additional context and where to find detailed implementation guides:
+#### Application Configuration
+Core application settings that define your Laravel app's identity, URL structure, and environment parameters. Reference environment variables from the same service.
+```yaml
+APP_URL: ${zeropsSubdomain} # zeropsSubdomain variable is system generated
+ASSET_URL: ${APP_URL}
+VITE_APP_NAME: ${APP_NAME} # APP_NAME variable was created during import (envSecrets)
+```
+#### Database Configuration
+Essential database connection parameters that securely reference your PostgreSQL service `db` by hostname and its variables - `password` and `user`.
+It is safe to store `DB_PASSWORD` in `envVariables` by reference as it does not contain the sensitive value itself.
+```yaml
+DB_HOST: db
+DB_PASSWORD: ${db_password}
+DB_USERNAME: ${db_user}
+```
+Read more about [database management](/frameworks/laravel/migrations) for Laravel in Zerops.
+#### Storage Configuration
+S3-compatible object storage settings that enable efficient file handling and asset management in your Laravel application. Reference variables of Object storage service called `storage`.
+```yaml
+AWS_ACCESS_KEY_ID: ${storage_accessKeyId}
+AWS_REGION: us-east-1
+AWS_BUCKET: ${storage_bucketName}
+AWS_ENDPOINT: ${storage_apiUrl}
+AWS_SECRET_ACCESS_KEY: ${storage_secretAccessKey}
+AWS_URL: ${storage_apiUrl}/${storage_bucketName}
+AWS_USE_PATH_STYLE_ENDPOINT: true
+FILESYSTEM_DISK: s3
+```
+Read more about [object storage](/object-storage/overview) in Zerops.
+#### Logging Configuration
+System monitoring and debugging configuration that determines how your application tracks events and errors. Use `syslog` channel to access logs from Zerops Dashboard.
+```
+LOG_CHANNEL: syslog
+```
+Learn how to properly [configure logging](/frameworks/laravel/logs) for Laravel in Zerops.
+#### Mail Configuration
+SMTP server settings that enable your application to send emails through a dedicated mail service. Reference service `mailpit` by hostname.
+```
+MAIL_HOST: mailpit
+```
+Learn how to properly [configure SMTP](/frameworks/laravel/smtp) for Laravel in Zerops.
+#### Cache and Session
+Redis-based configuration for handling application caching, queues, and session management to optimize performance. Reference service `valkey` by hostname.
+```
+REDIS_HOST: valkey
+```
+Learn how to properly [configure cache, queue & session management](/frameworks/laravel/redis) for Laravel in Zerops.
+:::tip
+For automatic execution with each deploy, add these commands to the `initCommands` section of your `zerops.yaml` file.
+```yaml title="zerops.yaml"
+initCommands:
+ - php artisan view:cache
+ - php artisan config:cache
+ - php artisan route:cache
+```
+:::
+
+----------------------------------------
+
+# Frameworks > Laravel > Faq
+
+ Question: How do I configure environment variables?
+Answer:
+ You can set environment variables through the Zerops dashboard or in your `zerops.yaml` file under the `run.envVariables` section:
+ ```yaml
+ zerops:
+ - setup: app
+ run:
+ envVariables:
+ APP_KEY: "base64:your-key-here"
+ DB_CONNECTION: "pgsql"
+ DB_HOST: ${db_host}
+ ```
+
+ Question: How do I run database migrations?
+Answer:
+ You can run migrations during initialization by adding the command to your `zerops.yaml`:
+ ```yaml
+ zerops:
+ - setup: app
+ run:
+ initCommands:
+ - php artisan migrate --isolated --force
+ ```
+
+ Question: Can I use Laravel queue with Zerops?
+Answer:
+ Yes, Laravel Queue is fully supported. Configure Redis as your queue driver:
+ ```yaml
+ zerops:
+ - setup: app
+ run:
+ envVariables:
+ QUEUE_CONNECTION: redis
+ REDIS_HOST: redis
+ REDIS_PORT: 6379
+ ```
+
+ Question: How do I handle file storage?
+Answer:
+ Zerops supports S3-compatible storage. Configure it using these environment variables:
+ ```yaml
+ zerops:
+ - setup: app
+ run:
+ envVariables:
+ FILESYSTEM_DISK: s3
+ AWS_ACCESS_KEY_ID: ${storage_accessKeyId}
+ AWS_SECRET_ACCESS_KEY: ${storage_secretAccessKey}
+ AWS_BUCKET: ${storage_bucketName}
+ AWS_ENDPOINT: ${storage_apiUrl}
+ AWS_URL: ${storage_apiUrl}/${storage_bucketName}
+ AWS_USE_PATH_STYLE_ENDPOINT: true
+ ```
+
+ Question: How do I enable HTTPS?
+Answer:
+ HTTPS is automatically enabled when you use either a Zerops subdomain or configure your custom domain. No additional configuration is required.
+
+ Question: Can I run scheduled tasks?
+Answer:
+ Yes, you can configure cron jobs in your `zerops.yaml`:
+ ```yaml
+ zerops:
+ - setup: app
+ run:
+ crontab:
+ - command: "php artisan schedule:run"
+ timing: "* * * * *"
+ workingDir: /var/www/html
+ ```
+
+ Question: How do I configure Redis for caching?
+Answer:
+ Configure Redis for caching, sessions, and queues:
+ ```yaml
+ zerops:
+ - setup: app
+ run:
+ envVariables:
+ CACHE_STORE: redis
+ SESSION_DRIVER: redis
+ REDIS_HOST: redis
+ REDIS_PORT: 6379
+ REDIS_CLIENT: phpredis
+ ```
+
+ Question: How do I optimize my Laravel application?
+Answer:
+ Add these optimization commands to your initialization:
+ ```yaml
+ zerops:
+ - setup: app
+ run:
+ initCommands:
+ - php artisan view:cache
+ - php artisan config:cache
+ - php artisan route:cache
+ - php artisan optimize
+ ```
+
+ Question: How do I handle asset compilation?
+Answer:
+ Configure asset compilation in your build phase:
+ ```yaml
+ zerops:
+ - setup: app
+ build:
+ base:
+ - php@8.4
+ - nodejs@18
+ buildCommands:
+ - composer install --optimize-autoloader --no-dev
+ - npm install
+ - npm run build
+ cache:
+ - vendor
+ - node_modules
+ ```
+
+ Question: How do I implement health checks?
+Answer:
+ Add health checks to ensure your application is running properly:
+ ```yaml
+ zerops:
+ - setup: app
+ deploy:
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /up
+ run:
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /up
+ ```
+
+
+----------------------------------------
+
+# Frameworks > Laravel > Introduction
+
+ Deploy the same Laravel setup as in this tutorial with a single click. All you need is a Zerops account.
+
+## Introduction
+In this tutorial, you'll learn how to deploy a Laravel application on Zerops. We'll configure a complete environment using Apache as the web server and PostgreSQL as the database.
+By the end of this tutorial, you will:
+- Have a fresh Laravel installation running locally
+- Set up a Zerops project with Apache and PostgreSQL
+- Configure zero-downtime deployment with environment variables
+- Deploy a production-ready Laravel application with Zerops subdomain access
+- Set up secure VPN access to your PostgreSQL database
+## Prerequisites
+This tutorial assumes you have:
+* PHP, Composer, git installed locally
+* [Zerops account](https://app.zerops.io/signup)
+* [zcli](/references/cli) tool installed
+:::note
+You don't need to install PostgreSQL locally - Zerops VPN lets you connect directly to the remote database for development.
+:::
+## Step 1 — Creating a New Laravel Project
+Let's start by creating a fresh Laravel project:
+```bash
+composer create-project laravel/laravel zerops-laravel
+cd zerops-laravel
+```
+Let's verify everything works locally. Start Laravel's development server:
+```bash
+php artisan serve
+```
+Visit http://localhost:8000 in your browser. You should see Laravel's welcome page.
+:::tip
+While we're using Laravel's built-in server for simplicity, you can use any local development setup you prefer (Valet, Sail, XAMPP, etc.).
+:::
+If you see the welcome page, great! Your local setup is working correctly.
+## Step 2 — Setting Up Your Zerops Project
+### Log in to zcli
+[Log in](/references/cli#personal-access-tokens) to zcli with your **Personal access token**.
+### Create Project Configuration
+When you create a project in Zerops, you get a production-grade infrastructure with automated security, load balancing, and SSL management. Each project runs in its own isolated network where services communicate securely using simple hostnames, all accessible through VPN for seamless local development.
+Learn more about infrastructure features in documentation section [Project & Services Structure](/features/infrastructure).
+#### Project Configuration File
+The project configuration defines your infrastructure using YAML. This approach provides clear, reproducible configuration that can be version controlled. Later in this tutorial, we'll also show how to achieve the same using the GUI.
+Create a new file in your project root called `zerops-project-import.yaml` with the following content:
+```yaml title="zerops-project-import.yaml"
+#yamlPreprocessor=on
+project:
+ name: laravel-zerops
+ tags:
+ - zerops-tutorial # tag for easy filtering (optional)
+services:
+ - hostname: app
+ type: php-apache@8.4
+ envSecrets:
+ # yamlPreprocessor feat: generates a random 32 char and stores it
+ APP_KEY: )>
+ - hostname: db
+ type: postgresql@16
+ mode: HA # High Availability mode for robust production setup
+```
+:::tip Generate secrets
+The `#yamlPreprocessor=on` directive enables Zerops' [YAML preprocessing](/references/import-yaml/pre-processor) for this import file, allowing us to use dynamic values and built-in functions like `generateRandomString`.
+:::
+#### Automatic Resource Management
+Zerops features intelligent autoscaling that manages all resources (CPU, RAM, Disk) based on actual usage, automatically scaling up and down to optimize costs while maintaining performance.
+In this guide, we'll use default scaling ranges and that's why you won't find resource configurations in the import file. See current ranges for [horizontal](/php/how-to/scaling#horizontal-auto-scaling) and [vertical](/php/how-to/scaling#vertical-auto-scaling) scaling of PHP services.
+#### High-Availability Database
+In this guide, [enabling HA mode](/postgresql/how-to/scale#horizontal-scaling) creates a database cluster across three physical servers, with all the complexity managed automatically by Zerops.
+Through Zerops VPN, you can securely access this database setup directly from your local machine, ensuring your development environment matches production exactly.
+#### Import the Project
+Now create the project by running:
+```bash
+zcli project project-import zerops-project-import.yaml
+```
+### Alternative: Creating Project via GUI
+You can also create and configure your project through the Zerops dashboard:
+1. Log into your [Zerops Dashboard](https://app.zerops.io)
+2. Click **Add new project**
+3. Set a project name (e.g., "laravel-zerops") and click **Create project**
+Then add the required services:
+1. **PHP + Apache Service:**
+ - Click **Add Service** and select **PHP+Apache**
+ - Set hostname to "app"
+ - Keep all other settings as default
+2. **PostgreSQL Service:**
+ - Click **Add Service** and select **PostgreSQL**
+ - Set hostname to "db"
+ - Keep all other settings as default
+## Step 3 — Configuring Your Application
+The [deployment configuration](/zerops-yaml/specification) controls how your application builds and runs. Create a `zerops.yaml` file in your project root:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ base:
+ - php@8.4
+ buildCommands:
+ - composer install --ignore-platform-reqs
+ deployFiles: ./
+ cache:
+ - vendor
+ - composer.lock
+ deploy:
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /up
+ run:
+ base: php-apache@8.4
+ envVariables:
+ APP_NAME: "Laravel Zerops Demo"
+ APP_DEBUG: false
+ APP_ENV: production
+ APP_URL: ${zeropsSubdomain}
+ DB_CONNECTION: pgsql
+ DB_HOST: db
+ DB_PORT: 5432
+ DB_DATABASE: db
+ DB_USERNAME: ${db_user}
+ DB_PASSWORD: ${db_password}
+ LOG_CHANNEL: stack
+ LOG_LEVEL: debug
+ SESSION_DRIVER: database
+ initCommands:
+ - php artisan config:cache
+ - php artisan route:cache
+ - php artisan migrate --force --isolated
+ - php artisan optimize
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /up
+```
+Let's break down some important parts of this configuration:
+### Environment Variables
+Zerops automatically generates and securely manages various environment variables. For example, `zeropsSubdomain` provides your application's URL, while database credentials `user` and `password` are variables of the `db` service. It is possible to reference any variable or a service by hostname within your project's private network.
+```yaml
+APP_URL: ${zeropsSubdomain} # Automatically set to your app's Zerops URL
+DB_USERNAME: ${db_user} # Database credentials auto-injected
+DB_PASSWORD: ${db_password} # Securely managed by Zerops
+```
+Learn more about [environment variables](/frameworks/laravel/env-variables) for Laravel.
+### Safe Database Migrations
+```yaml
+php artisan migrate --force --isolated
+```
+The `--isolated` flag prevents multiple servers from running migrations simultaneously by using a cache lock, ensuring safe database updates during deployment.
+### Health Checks
+The health check configuration ensures your application is running correctly:
+```yaml
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /up
+ ...
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /up
+```
+By default, latest version of Laravel responds with a 200 OK status on the `/up` endpoint, so no additional configuration is needed.
+## Step 4 — Deploying Your Application
+Now comes the exciting part - deploying your application to Zerops!
+### Deploying Your Code
+Initialize git in your project directory:
+```bash
+git init
+```
+:::note
+Git is required to track changes for deployment. You don't need to commit, but initializing git helps Zerops manage the deployment files.
+:::
+Push your code to Zerops, select your project and service when prompted:
+```bash
+zcli push
+```
+### Monitoring the Deployment
+1. Go to the [Zerops Dashboard](https://app.zerops.io)
+2. In the top-left corner, you'll see a circle with **running process** text
+3. Click it to see the build progress overview
+4. Click **Open pipeline detail** button to view the detailed build process
+You'll see the deployment progress with timing for each step:
+- Initializing build container
+- Running build commands from zerops.yaml
+- Creating app version and upgrading PHP+Apache service
+The entire process usually takes less than a minute to complete.
+## Step 5 — Verifying Your Deployment
+Once the deployment completes, let's verify everything works:
+1. Go to your project's app service
+2. Click on **Public access & internal ports**
+3. Find the **Public Access through zerops.app Subdomain** section
+4. Toggle **Enable Zerops Subdomain Access**
+5. Click the generated URL (e.g., `https://app-xxx.prg1.zerops.app`) to view your application
+:::note
+The Zerops subdomain is perfect for testing and development, but for production, you should [set up your own domain](/features/access#public-access-through-your-domain) under **Public Access through Your Domains**.
+:::
+### Testing Database Connectivity
+Let's create a quick route to test database connectivity. Add this to your `routes/web.php`:
+```php
+Route::get('/db-test', function () {
+ session()->save();
+ return 'Current number of active sessions in database: ' . Illuminate\Support\Facades\DB::table('sessions')->count();
+});
+```
+Deploy this change:
+```bash
+zcli push
+```
+Visit `{your-app-url}/db-test` to verify database connectivity.
+## Accessing Your Database Locally
+Once your application is deployed, you might want to access the database directly from your local machine. Zerops makes this easy with VPN access.
+### Setting up VPN Access
+1. Start the VPN connection:
+```bash
+zcli vpn up
+```
+2. Select your project when prompted
+3. Try http://app.zerops/ to verify connectivity.
+That's it! You now have direct access to all services in your project.
+### Connecting to Database
+To get your database credentials:
+1. Go to the PostgreSQL service in your project
+2. Click **Access details** button
+3. Here you'll find all connection details including hostname, port, user, and password
+Update your local `.env` file with these credentials:
+```ini
+DB_CONNECTION=pgsql
+DB_HOST=db.zerops
+DB_PORT=5432
+DB_DATABASE=db
+DB_USERNAME=db
+DB_PASSWORD=[password from Access details]
+```
+Now you can use your favorite database management tool or run artisan commands while working with the database in Zerops - no local PostgreSQL installation needed!
+## Next Steps
+Now that your Laravel application is running on Zerops, consider:
+1. Setting up a [custom domain](/features/access#public-access-through-your-domain)
+2. Implementing basic CI/CD pipelines with [GitHub](/references/github-integration) or [GitLab](/references/gitlab-integration) integration
+3. Setting up [object storage](/object-storage/overview)
+## Conclusion
+Congratulations! 🎉 You've successfully deployed a Laravel application on Zerops with Apache and PostgreSQL. Your application is now running in a production-ready environment with automated builds and deployments.
+### Additional Resources
+- [Laravel Documentation](https://laravel.com/docs)
+- [Laravel Recipe Repository](https://github.com/zeropsio/recipe-laravel-minimal)
+- [zCLI Documentation](/references/cli)
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Logs
+
+Zerops provides comprehensive logging capabilities for Laravel applications using its distributed logging architecture. This guide shows you how to set up and optimize Laravel logging on Zerops, ensuring your application logs are properly captured and accessible.
+## Accessing Logs
+Learn how to [access and view your logs](/php/how-to/logs) in Zerops.
+## Configuration
+### Zerops Environment Variables
+Laravel logging in Zerops is configured through environment variables, such as:
+- `LOG_CHANNEL`: Specifies which logging channel to use (e.g., 'syslog', 'stack')
+- `LOG_STACK`: When using the stack channel, defines which channels to include
+- `LOG_LEVEL`: Sets the minimum log level to capture (e.g., 'debug', 'info', 'error')
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ run:
+ envVariables:
+ LOG_CHANNEL: syslog
+ LOG_LEVEL: debug
+ LOG_STACK: single
+```
+:::tip Available Log Channels
+Laravel supports several logging channels out of the box:
+- **stack**: Aggregates multiple logging channels into a single channel
+- **single**: Writes logs to a single file (storage/logs/laravel.log)
+- **daily**: Creates daily rotating log files
+- **syslog**: Writes to system log (recommended for Zerops)
+- **stderr**: Writes to PHP's standard error output stream
+- **errorlog**: Uses PHP's error_log function
+- **slack**: Sends log messages to Slack
+- **papertrail**: Sends logs to Papertrail
+- **mongodb**: Stores logs in MongoDB (requires additional package)
+:::
+To use multiple logging channels, [configure](#laravel-configuration) the stack channel:
+```yaml
+LOG_CHANNEL: stack
+LOG_STACK: syslog,daily
+```
+This configuration logs to both syslog (for Zerops) and daily files (for local access).
+:::tip
+Using appropriate log levels makes it easier to filter and find relevant messages in the Zerops GUI.
+:::
+### Laravel Configuration
+While Zerops is configured through environment variables, these variables are interpreted by Laravel's logging system. By default, Laravel includes a logging configuration that works out of the box - you don't need to modify anything.
+If you're curious about the underlying configuration or need to customize it beyond environment variables, here's what Laravel's logging configuration typically looks like:
+
+```php title="config/logging.php"
+ env('LOG_CHANNEL', 'stack'),
+ 'deprecations' => [
+ 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
+ 'trace' => env('LOG_DEPRECATIONS_TRACE', false),
+ ],
+ 'channels' => [
+ 'stack' => [
+ 'driver' => 'stack',
+ 'channels' => explode(',', env('LOG_STACK', 'single')),
+ 'ignore_exceptions' => false,
+ ],
+ 'single' => [
+ 'driver' => 'single',
+ 'path' => storage_path('logs/laravel.log'),
+ 'level' => env('LOG_LEVEL', 'debug'),
+ 'replace_placeholders' => true,
+ ],
+ 'daily' => [
+ 'driver' => 'daily',
+ 'path' => storage_path('logs/laravel.log'),
+ 'level' => env('LOG_LEVEL', 'debug'),
+ 'days' => env('LOG_DAILY_DAYS', 14),
+ 'replace_placeholders' => true,
+ ],
+ 'stderr' => [
+ 'driver' => 'monolog',
+ 'handler' => StreamHandler::class,
+ 'with' => [
+ 'stream' => 'php://stderr',
+ ],
+ 'level' => env('LOG_LEVEL', 'debug'),
+ ],
+ 'syslog' => [
+ 'driver' => 'syslog',
+ 'level' => env('LOG_LEVEL', 'debug'),
+ ],
+ 'errorlog' => [
+ 'driver' => 'errorlog',
+ 'level' => env('LOG_LEVEL', 'debug'),
+ ],
+ ],
+];
+```
+### Using Logs
+Laravel provides several ways to write log messages:
+```php
+// Using facade
+use Illuminate\Support\Facades\Log;
+Log::emergency($message);
+Log::alert($message);
+Log::critical($message);
+Log::error($message);
+Log::warning($message);
+Log::notice($message);
+Log::info($message);
+Log::debug($message);
+// Using helper function
+logger()->info($message);
+logger($message); // defaults to info level
+// With context data
+Log::info('User failed to login.', ['id' => $user->id]);
+```
+
+----------------------------------------
+
+# Frameworks > Laravel > Migrations
+
+Database migrations are **version control** for your database schema, allowing you to evolve your database structure alongside your application versions. Each migration represents a specific version change in your application's database schema, ensuring your database structure stays synchronized with your codebase as your application evolves.
+This guide covers how to implement and manage these version-based database changes on Zerops, focusing on PostgreSQL as the recommended database system.
+## Environment Configuration
+Configure your database connection in your environment variables:
+```yaml
+zerops:
+ - setup: app
+ run:
+ envVariables:
+ DB_CONNECTION: pgsql
+ DB_HOST: ${db_hostname}
+ DB_PORT: 5432
+ DB_DATABASE: myapp
+ DB_USERNAME: ${db_user}
+ DB_PASSWORD: ${db_password}
+```
+:::warning Backup your data
+Before running migrations in production, it's strongly recommended to back up your database. Zerops provides automated daily backups - see our [backup documentation](/features/backup) for details.
+:::
+## Running Migrations
+### Automatic Migrations
+The most reliable way to manage migrations in your deployment pipeline is through automatic execution. Configure this in your `zerops.yaml`:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ run:
+ initCommands:
+ - php artisan migrate --force --isolated
+```
+:::caution
+When running automatic migrations in production, the `--force` flag is necessary to bypass Laravel's safety prompt. Without this flag, Laravel asks for confirmation to help prevent accidental data loss.
+:::
+:::note Migrations in HA mode
+The `--isolated` flag prevents multiple servers from running migrations simultaneously by using a cache lock.
+:::
+### Manual Migrations
+For development and troubleshooting purposes, you can execute migrations manually through SSH:
+```bash
+# Connect to your zerops project
+zcli vpn up
+# SSH into your service using it's hostname (app)
+ssh app
+# For MacOS users
+ssh app.zerops
+```
+## Migration Commands
+Essential migration commands for your workflow:
+```bash
+# Create a new migration file with timestamp
+php artisan make:migration create_users_table
+# Execute all pending migrations
+php artisan migrate
+# Revert the most recent migration operation
+php artisan migrate:rollback
+# Reset and rerun all migrations (warning: destroys existing data)
+php artisan migrate:fresh
+# Display current migration status
+php artisan migrate:status
+```
+## Best Practices
+### Migration Structure
+```php {title="database/migrations/create_users_table.php"}
+id(); // Auto-incrementing primary key
+ $table->string('name'); // User's full name
+ $table->string('email')->unique(); // Unique email address
+ $table->timestamp('email_verified_at')->nullable(); // Email verification timestamp
+ $table->string('password'); // Hashed password
+ $table->rememberToken(); // Remember me token
+ $table->timestamps(); // Created_at and updated_at timestamps
+ });
+ }
+ /**
+ * Reverse the migrations.
+ * Removes the users table completely.
+ */
+ public function down()
+ {
+ Schema::dropIfExists('users');
+ }
+};
+```
+### Safe Migration Practices
+1. **Implement Reversible Changes**
+```php
+public function down()
+{
+ // Always provide a way to undo migration changes
+ Schema::table('users', function (Blueprint $table) {
+ $table->dropColumn('new_column');
+ });
+}
+```
+2. **Use Foreign Key Contraints**
+```php
+public function up()
+{
+ Schema::table('posts', function (Blueprint $table) {
+ // Create relationship with cascading delete
+ $table->foreignId('user_id')
+ ->constrained()
+ ->onDelete('cascade');
+ });
+}
+```
+3. **Handle Large Tables Efficiently**
+```php
+public function up()
+{
+ // Step 1: Add nullable column to prevent blocking operations
+ Schema::table('large_table', function (Blueprint $table) {
+ $table->string('new_column')->nullable();
+ });
+ // Step 2: Update data in manageable chunks
+ DB::table('large_table')
+ ->orderBy('id')
+ ->chunk(1000, function ($records) {
+ foreach ($records as $record) {
+ DB::table('large_table')
+ ->where('id', $record->id)
+ ->update(['new_column' => 'default_value']);
+ }
+ });
+}
+```
+## Testing Migrations
+### Create a Test Database
+Add a testing connection to your `config/database.php`:
+```php
+'testing' => [
+ 'driver' => 'pgsql',
+ 'host' => env('DB_TEST_HOST', '127.0.0.1'),
+ 'database' => env('DB_TEST_DATABASE', 'testing'),
+ 'username' => env('DB_TEST_USERNAME', 'postgres'),
+ 'password' => env('DB_TEST_PASSWORD', ''),
+],
+```
+### Migration Test Example
+Create a test file at `tests/Unit/MigrationTest.php`:
+```php
+/**
+ * Test migration execution and schema verification
+ */
+public function test_migrations_can_be_run()
+{
+ // Execute all migrations
+ Artisan::call('migrate');
+ // Verify table creation
+ $this->assertTrue(Schema::hasTable('users'));
+ // Verify column structure
+ $this->assertTrue(Schema::hasColumns('users', [
+ 'id', 'name', 'email', 'password'
+ ]));
+}
+```
+:::tip Migration Tips
+* Always create a backup before running migrations in production
+* Use database transactions for complex migrations
+* Thoroughly test migrations in development environment
+* Implement seeders for initial data population
+* Monitor execution time for migrations on large tables
+:::
+## Troubleshooting
+Common migration issues and their solutions:
+1. **Migration Timeout** Configure longer timeout in [zerops.yaml](/zerops-yaml/specification):
+```yaml
+zerops:
+ - setup: app
+ run:
+ initCommands:
+ - php artisan migrate --force --isolated --timeout=1000
+```
+2. **Database Lock Timeout** Adjust PDO settings in `config/database.php`:
+```php
+'pgsql' => [
+ // ...
+ 'options' => [
+ PDO::ATTR_LOCK_TIMEOUT => 1000 // Milliseconds
+ ]
+],
+```
+3. **Reset Migration State** Commands:
+```bash
+# Reset all migrations
+php artisan migrate:reset
+# Re-run all migrations
+php artisan migrate
+```
+## Additional Resources
+* [Laravel Migration Documentation](https://laravel.com/docs/11.x/migrations)
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Filament Devel
+
+[Filament](https://filamentphp.com/) is a collection of tools for rapidly building beautiful TALL stack (Tailwind, Alpine, Laravel, Livewire) applications. It provides a powerful admin panel, form builder, table builder, and other components that help you build feature-rich web applications with minimal effort.
+This recipe demonstrates how to effectively integrate Laravel Filament applications with Zerops, providing a fully production-capable setup. While this setup is built for professional deployment, we call it a **development environment** due to its streamlined resource allocation and use of the [Lightweight](/features/infrastructure#project-core) core package, optimizing costs without compromising functionality.
+ Set up a Laravel environment with Filament's admin panel and TALL stack in a development-optimized configuration.
+
+## Environment Overview
+Your newly deployed Laravel Filament environment includes:
+- A fully configured Laravel application service with Filament installed
+- PostgreSQL database integration with migration automation
+- Automated build and deployment pipeline
+- Health and readiness checks
+- Configured Filament admin panel and components
+:::note
+For production environments with high-availability services and enterprise-grade reliability, consider deploying the [production environment recipe](/frameworks/laravel/recipes/minimal-prod).
+:::
+## Application Configuration
+The app has been set up to utilize PostgreSQL service and includes Filament's admin panel and components. Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+- Filament assets compilation
+## Try the build & deploy pipeline in 30 seconds
+While Zerops supports various CI/CD workflows (CLI, GitHub Actions, built-in CI/CD), let's start with the simplest path to get you familiar with the core concepts:
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-laravel-minimal) and clone it locally
+2. Navigate to **Pipelines & CI/CD settings** and connect the service with your new GitHub repository, setting the trigger to **Push to Branch**
+### Test Your Pipeline
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in project detail
+## Integration with Existing Applications
+If you're looking to integrate an existing Laravel Filament application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-laravel-minimal/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel Filament tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel Filament project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Filament Local
+
+[Filament](https://filamentphp.com/) is a collection of tools for rapidly building beautiful TALL stack (Tailwind, Alpine, Laravel, Livewire) applications. It provides a powerful admin panel, form builder, table builder, and other components that help you build feature-rich web applications with minimal effort.
+This recipe provides a comprehensive Filament setup with PostgreSQL database, Redis-compatible store, object storage, and automated deployment pipeline, designed for **local development** This recipe provides a streamlined Laravel setup with PostgreSQL database and automated deployment pipeline, designed for **local development** with cost-efficient resource allocation and the [Lightweight](/features/infrastructure#project-core) core package. This means:
+- Resources are optimized for development workloads
+- Services can be started/stopped as needed during active development
+- Cost-effective configuration suitable for development and testing
+ Set up a Laravel environment with Filament's admin panel and TALL stack components for efficient local development.
+
+## Environment Overview
+Your newly deployed Filament environment includes:
+- A fully configured Laravel application service with Filament
+- PostgreSQL database integration with migration automation
+- Valkey (Redis-compatible KV store) for sessions and cache
+- Built-in object storage for filesystem
+- Mailpit for development SMTP server
+- Automated build and deployment pipeline
+- Health and readiness checks
+:::note
+For production environments with high-availability services and enterprise-grade reliability, consider deploying the [production environment recipe](/frameworks/laravel/recipes/filament-prod).
+:::
+## What to Expect
+The deployment process takes just a few minutes. Once complete, you'll receive:
+- A live URL to access your application
+- Database credentials
+- Access to your project dashboard
+- CLI configuration details for VPN access
+## Setting Up Local Development
+Zerops provides a built-in VPN feature through its CLI tool, enabling seamless local development against remote resources. Here's how to set it up:
+### Prerequisites
+- Install the [Zerops CLI](/references/cli#get-started) and log in with [personal access token](/references/cli#personal-access-tokens)
+- Install [Wireguard](/references/vpn) on your system
+### Setup Steps
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-filament) and clone it locally
+2. **Configure VPN Access**
+ ```bash
+ # Initialize VPN connection using project ID
+ zcli vpn up
+ # Or use interactive mode to select your project
+ zcli vpn up
+ ```
+3. **Set Up Environment**
+ ```bash
+ # Create and configure environment file
+ cp .env.example .env
+ ```
+ Fill in database access details - in Zerops GUI go to the detail of `db` service and open **Access details** in the left menu.
+ ```bash
+ composer install
+ php artisan key:generate
+ npm install
+ npm run dev
+ ```
+4. **Start Development Server**
+ ```bash
+ php artisan serve # or use your preferred setup (Valet, Herd, Sail)
+ ```
+Your local environment is now connected to the Zerops infrastructure, utilizing the database, redis and storage from Zerops while maintaining local development flexibility.
+## Application Configuration
+The app has been set up to utilize:
+- Valkey (Redis-compatible KV store) to handle sessions and cache
+- Built-in object storage for Laravel and Filament-specific filesystem operations
+- Mailpit as a mock SMTP server for development purposes
+Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+## Try the Build & Deploy Pipeline
+Now that you're logged into zcli, deploying your application is straightforward. Simply enter `zcli push` in your terminal from the root of your freshly cloned project.
+### Test Your Pipeline
+The best way to verify your setup is with a quick test:
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in your project dashboard
+### Setting Up Automated CI/CD
+To enable automatic deployments:
+1. Navigate to **Pipelines & CI/CD settings** in your service dashboard
+2. Connect the service with your new GitHub repository
+3. Set the trigger to **Push to Branch**
+## Integration with Existing Applications
+If you're looking to integrate an existing Filament application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-filament/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Filament Prod
+
+[Filament](https://filamentphp.com/) is a collection of tools for rapidly building beautiful TALL stack (Tailwind, Alpine, Laravel, Livewire) applications. It provides a powerful admin panel, form builder, table builder, and other components that help you build feature-rich web applications with minimal effort.
+This recipe demonstrates how to effectively integrate Laravel Filament applications with Zerops, providing a fully production-grade setup. It's built as a **production environment** with high-availability configuration and uses the [Serious](/features/infrastructure#project-core) core package, ensuring enterprise-grade reliability and robust performance.
+ Set up a production-ready Laravel environment with Filament's admin panel and TALL stack, backed by enterprise-grade reliability.
+
+## Environment Overview
+Your newly deployed Laravel Filament environment includes:
+- A fully configured Laravel application service with Filament installed and high availability
+- PostgreSQL database integration with migration automation
+- Automated build and deployment pipeline
+- Health and readiness checks
+- Configured Filament admin panel and components
+:::note
+For development environments with cost-efficient resource allocation, consider deploying the [development environment recipe](/frameworks/laravel/recipes/minimal-devel).
+:::
+## Application Configuration
+The app has been set up to utilize PostgreSQL service and includes Filament's admin panel and components. Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+- Filament assets compilation
+## Try the build & deploy pipeline in 30 seconds
+While Zerops supports various CI/CD workflows (CLI, GitHub Actions, built-in CI/CD), let's start with the simplest path to get you familiar with the core concepts:
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-laravel-minimal) and clone it locally
+2. Navigate to **Pipelines & CI/CD settings** and connect the service with your new GitHub repository, setting the trigger to **Push to Branch**
+### Test Your Pipeline
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in project detail
+## Integration with Existing Applications
+If you're looking to integrate an existing Laravel Filament application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-laravel-minimal/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel Filament tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel Filament project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Jetstream Devel
+
+Laravel Jetstream provides a polished application scaffolding for Laravel, featuring authentication, registration, email verification, two-factor authentication, session management, API support via Laravel Sanctum, and optional team management features. It serves as the perfect starting point for your next Laravel application.
+This recipe demonstrates how to effectively integrate Laravel Jetstream applications with Zerops, providing a fully production-capable setup. While this setup is built for professional deployment, we call it a **development environment** due to its streamlined resource allocation and use of the [Lightweight](/features/infrastructure#project-core) core package, optimizing costs without compromising functionality.
+ Set up a Laravel environment with Jetstream's team features and authentication system in a development-optimized configuration.
+
+## Environment Overview
+Your newly deployed Laravel Jetstream environment includes:
+- A fully configured Laravel application service with Jetstream installed
+- PostgreSQL database integration with migration automation
+- Automated build and deployment pipeline
+- Health and readiness checks
+- Configured Jetstream authentication system
+:::note
+For production environments with high-availability services and enterprise-grade reliability, consider deploying the [production environment recipe](/frameworks/laravel/recipes/minimal-prod).
+:::
+## Application Configuration
+The app has been set up to utilize PostgreSQL service and includes Jetstream's authentication scaffolding. Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+- Jetstream assets compilation
+## Try the build & deploy pipeline in 30 seconds
+While Zerops supports various CI/CD workflows (CLI, GitHub Actions, built-in CI/CD), let's start with the simplest path to get you familiar with the core concepts:
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-laravel-minimal) and clone it locally
+2. Navigate to **Pipelines & CI/CD settings** and connect the service with your new GitHub repository, setting the trigger to **Push to Branch**
+### Test Your Pipeline
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in project detail
+## Integration with Existing Applications
+If you're looking to integrate an existing Laravel Jetstream application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-laravel-minimal/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel Jetstream tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel Jetstream project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Jetstream Local
+
+Laravel Jetstream provides a polished application scaffolding for Laravel, featuring authentication, registration, email verification, two-factor authentication, session management, API support via Laravel Sanctum, and optional team management features. It serves as the perfect starting point for your next Laravel application.
+This recipe provides a comprehensive Laravel Jetstream setup with PostgreSQL database, Redis-compatible store, object storage, and automated deployment pipeline, designed for **local development** with cost-efficient resource allocation and the [Lightweight](/features/infrastructure#project-core) core package. This means:
+- Resources are optimized for development workloads
+- Services can be started/stopped as needed during active development
+- Cost-effective configuration suitable for development and testing
+ Set up a Laravel environment with Jetstream's team features and authentication system for rapid local development.
+
+## Environment Overview
+Your newly deployed Laravel Jetstream environment includes:
+- A fully configured Laravel application service with Jetstream
+- PostgreSQL database integration with migration automation
+- Valkey (Redis-compatible KV store) for sessions and cache
+- Built-in object storage for filesystem
+- Mailpit for development SMTP server
+- Automated build and deployment pipeline
+- Health and readiness checks
+:::note
+For production environments with high-availability services and enterprise-grade reliability, consider deploying the [production environment recipe](/frameworks/laravel/recipes/jetstream-prod).
+:::
+## What to Expect
+The deployment process takes just a few minutes. Once complete, you'll receive:
+- A live URL to access your application
+- Database credentials
+- Access to your project dashboard
+- CLI configuration details for VPN access
+## Setting Up Local Development
+Zerops provides a built-in VPN feature through its CLI tool, enabling seamless local development against remote resources. Here's how to set it up:
+### Prerequisites
+- Install the [Zerops CLI](/references/cli#get-started) and log in with [personal access token](/references/cli#personal-access-tokens)
+- Install [Wireguard](/references/vpn) on your system
+### Setup Steps
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-laravel-jetstream) and clone it locally
+2. **Configure VPN Access**
+ ```bash
+ # Initialize VPN connection using project ID
+ zcli vpn up
+ # Or use interactive mode to select your project
+ zcli vpn up
+ ```
+3. **Set Up Environment**
+ ```bash
+ # Create and configure environment file
+ cp .env.example .env
+ ```
+ Fill in database access details - in Zerops GUI go to the detail of `db` service and open **Access details** in the left menu.
+ ```bash
+ composer install
+ php artisan key:generate
+ npm install
+ npm run dev
+ ```
+4. **Start Development Server**
+ ```bash
+ php artisan serve # or use your preferred setup (Valet, Herd, Sail)
+ ```
+Your local environment is now connected to the Zerops infrastructure, utilizing the database, redis and storage from Zerops while maintaining local development flexibility.
+## Application Configuration
+The app has been set up to utilize:
+- Valkey (Redis-compatible KV store) to handle sessions and cache
+- Built-in S3 object storage for Laravel and Jetstream-specific filesystem operations
+- Mailpit as a mock SMTP server for development purposes
+Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+## Try the Build & Deploy Pipeline
+Now that you're logged into zcli, deploying your application is straightforward. Simply enter `zcli push` in your terminal from the root of your freshly cloned project.
+### Test Your Pipeline
+The best way to verify your setup is with a quick test:
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in your project dashboard
+### Setting Up Automated CI/CD
+To enable automatic deployments:
+1. Navigate to **Pipelines & CI/CD settings** in your service dashboard
+2. Connect the service with your new GitHub repository
+3. Set the trigger to **Push to Branch**
+## Integration with Existing Applications
+If you're looking to integrate an existing Laravel Jetstream application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-laravel-jetstream/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Jetstream Prod
+
+Laravel Jetstream provides a polished application scaffolding for Laravel, featuring authentication, registration, email verification, two-factor authentication, session management, API support via Laravel Sanctum, and optional team management features. It serves as the perfect starting point for your next Laravel application.
+This recipe demonstrates how to effectively integrate Laravel Jetstream applications with Zerops, providing a fully production-grade setup. It's built as a **production environment** with high-availability configuration and uses the [Serious](/features/infrastructure#project-core) core package, ensuring enterprise-grade reliability and robust performance.
+ Set up a production-ready Laravel environment with Jetstream's team features and authentication system, backed by high-availability services.
+
+## Environment Overview
+Your newly deployed Laravel Jetstream environment includes:
+- A fully configured Laravel application service with Jetstream installed and high availability
+- PostgreSQL database integration with migration automation
+- Automated build and deployment pipeline
+- Health and readiness checks
+- Configured Jetstream authentication system
+:::note
+For development environments with cost-efficient resource allocation, consider deploying the [development environment recipe](/frameworks/laravel/recipes/minimal-devel).
+:::
+## Application Configuration
+The app has been set up to utilize PostgreSQL service and includes Jetstream's authentication scaffolding. Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+- Jetstream assets compilation
+## Try the build & deploy pipeline in 30 seconds
+While Zerops supports various CI/CD workflows (CLI, GitHub Actions, built-in CI/CD), let's start with the simplest path to get you familiar with the core concepts:
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-laravel-minimal) and clone it locally
+2. Navigate to **Pipelines & CI/CD settings** and connect the service with your new GitHub repository, setting the trigger to **Push to Branch**
+### Test Your Pipeline
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in project detail
+## Integration with Existing Applications
+If you're looking to integrate an existing Laravel Jetstream application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-laravel-minimal/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel Jetstream tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel Jetstream project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Minimal Devel
+
+This recipe demonstrates how to effectively integrate Laravel applications with Zerops, providing a fully production-capable setup. While it's built for professional deployment, we call it a **development environment** due to its streamlined resource allocation and use of the [Lightweight](/features/infrastructure#project-core) core package, optimizing costs without compromising functionality.
+ Set up a streamlined Laravel environment with development-optimized resources and configurations.
+
+## Environment Overview
+Your newly deployed Laravel environment includes:
+- A fully configured Laravel application service
+- PostgreSQL database integration with migration automation
+- Automated build and deployment pipeline
+- Health and readiness checks
+:::note
+For production environments with high-availability services and enterprise-grade reliability, consider deploying the [production environment recipe](/frameworks/laravel/recipes/minimal-prod).
+:::
+## Application Configuration
+The app has been set up to utilize PostgreSQL service. Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+## Try the build & deploy pipeline in 30 seconds
+While Zerops supports various CI/CD workflows (CLI, GitHub Actions, built-in CI/CD), let's start with the simplest path to get you familiar with the core concepts:
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-laravel-minimal) and clone it locally
+2. Navigate to **Pipelines & CI/CD settings** and connect the service with your new GitHub repository, setting the trigger to **Push to Branch**
+### Test Your Pipeline
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in project detail
+## Integration with Existing Applications
+If you're looking to integrate an existing Laravel application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-laravel-minimal/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Minimal Local
+
+This recipe provides a streamlined Laravel setup with PostgreSQL database and automated deployment pipeline, designed for **local development** with cost-efficient resource allocation and the [Lightweight](/features/infrastructure#project-core) core package. This means:
+- Resources are optimized for development workloads
+- Services can be started/stopped as needed during active development
+- Cost-effective configuration suitable for development and testing
+ Set up a streamlined Laravel environment optimized for local development with this lightweight, cost-efficient configuration.
+
+## Environment Overview
+Your newly deployed Laravel environment includes:
+- A fully configured Laravel application service
+- PostgreSQL database integration with migration automation
+- Automated build and deployment pipeline
+- Health and readiness checks
+:::note
+For production environments with high-availability services and enterprise-grade reliability, consider deploying the [production environment recipe](/frameworks/laravel/recipes/minimal-prod).
+:::
+## What to Expect
+The deployment process takes just a few minutes. Once complete, you'll receive:
+- A live URL to access your application
+- Database credentials
+- Access to your project dashboard
+- CLI configuration details for VPN access
+## Setting Up Local Development
+Zerops provides a built-in VPN feature through its CLI tool, enabling seamless local development against remote resources. Here's how to set it up:
+### Prerequisites
+- Install the [Zerops CLI](/references/cli#get-started) and log in with [personal access token](/references/cli#personal-access-tokens)
+- Install [Wireguard](/references/vpn) on your system
+### Setup Steps
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-laravel-minimal) and clone it locally
+2. **Configure VPN Access**
+ ```bash
+ # Initialize VPN connection using project ID
+ zcli vpn up
+ # Or use interactive mode to select your project
+ zcli vpn up
+ ```
+3. **Set Up Environment**
+ ```bash
+ # Create and configure environment file
+ cp .env.example .env
+ ```
+ Fill in database access details - in Zerops GUI go to the detail of `db` service and open **Access details** in the left menu.
+ ```bash
+ composer install
+ php artisan key:generate
+ ```
+4. **Start Development Server**
+ ```bash
+ php artisan serve # or use your preferred setup (Valet, Herd, Sail)
+ ```
+Your local environment is now connected to the Zerops infrastructure, utilizing the remote PostgreSQL database while maintaining local development flexibility.
+## Application Configuration
+Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+## Try the Build & Deploy Pipeline
+Now that you're logged into zcli, deploying your application is straightforward. Simply enter `zcli push` in your terminal from the root of your freshly cloned project.
+### Test Your Pipeline
+The best way to verify your setup is with a quick test:
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in your project detail
+### Setting Up Automated CI/CD
+To enable automatic deployments:
+1. Navigate to **Pipelines & CI/CD settings** in your service dashboard
+2. Connect the service with your new GitHub repository
+3. Set the trigger to **Push to Branch**
+## Integration with Existing Applications
+If you're looking to integrate an existing Laravel application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-laravel-minimal/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Minimal Prod
+
+This recipe demonstrates how to effectively integrate Laravel applications with Zerops, providing a fully production-grade setup. It's built as a **production environment** with high-availability configuration and uses the [Serious](/features/infrastructure#project-core) core package, ensuring enterprise-grade reliability and robust performance.
+ Set up a production-ready Laravel environment with high-availability services and enterprise-grade reliability.
+
+## Environment Overview
+Your newly deployed Laravel environment includes:
+- A fully configured Laravel application service with high availability
+- PostgreSQL database integration with migration automation
+- Automated build and deployment pipeline
+- Health and readiness checks
+:::note
+For development environments with cost-efficient resource allocation, consider deploying the [development environment recipe](/frameworks/laravel/recipes/minimal-devel).
+:::
+## Application Configuration
+The app has been set up to utilize PostgreSQL service. Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+## Try the build & deploy pipeline in 30 seconds
+While Zerops supports various CI/CD workflows (CLI, GitHub Actions, built-in CI/CD), let's start with the simplest path to get you familiar with the core concepts:
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-laravel-minimal) and clone it locally
+2. Navigate to **Pipelines & CI/CD settings** and connect the service with your new GitHub repository, setting the trigger to **Push to Branch**
+### Test Your Pipeline
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in project detail
+## Integration with Existing Applications
+If you're looking to integrate an existing Laravel application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-laravel-minimal/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Twill Devel
+
+[Twill](https://twillcms.com/) is a flexible CMS toolkit for Laravel that helps you rapidly create a custom administration interface for your application. It provides a robust set of features including content management, media library, block editor, and a powerful publishing workflow system.
+This recipe demonstrates how to effectively integrate Laravel Twill applications with Zerops, providing a fully production-capable setup. While this setup is built for professional deployment, we call it a **development environment** due to its streamlined resource allocation and use of the [Lightweight](/features/infrastructure#project-core) core package, optimizing costs without compromising functionality.
+ Set up a Laravel environment with Twill's CMS framework in a development-optimized configuration.
+
+## Environment Overview
+Your newly deployed Laravel Twill environment includes:
+- A fully configured Laravel application service with Twill CMS installed
+- PostgreSQL database integration with migration automation
+- Automated build and deployment pipeline
+- Health and readiness checks
+- Configured Twill admin interface and media library
+:::note
+For production environments with high-availability services and enterprise-grade reliability, consider deploying the [production environment recipe](/frameworks/laravel/recipes/minimal-prod).
+:::
+## Application Configuration
+The app has been set up to utilize PostgreSQL service and includes Twill's CMS functionality. Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+- Twill assets compilation
+- Media storage configuration
+## Try the build & deploy pipeline in 30 seconds
+While Zerops supports various CI/CD workflows (CLI, GitHub Actions, built-in CI/CD), let's start with the simplest path to get you familiar with the core concepts:
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-laravel-minimal) and clone it locally
+2. Navigate to **Pipelines & CI/CD settings** and connect the service with your new GitHub repository, setting the trigger to **Push to Branch**
+### Test Your Pipeline
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in project detail
+## Integration with Existing Applications
+If you're looking to integrate an existing Laravel Twill application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-laravel-minimal/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel Twill tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel Twill project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Twill Local
+
+[Twill](https://twillcms.com/) is a flexible CMS toolkit for Laravel that helps you rapidly create a custom administration interface for your application. It provides a robust set of features including content management, media library, block editor, and a powerful publishing workflow system.
+This recipe provides a comprehensive Twill CMS setup with PostgreSQL database, Redis-compatible store, object storage, and automated deployment pipeline, designed for **local development** with cost-efficient resource allocation and the [Lightweight](/features/infrastructure#project-core) core package. This means:
+- Resources are optimized for development workloads
+- Services can be started/stopped as needed during active development
+- Cost-effective configuration suitable for development and testing
+ Set up a Laravel environment with Twill's publishing workflow and media management features for local development.
+
+## Environment Overview
+Your newly deployed Twill CMS environment includes:
+- A fully configured Laravel application service with Twill CMS
+- PostgreSQL database integration with migration automation
+- Valkey (Redis-compatible KV store) for sessions and cache
+- Built-in object storage for filesystem
+- Mailpit for development SMTP server
+- Automated build and deployment pipeline
+- Health and readiness checks
+:::note
+For production environments with high-availability services and enterprise-grade reliability, consider deploying the [production environment recipe](/frameworks/laravel/recipes/filament-prod).
+:::
+## What to Expect
+The deployment process takes just a few minutes. Once complete, you'll receive:
+- A live URL to access your application
+- Database credentials
+- Access to your project dashboard
+- CLI configuration details for VPN access
+## Setting Up Local Development
+Zerops provides a built-in VPN feature through its CLI tool, enabling seamless local development against remote resources. Here's how to set it up:
+### Prerequisites
+- Install the [Zerops CLI](/references/cli#get-started) and log in with [personal access token](/references/cli#personal-access-tokens)
+- Install [Wireguard](/references/vpn) on your system
+### Setup Steps
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-filament) and clone it locally
+2. **Configure VPN Access**
+ ```bash
+ # Initialize VPN connection using project ID
+ zcli vpn up
+ # Or use interactive mode to select your project
+ zcli vpn up
+ ```
+3. **Set Up Environment**
+ ```bash
+ # Create and configure environment file
+ cp .env.example .env
+ ```
+ Fill in database access details - in Zerops GUI go to the detail of `db` service and open **Access details** in the left menu.
+ ```bash
+ composer install
+ php artisan key:generate
+ npm install
+ npm run dev
+ ```
+4. **Start Development Server**
+ ```bash
+ php artisan serve # or use your preferred setup (Valet, Herd, Sail)
+ ```
+Your local environment is now connected to the Zerops infrastructure, utilizing the database, redis and storage from Zerops while maintaining local development flexibility.
+## Application Configuration
+The app has been set up to utilize:
+- Valkey (Redis-compatible KV store) to handle sessions and cache
+- Built-in object storage for Laravel and Twill-specific filesystem operations
+- Mailpit as a mock SMTP server for development purposes
+Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+## Try the Build & Deploy Pipeline
+Now that you're logged into zcli, deploying your application is straightforward. Simply enter `zcli push` in your terminal from the root of your freshly cloned project.
+### Test Your Pipeline
+The best way to verify your setup is with a quick test:
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in your project dashboard
+### Setting Up Automated CI/CD
+To enable automatic deployments:
+1. Navigate to **Pipelines & CI/CD settings** in your service dashboard
+2. Connect the service with your new GitHub repository
+3. Set the trigger to **Push to Branch**
+## Integration with Existing Applications
+If you're looking to integrate an existing Twill application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-twill/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Recipes > Twill Prod
+
+[Twill](https://twillcms.com/) is a flexible CMS toolkit for Laravel that helps you rapidly create a custom administration interface for your application. It provides a robust set of features including content management, media library, block editor, and a powerful publishing workflow system.
+This recipe demonstrates how to effectively integrate Laravel Twill applications with Zerops, providing a fully production-grade setup. It's built as a **production environment** with high-availability configuration and uses the [Serious](/features/infrastructure#project-core) core package, ensuring enterprise-grade reliability and robust performance.
+ Set up a production-ready Laravel environment with Twill's CMS framework, backed by high-availability services and enterprise-grade reliability.
+
+## Environment Overview
+Your newly deployed Laravel Twill environment includes:
+- A fully configured Laravel application service with Twill CMS installed and high availability
+- PostgreSQL database integration with migration automation
+- Automated build and deployment pipeline
+- Health and readiness checks
+- Configured Twill admin interface and media library
+:::note
+For development environments with cost-efficient resource allocation, consider deploying the [development environment recipe](/frameworks/laravel/recipes/minimal-devel).
+:::
+## Application Configuration
+The app has been set up to utilize PostgreSQL service and includes Twill's CMS functionality. Your application's deployment process is managed through [zerops.yaml](/zerops-yaml/specification), which handles:
+- Database migrations
+- Cache management
+- File cleanup
+- Health check implementation
+- Service orchestration
+- Twill assets compilation
+- Media storage configuration
+## Try the build & deploy pipeline in 30 seconds
+While Zerops supports various CI/CD workflows (CLI, GitHub Actions, built-in CI/CD), let's start with the simplest path to get you familiar with the core concepts:
+1. Create your own repository from our [GitHub template](https://github.com/zeropsio/recipe-laravel-minimal) and clone it locally
+2. Navigate to **Pipelines & CI/CD settings** and connect the service with your new GitHub repository, setting the trigger to **Push to Branch**
+### Test Your Pipeline
+- Make a small change directly in the GitHub UI
+- Commit the change and watch the magic happen in project detail
+## Integration with Existing Applications
+If you're looking to integrate an existing Laravel Twill application with Zerops, review the [changes made over the default installation](https://github.com/zeropsio/recipe-laravel-minimal/blob/main/README.md#changes-made-over-the-default-installation) to understand the necessary modifications.
+## Get to know Zerops core concepts in depth
+Ready to build from scratch? Our [step-by-step Laravel Twill tutorial](/frameworks/laravel/introduction) takes you through the entire process of integrating Zerops with a new Laravel Twill project.
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Frameworks > Laravel > Redis
+
+Redis is a powerful in-memory data structure store serving as a database, cache, message broker, and queue. This guide walks you through Redis integration with your Laravel application on Zerops for high-performance caching, session management, and queue processing.
+Zerops provides [Valkey](https://valkey.io), an open-source Redis alternative that delivers high-performance key/value storage with full Redis compatibility. Valkey supports all common Redis use cases — from caching and message queues to primary database functionality.
+## Adding Redis Service
+To use Valkey (Redis) features with Laravel, first either import Valkey as a service to your Zerops project
+```yaml
+services:
+ - hostname: valkey
+ type: valkey@7.2
+ mode: NON_HA # use HA in production
+```
+or add the Valkey service to your project manually from the Zerops GUI.
+:::tip High Availability Mode
+For production environments, we recommend using `HA` mode. This configuration:
+* Ensures automatic failover during node failures
+* Provides data replication across multiple nodes
+* Improves reliability and uptime
+:::
+## Environment Configuration
+### Basic Redis Settings
+Environment variables control how your Laravel application connects to and uses Redis. Below are the core settings grouped by functionality:
+```yaml
+zerops:
+ - setup: app
+ build:
+ base:
+ - php@8.4
+ os: alpine
+ run:
+ base: php-nginx@8.4
+ os: alpine
+ siteConfigPath: site.conf.tmpl
+ envVariables:
+ # Redis Connection Settings
+ REDIS_CLIENT: phpredis # PHP Redis client for better performance
+ REDIS_HOST: valkey # Internal hostname of Valkey service
+ REDIS_PORT: 6379 # Standard Redis port number
+ # Cache Configuration
+ CACHE_PREFIX: cache # Namespace for cache keys
+ CACHE_STORE: redis # Use Redis as primary cache
+ # Session Configuration
+ SESSION_DRIVER: redis # Store sessions in Redis
+ SESSION_ENCRYPT: false # Disable session encryption
+ SESSION_LIFETIME: 120 # Session timeout in minutes
+ SESSION_PATH: / # Cookie path setting
+ # Queue Configuration
+ QUEUE_CONNECTION: redis # Use Redis for job queues
+ BROADCAST_CONNECTION: redis # Redis for event broadcasting
+```
+## Feature-Specific Configuration
+### Redis Caching
+Laravel's cache system offers a unified API across different cache backends. The following configuration establishes Redis as your primary cache store for fast, reliable data caching:
+```php title="config/cache.php"
+'default' => env('CACHE_STORE', 'database'),
+'stores' => [
+ 'redis' => [
+ 'driver' => 'redis',
+ 'connection' => env('REDIS_CACHE_CONNECTION', 'cache'),
+ 'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'),
+ ],
+],
+'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
+```
+### Session Management with Redis
+Using Redis for session storage provides better performance than file-based sessions and enables seamless session sharing across multiple application servers. You can also set up a custom session connection in the `config/session.php` file.
+```php title="config/session.php"
+'driver' => env('SESSION_DRIVER', 'redis'),
+'lifetime' => env('SESSION_LIFETIME', 120),
+'encrypt' => env('SESSION_ENCRYPT', false),
+```
+### Queue System Configuration
+Redis queues offer a robust solution for handling background jobs in Laravel. This configuration sets up Redis as your queue backend with retry policies and connection settings. You can also set up a custom queue connection in the `config/queue.php` file.
+```php title="config/queue.php"
+'default' => env('QUEUE_CONNECTION', 'redis'),
+'connections' => [
+ 'redis' => [
+ 'driver' => 'redis',
+ 'connection' => 'default',
+ 'queue' => 'default',
+ 'retry_after' => 90, // Retry failed jobs after 90 seconds
+ 'block_for' => null, // Don't block when no jobs available
+ ],
+],
+```
+Consider using [Supervisor](https://laravel.com/docs/5.1/queues#supervisor-configuration) for managing Laravel queues in production.
+### Performance Optimization
+Configure your Redis connection pool for optimal performance:
+```php
+'redis' => [
+ 'client' => env('REDIS_CLIENT', 'phpredis'),
+ 'options' => [
+ 'cluster' => env('REDIS_CLUSTER', 'redis'),
+ 'prefix' => env('REDIS_PREFIX', ''),
+ 'pool' => [
+ 'max_connections' => 50,
+ 'timeout' => 30,
+ ],
+ ],
+],
+```
+## Working with Redis Features
+### Cache Operations Examples
+```php
+// Store items in cache with expiration time
+Cache::put('key', 'value', $seconds);
+// Retrieve cached items with optional default value
+$value = Cache::get('key');
+// Store items indefinitely until manually removed
+Cache::forever('key', 'value');
+```
+### Queue Processing Examples
+```php
+// Dispatch a job to the Redis queue with specific connection
+ProcessPodcast::dispatch($podcast)->onConnection('redis');
+// Start the queue worker process for Redis
+php artisan queue:work redis
+```
+### Session Handling Examples
+```php
+// Store data in the Redis session
+session(['key' => 'value']);
+// Retrieve data from the session with optional default
+$value = session('key');
+```
+
+----------------------------------------
+
+# Frameworks > Laravel > Smtp
+
+# SMTP Configuration for Laravel on Zerops
+:::warning Important Security Note
+By default, SMTP ports are blocked by Zerops firewall for security reasons. To use external SMTP services, please [contact Zerops support](mailto:support@zerops.io) to have the necessary ports opened for your project.
+Include in your request:
+* Detailed explanation of your use case
+* Specific ports and protocols needed
+* Project ID and Organization ID from your Zerops Dashboard
+:::
+## Production Configuration
+### Laravel Mail Configuration
+Laravel comes with a default mail configuration in `config/mail.php`. You typically don't need to modify this file as all settings can be controlled through environment variables.
+The default configuration supports multiple mailer types and reads all sensitive information from your environment. In this example
+
+```php title="config/mail.php"
+return [
+ 'default' => env('MAIL_MAILER', 'smtp'),
+ 'mailers' => [
+ 'smtp' => [
+ 'transport' => 'smtp',
+ 'url' => env('MAIL_URL'),
+ 'host' => env('MAIL_HOST', '127.0.0.1'),
+ 'port' => env('MAIL_PORT', 587),
+ 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
+ 'username' => env('MAIL_USERNAME'),
+ 'password' => env('MAIL_PASSWORD'),
+ 'timeout' => null,
+ 'local_domain' => env('MAIL_EHLO_DOMAIN'),
+ ],
+ 'ses' => [
+ 'transport' => 'ses',
+ ],
+ 'postmark' => [
+ 'transport' => 'postmark',
+ ],
+ 'failover' => [
+ 'transport' => 'failover',
+ 'mailers' => [
+ 'smtp',
+ 'log',
+ ],
+ ],
+ ],
+ 'from' => [
+ 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
+ 'name' => env('MAIL_FROM_NAME', 'Example'),
+ ],
+];
+```
+:::tip Available Mail Transports
+Laravel supports multiple mail transport options:
+- 'smtp' - Standard SMTP server
+- 'sendmail' - Server's sendmail
+- 'mailgun' - Mailgun API
+- 'ses' - Amazon SES
+- 'postmark' - Postmark
+- 'log' - Log messages for testing
+- 'array' - Store in array for testing
+- 'failover' - Fallback to next mailer if one fails
+- 'roundrobin' - Rotate between multiple mailers
+:::
+### Environment Configuration
+Configure your Laravel service with the required mail variables. The following example shows SMTP configuration, but most settings are common across different mail transports:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ run:
+ envVariables:
+ MAIL_MAILER: smtp
+ MAIL_FROM_ADDRESS: noreply@yourdomain.com
+ MAIL_FROM_NAME: YourApp
+ MAIL_HOST: your-smtp-host
+ MAIL_PORT: 587
+ MAIL_USERNAME: your-username
+ MAIL_PASSWORD: your-password
+ MAIL_ENCRYPTION: tls
+```
+If using other mail transports, you might need additional environment variables. Refer to Laravel's Mail documentation for transport-specific configuration.
+## Implementing Email Functionality
+### Creating Mail Classes
+Generate a new mail class using Artisan:
+```bash
+php artisan make:mail WelcomeEmail
+```
+```php title="app/Mail/WelcomeEmail.php"
+view('emails.welcome')
+ ->subject('Welcome to ' . config('app.name'));
+ }
+}
+```
+### Email Template
+Create a blade template for your email content:
+```php title="resources/views/emails/welcome.blade.php"
+# Welcome {{ $user->name }}
+Thanks for joining our application!
+Visit Dashboard
+Thanks,
+{{ config('app.name') }}
+```
+### Sending Emails
+You can send emails either immediately or using a queue:
+```php
+use Illuminate\Support\Facades\Mail;
+use App\Mail\WelcomeEmail;
+// Send immediately
+Mail::to($user->email)->send(new WelcomeEmail($user));
+// Send using queue
+Mail::to($user->email)->queue(new WelcomeEmail($user));
+```
+## Queue Configuration
+For production environments, it's recommended to use a queue system for sending emails to prevent request timeouts and improve application performance. Zerops provides Valkey, an open-source Redis-compatible service that's perfect for handling email queues.
+First, add the Valkey service to your project:
+```yaml
+services:
+ - hostname: redis
+ type: valkey@7.2
+ mode: NON_HA # use HA for high availability in production
+```
+Configure your Laravel service to use Redis for queues:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ run:
+ envVariables:
+ # Queue Configuration
+ QUEUE_CONNECTION: redis
+ REDIS_HOST: redis
+ REDIS_PORT: 6379
+ REDIS_CLIENT: phpredis # PHP Redis client for better performance
+ # Mail Configuration
+ MAIL_MAILER: smtp
+ MAIL_HOST: your-smtp-host.com
+ MAIL_PORT: 587
+ MAIL_USERNAME: your-username
+ MAIL_PASSWORD: your-password
+ MAIL_ENCRYPTION: tls
+ MAIL_FROM_ADDRESS: noreply@yourdomain.com
+ MAIL_FROM_NAME: YourApp
+```
+You can customize the queue behavior in your `config/queue.php`:
+```php title="config/queue.php"
+phpCopy'default' => env('QUEUE_CONNECTION', 'redis'),
+'connections' => [
+ 'redis' => [
+ 'driver' => 'redis',
+ 'connection' => 'default',
+ 'queue' => 'default',
+ 'retry_after' => 90, // Retry failed jobs after 90 seconds
+ 'block_for' => null, // Don't block when no jobs available
+ ],
+],
+```
+## Development Environment
+For local development and testing, Zerops provides a Mailpit service that allows you to catch and inspect all outgoing emails.
+### Setting up Mailpit
+Add this to your project import configuration or import the service separately:
+```yaml
+services:
+ - hostname: mailpit
+ type: go@1
+ buildFromGit: https://github.com/zeropsio/recipe-mailpit
+ enableSubdomainAccess: true
+```
+See [Mailpit recipe repo](https://github.com/zeropsio/recipe-mailpit) for reference.
+Configure your Laravel service to use Mailpit for development:
+```yaml
+zerops:
+ - setup: app
+ run:
+ envVariables:
+ MAIL_MAILER: smtp
+ MAIL_HOST: mailpit
+ MAIL_PORT: 1025
+ MAIL_FROM_ADDRESS: hello@example.com
+ MAIL_FROM_NAME: ZeropsLaravel
+```
+:::tip
+Enable `enableSubdomainAccess` to access the Mailpit web interface where you can view all emails during development.
+:::
+## Best Practices
+- Use queue for sending emails in production to prevent request timeouts
+- Configure proper timeouts for SMTP connections
+- Use environment variables for all mail settings
+- Implement proper error handling for failed email deliveries
+- Test email templates across different email clients
+- Monitor email delivery rates and bounce rates
+- Use Mailpit in development to catch and debug emails
+
+----------------------------------------
+
+# Getting Started
+
+Welcome to Zerops! :star:
+The best way to dive into Zerops is to try it yourself. Pick your favourite technology from the list below and follow the tutorials there:
+### Runtimes, web servers & Linux containers
+### Databases, search engines & message brokers
+
+----------------------------------------
+
+# Gleam > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing Gleam application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](/gleam/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple Gleam web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Gleam > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](/gleam/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](/gleam/how-to/build-pipeline#ports) `3000`, simply use `http://app:3000`
+:::info
+Do not use `https://` when communicating with Gleam from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use Gleam environment variables
+Zerops creates default environment variables for each Gleam service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](/gleam/how-to/env-variables#generated-env-variables) of the Gleam service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](/gleam/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your Gleam application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access Gleam application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/gleam/how-to/env-variables) are available when connected through VPN. To connect to your Gleam application in Zerops set the hostname and [internal port](/gleam/how-to/build-pipeline#ports) e.g. http://app:3000
+:::info
+Do not use `https://` when communicating with Gleam over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your Gleam service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your Gleam service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/gleam/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Gleam > How To > Build Pipeline
+
+Zerops provides a customizable build and runtime environment for your Gleam application.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: gleam@latest
+ # OPTIONAL. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customise the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # REQUIRED. Build your application
+ buildCommands:
+ - npm i
+ - npm run build
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - dist
+ - package.json
+ - node_modules
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ cache: node_modules
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: gleam@latest
+ # OPTIONAL. Sets the internal port(s) your app listens on:
+ ports:
+ # port number
+ - port: 3000
+ # OPTIONAL. Customise the runtime Gleam environment by installing additional
+ # dependencies to the base Gleam runtime environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Gleam application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # REQUIRED. Your Gleam application start command
+ start: npm start
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your Gleam application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Build pipeline configuration
+### base
+_REQUIRED._ Sets the base technology for the build environment.
+Following options are available for Gleam builds:
+```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
+ ...
+```
+ The base build environment contains {data.alpine.default}, the selected
+ major version of Gleam, Zerops command line tool, `npm`, `yarn`, `git` and `npx` tools.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
+```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
+ ...
+```
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
+To customise your build environment use the [prepareCommands](/gleam/how-to/build-pipeline#preparecommands) attribute.
+:::note
+Modifying the base technology will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### os
+_OPTIONAL._ Sets the operating system for the build environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+:::note
+Changing the OS setting will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache behavior.
+:::
+### prepareCommands
+_OPTIONAL._ Customises the build environment by installing additional dependencies or tools to the base build environment.
+The base build environment contains:
+- {data.alpine.default}
+- selected version of Gleam defined in the [base](/gleam/how-to/build-pipeline#base) attribute
+- [Zerops command line tool](/references/cli)
+- `npm`, `yarn`, `git` and `npx` tools
+To install additional packages or tools add one or more prepare commands:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: gleam@latest
+ # OPTIONAL. Customise the build environment by installing additional packages
+ # or tools to the base build environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first build is triggered, Zerops will
+1. create a build container
+2. download your application code from your repository
+3. run the prepare commands in the defined order
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::note
+These commands are skipped when using cached environment. Modifying `prepareCommands` will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache invalidation.
+:::
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/gleam/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all prepare commands are finished, your custom build environment is ready for the build phase.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### buildCommands
+_REQUIRED._ Defines build commands.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: gleam@latest
+ # REQUIRED. Build your application
+ buildCommands:
+ - npm i
+ - npm run build
+ ...
+```
+At least one command is required. Zerops triggers each command in the defined order in a dedicated build container.
+Before the build commands are triggered the build container contains:
+1. base environment defined by the [base](/gleam/how-to/build-pipeline#base) attribute
+2. optional customisation of the base environment defined in the [prepareCommands](/gleam/how-to/build-pipeline#preparecommands) attribute
+3. your application code
+#### Run build commands as a single shell instance
+Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it.
+```yaml
+buildCommands:
+ - |
+ npm i
+ npm run build
+```
+#### Run build commands as a separate shell instances
+When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command.
+```yaml
+buildCommands:
+ - npm i
+ - npm run build
+```
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/gleam/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the --verbose option.
+```yaml
+buildCommands:
+ - npm i --verbose
+ - npm run build
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the deploy phase.
+### deployFiles
+_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
+```yaml
+# REQUIRED. Select which files / folders to deploy after
+# the build has successfully finished
+deployFiles:
+ - dist
+ - package.json
+ - node_modules
+```
+Determines files or folders produced by your build, which should be deployed to your runtime service containers.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Examples
+Deploys a folder, and a file from the project root directory:
+```yaml
+deployFiles:
+ - dist
+ - package.json
+```
+Deploys the whole content of the build container:
+```yaml
+deployFiles: .
+```
+Deploys a folder, and a file in a defined path:
+```yaml
+deployFiles:
+ - ./path/to/file.txt
+ - ./path/to/dir/
+```
+#### How to use a wildcard in the path
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+Deploys all folders that are located in any path that begins with `/path/to/`
+```yaml
+deployFiles: ./path/to/~/
+```
+Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/
+```
+:::note Example
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+:::
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+_OPTIONAL._ Defines which files or folders will be cached for the next build.
+```yaml
+# OPTIONAL. Which files / folders you want to cache for the next build.
+# Next builds will be faster when the cache is used.
+cache: file.txt
+```
+The cache attribute helps optimize build times by preserving specified files between builds.
+The cache attribute supports the [~ wildcard character](#how-to-use-a-wildcard-in-the-path).
+Learn more about the [build cache system](/features/build-cache) in Zerops.
+### envVariables
+_OPTIONAL._ Defines the environment variables for the build environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ base: gleam@latest
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/gleam/how-to/env-variables) in Zerops.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current Gleam version for your runtime.
+Following options are available for Gleam runtimes:
+```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
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the
+ selected major version of Gleam, Zerops command line tool, `npm`, `yarn`, `git` and `npx` tools.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```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
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customise your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a Gleam service with hostname = "app" and port = 3000 from another service of the same project, simply use `app:3000`. Read more about [how to access a Gleam service](/gleam/how-to/access).
+Each port has following attributes:
+| parameter | description |
+| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| port | Defines the port number. You can set any port number between _10_ and _65435_. Ports outside this interval are reserved for internal Zerops systems. |
+| protocol | **Optional.** Defines the protocol. Allowed values are `TCP` or `UDP`. Default value is `TCP`. |
+| httpSupport | **Optional.** `httpSupport = true` is the default setting for TCP protocol. Set `httpSupport = false` if a web server isn't running on the port. Zerops uses this information for the configuration of [public access](/features/access). `httpSupport = true` is available only in combination with the TCP protocol. |
+| httpSupport | **Optional.** `httpSupport = true` is the default setting for TCP protocol. Set `httpSupport = false` if a web server isn't running on the port. Zerops uses this information for the configuration of [public access](/features/access). `httpSupport = true` is available only in combination with the TCP protocol. |
+### prepareCommands
+_OPTIONAL._ Customises the Gleam runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base Gleam environment contains {data.alpine.default} the selected
+ major version of Gleam, Zerops command line tool and `npm`, `yarn`, `git` and `npx` tools. To install
+ additional packages or tools add one or more prepare commands:
+```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 Gleam runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/gleam/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/gleam/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the custom runtime cache go to `yyy`
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.default}, the
+ selected major version of Gleam, Zerops command line tool and `npm`, `yarn`, `git` and `npx` tools.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare: ./runtime-config.yaml
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base Gleam runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Gleam application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your Gleam application is started via the [start command](/gleam/how-to/build-pipeline#start).
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](/gleam/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](/gleam/how-to/build-pipeline#preparecommands-1) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](/gleam/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/gleam/how-to/env-variables) in Zerops.
+### start
+_REQUIRED._ Defines the start command for your Gleam application.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Gleam application start command
+ start: npm start
+```
+We recommend starting your Gleam application using `npm start`.
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Gleam application start command
+ start: npm start
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+| Parameter | Description |
+| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **command** | Defines a local command to be run.
+The command has access to the same [environment variables](/gleam/how-to/create#set-secret-environment-variables) as your Gleam application.
+A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below. |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Gleam application start command
+ start: npm start
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+### crontab
+_OPTIONAL._ Defines cron jobs.
+Setup cron jobs in the following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ crontab:
+ # REQUIRED. Sets the command to execute:
+ - command: ""
+ # REQUIRED. Sets the interval time to execute:
+ timing: "0 * * * *"
+```
+Read more about setting up [cron](/references/cron) in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](/gleam/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](/gleam/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+| Parameter | Description |
+| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **command** | Defines a local command to be run.
+The command has access to the same [environment variables](/gleam/how-to/create#set-secret-environment-variables) as your Gleam application.
+A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below. |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](/gleam/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Gleam > How To > Build Process
+
+
+## Description of the build process
+Zerops starts a temporary build container and performs following actions:
+1. Installs the build environment:
+ - Sets up base system and Go runtime
+ - Restores cached files if available (based on `build.cache` configuration)
+ - Validates cache against current `build.os`, `build.base`, and `build.prepareCommands`
+2. Downloads your application source code from [GitHub ↗](https://www.github.com), [GitLab ↗](https://www.gitlab.com) or via [Zerops CLI](/references/cli)
+3. Optionally [customizes the build environment](#customize-gleam-build-environment)
+4. Runs the build commands
+5. Uploads the application artefact to the internal Zerops storage
+6. Preserves specified files for future builds (based on `build.cache` configuration)
+7. Optionally [customizes the runtime environment](/gleam/how-to/customize-runtime)
+8. [Deploys your application](/gleam/how-to/deploy-process)
+The build container is automatically deleted after the build has finished or failed.
+## Cancel running build
+When you know that the running build is not correct and you want to cancel it, you can do it in Zerops GUI. Go to the service detail, open the list of running processes and click on the **Open pipeline detail** button. Then click on the **Cancel build** button.
+
+:::caution
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+:::
+## Customize Gleam build environment
+The default Gleam build environment contains:
+- {data.alpine.default}
+- selected version of Gleam defined in `zerops.yaml` [build.base](/gleam/how-to/build-pipeline#base) parameter
+- [zCLI](/references/cli), Zerops command line tool
+- `npm`, `yarn`, `git` and `npx` tools
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/gleam/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](/gleam/how-to/build-pipeline#preparecommands) commands to your `zerops.yaml`.
+:::info
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::
+## Gleam build hardware resources
+Build of your Gleam application is run in a separate build container with following resource configuration:
+| HW resource | Minimum | Maximum |
+| ------------- | ------- | ------- |
+| **CPU cores** | 6 | 20 |
+| **RAM** | 8 GB | 8 GB |
+| **Disk** | 1 GB | 100 GB |
+| **Disk** | 1 GB | 100 GB |
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+## Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops will terminate the build pipeline and delete the build container.
+## Troubleshooting build-related problems
+### Failure of a build prepare command
+If any [prepare command](/gleam/how-to/build-pipeline#preparecommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/gleam/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom build environment is ready for the build phase.
+### Invalidate the build cache
+If you encounter unexpected build behavior or dependency issues, the problem might be related to [cached build data](/features/build-cache). While Zerops maintains the build cache to speed up deployments, sometimes you may need to start fresh.
+To invalidate the build cache:
+1. Go to your service detail in Zerops GUI
+2. Choose **Pipelines & CI/CD Settings** from the left menu
+3. Click on the **Invalidate build cache** button
+This will force Zerops to run the next build clean, including all prepare commands, which can help resolve cache-related issues. After invalidation, your next build will also create a fresh cache.
+### Failure of a build command
+If any [build command](/gleam/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/gleam/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `--verbose` option.
+```yaml
+buildCommands:
+ - npm i --verbose
+ - npm run build
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the [deploy](/gleam/how-to/deploy-process) phase.
+
+----------------------------------------
+
+# Gleam > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart Gleam service in Zerops GUI
+To stop the Gleam service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped Gleam service choose the **Start** item from the same menu.
+To restart the Gleam service choose the **Restart** item from the same menu.
+## Stop and start Gleam using zCLI
+zCLI is the Zerops command-line tool. To stop and start the Gleam service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Gleam > How To > Create
+
+Zerops provides a powerful Gleam runtime service with extensive build support. The Gleam runtime is highly scalable and customizable to suit your development and production needs. With just a few clicks or commands, you can have a production-ready Gleam environment up and running in no time.
+## Create a Gleam service using Zerops GUI
+First, set up a project in the Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu under the **Services** section. From there, you can add a new Gleam service:
+### Choose a Gleam version
+Zerops supports the following Gleam versions:
+:::info
+You can easily [upgrade](/gleam/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app", "cache", "gui", etc. Duplicate services with the same name within the same project are not allowed.
+#### Limitations:
+- Maximum 25 characters
+- Must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created and cannot be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as passwords, tokens, salts, certificates, etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting secret environment variables is optional. You can always set them later in the Zerops GUI.
+Read more about the [different types of environment variables](/gleam/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Configure auto scaling
+Zerops automatically scales Gleam services both vertically and horizontally. Vertical scaling adjusts the hardware resources (CPU, RAM, and disk) of a Gleam container, while horizontal scaling adds or removes entire containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. The power your application receives depends on the other applications running on the same CPU core. In the best-case scenario, your application gets 10/10 of the CPU core power, and 1/10 in the worst-case scenario.
+**Dedicated**
+The CPU core is dedicated exclusively to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+You can choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has the following default configuration:
+Gleam services always start with the minimal resources.
+In most cases, the default parameters will work without issues. If you need to limit the cost of the Gleam service, you can lower the maximum resources. Zerops will never scale above the selected maximums.
+If you experience insufficient Gleam performance or capacity, you can increase the minimum resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine-tune](/gleam/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application's needs.
+:::
+:::info
+You can change the vertical auto scaling parameters at any time.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but is already consuming the maximum resources defined for vertical auto scaling, Zerops will add a new container to your Gleam service. When your Gleam service doesn't need as much power and all containers are vertically scaled down such that their CPU allocation is near the minimum resources, Zerops will gradually remove entire containers.
+Horizontal auto scaling has the following default configuration:
+
+ Minimum containers
+
+ 1
+
+ Maximum containers
+
+ 6
+
+Gleam services always start with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](/gleam/how-to/scaling) about Gleam auto scaling in Zerops.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will automatically start a new container and deploy your application. However, the application will be unavailable for a short period. This mode is recommended for non-critical applications or development environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers based on your application's load. An application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed down to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents temporary outages in case any of the Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically, and the broken container will be deleted.
+:::caution
+Make sure your application is designed to run in multiple containers.
+:::
+## Create a Gleam service using zCLI
+zCLI is the Zerops command-line tool. To create a new Gleam service via the command line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/gleam/how-to/create#create-a-project-description-file)
+3. [Create a project with a Gleam and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a YAML format to describe the project infrastructure.
+#### Basic example:
+Create a directory called `my-project`. Inside the `my-project` directory, create a `description.yaml` file with the following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in gleam@{version} format
+ type: gleam@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one Gleam version 20 service with default [auto scaling](/gleam/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/gleam/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Gleam and PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in gleam@{version} format
+ type: gleam@latest
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+ - # second service hostname
+ hostname: db
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain a Gleam service and a [PostgreSQL](/postgresql/overview) service.
+Gleam service with "app" hostname, the internal port(s) the service listens on will be defined later in the [zerops.yaml](/gleam/how-to/build-pipeline#ports). Gleam service will run on version 20 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+| Parameter | Description | Limitations |
+| --------------- | ------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
+| **name** | The name of the new project. Duplicates are allowed. | |
+| **description** | **Optional.** Description of the new project. | Maximum 255 characters. |
+| **tags** | **Optional.** One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects. |
+| **tags** | **Optional.** One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects. |
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains Gleam and PostgreSQL services but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [Gleam service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+ All verticalAutoscaling attributes are optional. Not specified
+ attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers
+ for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value
+ map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add Gleam service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in gleam@{version} format
+ type: gleam@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Gleam service version 20 with default [auto scaling](/gleam/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Gleam > How To > Customize Runtime
+
+
+The default Gleam runtime environment contains:
+- {data.alpine.default}
+- selected version of Gleam selected when the runtime service was created.
+-
+ `zCLI`
+
+ , Zerops command line tool
+- `npm`, `yarn`, `git` and `npx` tools
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/gleam/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more `run.prepareCommands` commands to your `zerops.yaml`.
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/gleam/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `run.prepareCommands` commands in the defined order
+### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/gleam/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+The prepare runtime container is automatically deleted after the prepare runtime phase has finished or failed.
+### Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the `build.addToRunPrepare` and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the custom runtime cache go to `yyy`
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+
+----------------------------------------
+
+# Gleam > How To > Delete
+
+## Delete Gleam service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete Gleam using zCLI
+zCLI is the Zerops command-line tool. To delete the Gleam service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Gleam > How To > Deploy Process
+
+
+## Application artefact
+When the [build phase](/gleam/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](/gleam/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/gleam/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/gleam/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/gleam/how-to/build-pipeline#initcommands)
+4. Starts your application using the [start command](/gleam/how-to/build-pipeline#start)
+5. Optionally waits until the [readiness check](/gleam/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/gleam/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customise the runtime environment](/gleam/how-to/build-pipeline#preparecommands-1).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The Gleam process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready to handle requests right after it is started via the [start command](/gleam/how-to/build-pipeline#start), configure a [readiness check](/gleam/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your Gleam service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/gleam/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Gleam > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+| environment | type | defined in |
+| ----------- | ------ | --------------------------------------------------------------------------------- |
+| build | basic | [zerops.yaml](/gleam/how-to/build-pipeline#envvariables) |
+| runtime | basic | [zerops.yaml](/gleam/how-to/build-pipeline#envvariables-1) |
+| runtime | secret | [Zerops GUI](#set-secret-env-variables-in-zerops-gui) |
+| runtime | secret | [Zerops GUI](#set-secret-env-variables-in-zerops-gui) |
+Use the [secret env variables](/gleam/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](/gleam/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/gleam/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](/gleam/how-to/create) a new Gleam service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made to environment variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The Gleam process running in the container receives the list env variables only when it starts. Update of the env variables while the Gleam process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+These restrictions apply to all [types of env variables](/gleam/how-to/env-variables#types-of-env-variables-in-zerops).
+## Referencing other env variables
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your Gleam runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the Gleam service. The Gleam process running in the container receives the list env variables only when it starts. Update of the env variables while the Gleam process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a Gleam service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your Gleam app
+Zerops passes all environment variables from all project services when your Gleam app is deployed and started.
+To access the local environment variable i.e. the variable set to this Gleam service in your app, use:
+```sh
+process.env.YOUR_VARIABLE_KEY_HERE
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+
+----------------------------------------
+
+# Gleam > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Gleam > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](/gleam/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](/gleam/how-to/build-pipeline#preparecommands-1) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the runtime containers in Zerops CLI use
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## Gleam logging configuration
+Zerops logs all messages sent
+- to the standard error (`stderr`)
+- to the standard output (`stdout`)
+- via the Gleam `console.log` method
+### Severity level
+By default the `console.log` creates a message with the `Informational (6)` severity.
+Add a severity number in the `` format as a prefix to set a custom severity as shown below:
+```js
+console.log('A message with the informational severity ...');
+console.log('Emergency (0) severity > system is unusable.');
+console.log('Alert (1) severity > action must be taken immediately.');
+console.log('Critical (2) severity > critical conditions.');
+console.log('Error (3) severity > error conditions.');
+console.log('Warning (4) severity > warning conditions.');
+console.log('Notice (5) severity > normal, but significant, condition.');
+console.log('Informational (6) severity > informational message.');
+console.log('Debug (7) severity > debug-level message.');
+```
+:::info
+`console.info`, `console.warn`, `console.debug`
+, and `console.error` are just aliases to the `
+ console.log
+` method. They don't set the appropriate severity number. Use the `
+ <N>
+` prefix instead. :::
+
+----------------------------------------
+
+# Gleam > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the Gleam service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Gleam service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Gleam service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Gleam performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Gleam service. When your Gleam service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Gleam service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each Gleam service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the Gleam service.
+### Not enough resources to scale up
+If one of the Gleam containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the Gleam service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor Gleam resources
+Zerops provides information about how much hardware resources the Gleam service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Gleam > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your Gleam service directly when creating a new shared storage service. Just select your Gleam service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the Gleam service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create Gleam service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new Gleam service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/gleam/how-to/shared-storage#create-a-project-description-file)
+3. [Create a project with a Gleam service and a shared storage](/gleam/how-to/shared-storage#create-a-project-with-a-gleam-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](/gleam/how-to/create#create-a-project-description-file) how to define the Gleam service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Gleam and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in gleam@{version} format
+ type: gleam@latest
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the Gleam service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with a Gleam service and a shared storage
+Follow the article [How to create a project based on the description.yaml](/gleam/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Gleam > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](/gleam/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](/gleam/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](/gleam/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Gleam > How To > Upgrade
+
+You can upgrade or downgrade your Gleam service to a different major Gleam version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/gleam/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Gleam version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Gleam version for your runtime.
+If you want to build your application with a different major Gleam version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
+
+----------------------------------------
+
+# Gleam > Overview
+
+[Gleam ↗](https://gleam.org/en) is an asynchronous event-driven JavaScript runtime, which is designed to build scalable network applications.
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-gleam), a **_recipe_**, containing the most simple Gleam web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of Gleam app running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-gleam/blob/main/zerops-project-import.yaml)):
+```yaml
+project:
+ name: recipe-gleam
+ tags:
+ - zerops-recipe
+services:
+ - hostname: api
+ type: gleam@1.5
+ enableSubdomainAccess: true
+ buildFromGit: https://github.com/zeropsio/recipe-gleam
+ - hostname: db
+ type: postgresql@16
+ mode: NON_HA
+ priority: 1
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://api-808-3000.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+{"message":"This is a simple Gleam application running on Zerops.io, each request adds an entry to the PostgreSQL database and returns a count. See the source repository (https://github.com/zeropsio/recipe-gleam) for more information.","newEntry":"e64be640-d6c2-4be8-93ac-d1e40e56fa06","count":1}
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+## How to start
+It doesn't matter whether it's your first curious introduction to Zerops, you have already mastered the basics and are looking for a tiny detail or inspiration. Below, choose a section that fits your needs:
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Go > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing Go application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](/go/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple Go web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Go > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](/go/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](/go/how-to/build-pipeline#ports) `8080`, simply use `http://app:8080`
+:::info
+Do not use `https://` when communicating with Go from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use Go environment variables
+Zerops creates default environment variables for each Go service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](/go/how-to/env-variables#generated-env-variables) of the Go service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](/go/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your Go application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access Go application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/go/how-to/env-variables) are available when connected through VPN. To connect to your Go application in Zerops set the hostname and [internal port](/go/how-to/build-pipeline#ports) e.g. http://app:8080
+:::info
+Do not use `https://` when communicating with Go over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your Go service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your Go service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/go/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Go > How To > Build Pipeline
+
+Zerops provides a customizable build and runtime environment for your Go application.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: go@latest
+ # OPTIONAL. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # REQUIRED. Build your application
+ buildCommands:
+ - go build -o app main.go
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles: app
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ # cache: some_file
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: go@latest
+ # OPTIONAL. Sets the internal port(s) your app listens on:
+ ports:
+ # port number
+ - port: 8080
+ # OPTIONAL. Customize the runtime Go environment by installing additional
+ # dependencies to the base Go runtime environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Go application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # REQUIRED. Your Go application start command
+ start: ./app
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your Go application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Build pipeline configuration
+### base
+_REQUIRED._ Sets the base technology for the build environment.
+Following options are available for Go builds:
+```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
+ ...
+```
+ The base build environment contains {data.alpine.default}, the selected
+ version of Go, Zerops command line tool, `git` and `wget`.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
+```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
+ prepareCommands:
+ - zsc add nodejs@latest
+ ...
+```
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
+To customize your build environment use the [prepareCommands](/go/how-to/build-pipeline#preparecommands) attribute.
+:::note
+Modifying the base technology will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### os
+_OPTIONAL._ Sets the operating system for the build environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customized.
+:::
+:::note
+Changing the OS setting will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache behavior.
+:::
+### prepareCommands
+_OPTIONAL._ Customizes the build environment by installing additional dependencies or tools to the base build environment.
+The base build environment contains:
+- {data.alpine.default}
+- selected version of Go defined in the [base](/go/how-to/build-pipeline#base) attribute
+- [Zerops command line tool](/references/cli)
+- `git` and `wget`
+To install additional packages or tools add one or more prepare commands:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: go@latest
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first build is triggered, Zerops will
+1. create a build container
+2. download your application code from your repository
+3. run the prepare commands in the defined order
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::note
+These commands are skipped when using cached environment. Modifying `prepareCommands` will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache invalidation.
+:::
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/go/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all prepare commands are finished, your custom build environment is ready for the build phase.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### buildCommands
+_REQUIRED._ Defines build commands.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: go@latest
+ # REQUIRED. Build your application
+ buildCommands:
+ - go build -o app main.go
+ ...
+```
+At least one command is required. Zerops triggers each command in the defined order in a dedicated build container.
+Before the build commands are triggered the build container contains:
+1. base environment defined by the [base](/go/how-to/build-pipeline#base) attribute
+2. optional customisation of the base environment defined in the [prepareCommands](/go/how-to/build-pipeline#preparecommands) attribute
+3. your application code
+#### Run build commands as a single shell instance
+Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it. Suppose your `main.go` file is in a `src` directory.
+```yaml
+buildCommands:
+ - |
+ cd src
+ go build -o app main.go
+```
+#### Run build commands as a separate shell instances
+When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command. Suppose your `main.go` file is in a `src` directory.
+```yaml
+buildCommands:
+ - cd src
+ - go build -o app src/main.go
+```
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/go/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the --verbose option.
+```yaml
+buildCommands:
+ - go build -v -o app main.go
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the deploy phase.
+### deployFiles
+_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
+```yaml
+# REQUIRED. Select which files / folders to deploy after
+# the build has successfully finished
+deployFiles:
+ - app
+```
+Determines files or folders produced by your build, which should be deployed to your runtime service containers.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Examples
+Deploys a folder, and a file from the project root directory:
+```yaml
+deployFiles:
+ - app
+ - file.txt
+```
+Deploys the whole content of the build container:
+```yaml
+deployFiles: .
+```
+Deploys a folder, and a file in a defined path:
+```yaml
+deployFiles:
+ - ./path/to/file.txt
+ - ./path/to/dir/
+```
+#### How to use a wildcard in the path
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+Deploys all folders that are located in any path that begins with `/path/to/`
+```yaml
+deployFiles: ./path/to/~/
+```
+Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/
+```
+:::note Example
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+:::
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+_OPTIONAL._ Defines which files or folders will be cached for the next build.
+```yaml
+# OPTIONAL. Which files / folders you want to cache for the next build.
+# Next builds will be faster when the cache is used.
+cache: file.txt
+```
+The cache attribute helps optimize build times by preserving specified files between builds.
+The cache attribute supports the [~ wildcard character](#how-to-use-a-wildcard-in-the-path).
+Learn more about the [build cache system](/features/build-cache) in Zerops.
+### envVariables
+_OPTIONAL._ Defines the environment variables for the build environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ base: go@latest
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ GO_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/go/how-to/env-variables) in Zerops.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current Go version for your runtime.
+Following options are available for Go builds:
+```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
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the
+ selected major version of Go, Zerops command line tool, `git` and `wget`.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```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
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customise your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a Go service with hostname = "app" and port = 8080 from another service of the same project, simply use `app:8080`. Read more about [how to access a Go service](/go/how-to/access).
+Each port has following attributes:
+
+ Parameter
+ Description
+
+ port
+ Defines the port number. You can set any port number between 10 and 65435. Ports outside this interval are reserved for internal Zerops systems.
+
+ protocol
+ Optional. Defines the protocol. Allowed values are TCP or UDP. Default value is TCP.
+
+ httpSupport
+ Optional. httpSupport = true is the default setting for TCP protocol. Set httpSupport = false if a web server isn't running on the port. Zerops uses this information for the configuration of public access. httpSupport = true is available only in combination with the TCP protocol.
+
+### prepareCommands
+_OPTIONAL._ Customises the Go runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base Go environment contains {data.alpine.default}, the selected
+ major version of Go, Zerops command line tool and `git` and `wget`. To install additional packages or tools add one or more prepare commands:
+```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 Go runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/go/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/go/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+When the prepare cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.default}, the
+ selected major version of Go, Zerops command line tool and `git` and `wget`.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare: ./runtime-config.yaml
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base Go runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Go application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your Go application is started via the [start command](/go/how-to/build-pipeline#start).
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](/go/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](/go/how-to/build-pipeline#preparecommands-1) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](/go/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ GO_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/go/how-to/env-variables) in Zerops.
+### start
+_REQUIRED._ Defines the start command for your Go application.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Go application start command
+ start: ./app
+```
+We recommend starting your Go application using `./app`.
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Go application start command
+ start: ./app
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Go application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Go application start command
+ start: ./app
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+### crontab
+_OPTIONAL._ Defines cron jobs.
+Setup cron jobs in the following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ crontab:
+ # REQUIRED. Sets the command to execute:
+ - command: ""
+ # REQUIRED. Sets the interval time to execute:
+ timing: "0 * * * *"
+```
+Read more about setting up [cron](/references/cron) in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](/go/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](/go/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Go application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](/go/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Go > How To > Build Process
+
+
+## Description of the build process
+Zerops starts a temporary build container and performs following actions:
+1. Installs the build environment:
+ - Sets up base system and Go runtime
+ - Restores cached files if available (based on `build.cache` configuration)
+ - Validates cache against current `build.os`, `build.base`, and `build.prepareCommands`
+2. Downloads your application source code from [GitHub ↗](https://www.github.com), [GitLab ↗](https://www.gitlab.com) or via [Zerops CLI](/references/cli)
+3. Optionally [customizes the build environment](#customize-go-build-environment)
+4. Runs the build commands
+5. Uploads the application artefact to the internal Zerops storage
+6. Preserves specified files for future builds (based on `build.cache` configuration)
+7. Optionally [customizes the runtime environment](/go/how-to/customize-runtime)
+8. [Deploys your application](/go/how-to/deploy-process)
+The build container is automatically deleted after the build has finished or failed.
+## Cancel running build
+When you know that the running build is not correct and you want to cancel it, you can do it in Zerops GUI. Go to the service detail, select **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Cancel build** button.
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+## Customize Go build environment
+The default Go build environment contains:
+- {data.alpine.default}
+- selected version of Go defined in `zerops.yaml` [build.base](/go/how-to/build-pipeline#base) parameter
+- [zCLI](/references/cli), Zerops command line tool
+- `git` and `wget`
+:::note
+To use Ubuntu instead of the default Alpine, set the [build.os](/zerops-yaml/specification#os-) attribute.
+Additional packages and tools can be installed using [build.prepareCommands](/zerops-yaml/specification#preparecommands-).
+:::
+:::info
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::
+## Go build hardware resources
+Build of your Go application is run in a separate build container with following resource configuration:
+| HW resource | Minimum | Maximum |
+| ------------- | ------- | ------- |
+| **CPU cores** | 6 | 20 |
+| **RAM** | 8 GB | 8 GB |
+| **Disk** | 1 GB | 100 GB |
+| **Disk** | 1 GB | 100 GB |
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+## Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops will terminate the build pipeline and delete the build container.
+## Troubleshooting build-related problems
+### Failure of a build prepare command
+If any [prepare command](/go/how-to/build-pipeline#preparecommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/go/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom build environment is ready for the build phase.
+### Invalidate the build cache
+If you encounter unexpected build behavior or dependency issues, the problem might be related to [cached build data](/features/build-cache). While Zerops maintains the build cache to speed up deployments, sometimes you may need to start fresh.
+To invalidate the build cache:
+1. Go to your service detail in Zerops GUI
+2. Choose **Pipelines & CI/CD Settings** from the left menu
+3. Click on the **Invalidate build cache** button
+This will force Zerops to run the next build clean, including all prepare commands, which can help resolve cache-related issues. After invalidation, your next build will also create a fresh cache.
+### Failure of a build command
+If any [build command](/go/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/go/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the verbose `-v` option.
+```yaml
+build:
+ - go build -v
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the [deploy](/go/how-to/deploy-process) phase.
+
+----------------------------------------
+
+# Go > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart Go service in Zerops GUI
+To stop the Go service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped Go service choose the **Start** item from the same menu.
+To restart the Go service choose the **Restart** item from the same menu.
+## Stop and start Go using zCLI
+zCLI is the Zerops command-line tool. To stop and start the Go service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and its services to choose from.
+:::
+
+----------------------------------------
+
+# Go > How To > Create
+
+Zerops provides a Go runtime service with extensive build support. Go runtime is highly scalable and customisable to suit both development and production.
+## Create Go service using Zerops GUI
+First, set up a project in Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new Go service:
+### Choose Go version
+Following Go versions are currently supported:
+:::info
+You can [change](/go/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app","cache", "gui" etc. Duplicate services with the same name in the same project are forbidden.
+#### Limitations:
+- maximum 25 characters
+- must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created. It can't be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as password, tokens, salts, certificates etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting the secret environment variables is optional. You can set them later in Zerops GUI.
+Read more about [different types of env variables](/go/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Set auto scaling configuration
+Zerops scales the Go services automatically both vertically and horizontally. Vertical scaling means increasing or decreasing the hardware resources (CPU, RAM and disk) of a Go container. Horizontal scaling adds or removes whole containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Go service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Go service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Go performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/go/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+:::info
+You can change the vertical auto scaling parameters later.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Go service. When your Go service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Go service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](/go/how-to/scaling) about Go auto scaling.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Create Go service using zCLI
+zCLI is the Zerops command-line tool. To create a new Go service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/go/how-to/create#create-a-project-description-file)
+3. [Create a project with a Go and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### Basic example:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in go@{version} format
+ type: go@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one Go version 1 service with default [auto scaling](/go/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/go/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Go and PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in go@{version} format
+ type: go@latest
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create secret env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+ - # second service hostname
+ hostname: db
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain a Go service and a [PostgreSQL](/postgresql/overview) service.
+Go service with "app" hostname, the internal port(s) the service listens on will be defined later in the zerops.yaml. Go service will run on version 1 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ The hostname of the new database will be set to the `hostname` value.
+
+ Limitations:
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [Go service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+
+ All verticalAutoscaling attributes are optional. Not specified attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add Go service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in go@{version} format
+ type: go@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Go service version 1 with default [auto scaling](/go/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Go > How To > Customize Runtime
+
+
+The default Go runtime environment contains:
+- {data.alpine.default}
+- Selected version of Go when the runtime service was created.
+- [zCLI](/references/cli)
+- Git
+:::note
+To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yaml/specification#os--1) attribute.
+Additional packages and tools can be installed using [run.prepareCommands](/zerops-yaml/specification#preparecommands--1).
+:::
+## Runtime Flow
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. Create a prepare runtime container
+2. Optionally: [copy selected folders or files from your build container](/go/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. Run the run.prepareCommands in the defined order
+### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/go/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+The prepare runtime container is automatically deleted after the prepare runtime phase has finished or failed.
+### Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the build.addToRunPrepare and run.prepareCommands attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+
+----------------------------------------
+
+# Go > How To > Delete
+
+## Delete Go service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete Go using zCLI
+zCLI is the Zerops command-line tool. To delete the Go service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Go > How To > Deploy Process
+
+
+## Application artefact
+When the [build phase](/go/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](/go/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/go/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/go/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/go/how-to/build-pipeline#initcommands)
+4. Starts your application using the [start command](/go/how-to/build-pipeline#start)
+5. Optionally waits until the [readiness check](/go/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/go/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customize the runtime environment](/go/how-to/customize-runtime).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The Go process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready to handle requests right after it is started via the [start command](/go/how-to/build-pipeline#start), configure a [readiness check](/go/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your Go service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/go/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Go > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+
+ Type
+ Environment
+ Defined in
+
+ basic
+ build
+ zerops.yaml
+
+ basic
+ runtime
+ zerops.yaml
+
+ secret
+ runtime
+ Zerops GUI
+
+Use the [secret env variables](/go/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](/go/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/go/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](/go/how-to/create) a new Go service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made to environment variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The Go process running in the container receives the list env variables only when it starts. Update of the env variables while the Go process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+These restrictions apply to all [types of env variables](/go/how-to/env-variables#types-of-env-variables-in-zerops).
+## Referencing other env variables
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your Go runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the Go service. The Go process running in the container receives the list env variables only when it starts. Update of the env variables while the Go process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a Go service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your Go app
+Zerops passes all environment variables from all project services when your Go app is deployed and started.
+To access the local environment variable i.e. the variable set to this Go service in your app, use:
+```sh
+os.Getenv("YOUR_VARIABLE_KEY_HERE")
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+
+----------------------------------------
+
+# Go > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Go > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](/go/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](/go/how-to/build-pipeline#preparecommands-1) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the runtime containers in Zerops CLI use
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## Go logging configuration
+Zerops logs all messages sent
+- to the standard error (`stderr`)
+- to the standard output (`stdout`)
+- via the Go `fmt.Println` or `slog.Info` methods etc.
+### Severity level
+By default the `fmt.Println` or `slog` methods create messages with the `Informational (6)` severity.
+Add a severity number in the `` format as a prefix to set a custom severity as shown below:
+```go
+slog.Info("A message with the informational severity ...")
+slog.Info("Emergency (0) severity > system is unusable.")
+slog.Info("Alert (1) severity > action must be taken immediately.")
+slog.Info("Critical (2) severity > critical conditions.")
+slog.Info("Error (3) severity > error conditions.")
+slog.Info("Warning (4) severity > warning conditions.")
+slog.Info("Notice (5) severity > normal, but significant, condition.")
+slog.Info("Informational (6) severity > informational message.")
+slog.Info("Debug (7) severity > debug-level message.")
+```
+:::info
+`slog.Info`, `slog.Debug`, `slog.Warn`, and `
+ slog.Error
+` are just aliases to the `slog.Info` method. They don't set
+the appropriate severity number. Use the `<N>` prefix instead.
+:::
+
+----------------------------------------
+
+# Go > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the Go service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Go service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Go service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Go performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Go service. When your Go service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Go service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each Go service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the Go service.
+### Not enough resources to scale up
+If one of the Go containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the Go service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor Go resources
+Zerops provides information about how much hardware resources the Go service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Go > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your Go service directly when creating a new shared storage service. Just select your Go service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the Go service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create Go service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new Go service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/go/how-to/shared-storage#create-a-project-description-file)
+3. [Create a project with a Go service and a shared storage](/go/how-to/shared-storage#create-a-project-with-a-go-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](/go/how-to/create#create-a-project-description-file) how to define the Go service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Go and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in go@{version} format
+ type: go@latest
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the Go service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with a Go service and a shared storage
+Follow the article [How to create a project based on the description.yaml](/go/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Go > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](/go/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](/go/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](/go/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Go > How To > Upgrade
+
+You can upgrade or downgrade your Go service to a different major Go version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/go/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Go version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Go version for your runtime.
+If you want to build your application with a different major Go version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
+
+----------------------------------------
+
+# Go > Overview
+
+[Go ↗](https://go.dev/) is a statically typed, compiled high-level programming language designed at Google.
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-go-hello-world), a **_recipe_**, containing the most simple Go web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of Go running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-go-hello-world/blob/main/import-project/description.yaml)):
+```yaml
+project:
+ name: my-first-project
+services:
+ - hostname: helloworld
+ type: go@latest
+ minContainers: 1
+ maxContainers: 3
+ buildFromGit: https://github.com/zeropsio/recipe-go-hello-world@main
+ enableSubdomainAccess: true
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://helloworld-24-8080.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+Hello, World!
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+## How to start
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Go > Tutorial > Quickstart
+
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-go-hello-world), a **_recipe_**, containing the most simple Go web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of Go running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-go-hello-world/blob/main/import-project/description.yaml)):
+```yaml
+project:
+ name: my-first-project
+services:
+ - hostname: helloworld
+ type: go@latest
+ minContainers: 1
+ maxContainers: 3
+ buildFromGit: https://github.com/zeropsio/recipe-go-hello-world@main
+ enableSubdomainAccess: true
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://helloworld-24-8080.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+Hello, World!
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Go > Tutorial > Runtime Sql
+
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-onboarding-go), a **_recipe_**, containing a PostgreSQL service with a simple Go application. The repo will be used as a source from which the app will be built.
+:::tip
+Follow the steps below and when everything is working as expected, fork the repo, try making various changes or be bold and connect your own.
+:::
+:::note
+In the detail of each step, you can find a link with more information about the topic.
+:::
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+ 2. Create a project.
+
+ Learn more about projects in Zerops. See how to import a whole project into Zerops.
+
+ 3. In the left menu, click on Import services, copy & paste the contents of the `import-services.yaml` config file from the recipe repository of your choice. Then click on Import service.
+
+ Learn more about services in Zerops and how to import a service to an existing project.
+
+ The yaml file includes a `buildFromGit` directive, which ensures a one-time build from Git repository source. See how to connect a Github or Gitlab repository to be able to trigger automatic builds & deploys.
+
+ 4. Several pipelines are created, one for project creation and the rest for the activation of the services. Wait for all to finish.
+
+ Learn more about how the pipelines can be triggered and about build and deploy processes of a Go application in Zerops.
+Learn more about how to access build log of your Go service in Zerops.
+
+ 5. In the service detail, open the Public access & internal ports section, and Enable Zerops Subdomain.
+
+ Learn more about how to access your Go service in Zerops.
+
+ 6. Once the pipeline has finished, click on the activated subdomain URL. You should see a simple page with
+`Entry added successfully with random data: f47ac10b-58cc-0372-8567-0e02b2c3d479. Total count: 1`
+
+ Congratulations! You have created your first application in Zerops, and we hope to see your own projects soon.
+For now, check out other features, such as environment variables, runtime log and scaling.
+
+ 7. One of the services is `adminer`, a database management tool.
+ See how to access it.
+
+ Learn more about how to use `psql` command-line tool instead or how to import and export data from your database.
+
+8. Feel free to make any changes to your project, fork the repo or connect your own. Also see other Go and PostgreSQL recipes on our Github page.
+
+:::tip
+Have you got any additional question? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Go > Tutorial > Step By Step
+
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-go-hello-world), a **_recipe_**, containing the most simple Go web application. The repo will be used as a source from which the app will be built.
+:::tip
+Follow the steps below and when everything is working as expected, fork the repo, try making various changes or be bold and connect your own.
+:::
+:::note
+In the detail of each step, you can find a link with more information about the topic.
+:::
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+ 2. Create a project.
+
+ Learn more about projects in
+ Zerops. See how to import a whole project into Zerops.
+
+ 3. In the left menu, click on Import services, copy & paste the
+ contents of this yaml file and click on Import service.
+
+ Learn more about services in Zerops and how to import a service to an existing project.
+
+ The yaml file includes a `buildFromGit` directive, which ensures
+ a one-time build from Git repository source. See how to connect a Github or Gitlab repository to be able to
+ trigger automatic builds & deploys.
+
+ 4. Two pipelines are created, one for project creation and one for the service activation. Wait for both to finish.
+
+ Learn more about how the pipelines can be triggered and about build and deploy processes of a Go application in Zerops.
+Learn more about how to access build log of your Go service in Zerops.
+
+ 5. In the service detail, open the Public access & internal ports section, and Enable Zerops Subdomain.
+
+ Learn more about how to access your Go
+ service in Zerops.
+
+ 6. Once the pipeline has finished, click on the activated subdomain URL:
+ You should see a simple page with `Hello World!` printed.
+
+ Congratulations! You have created your first application in Zerops, and we hope to see your own projects soon.
+For now, check out other features, such as environment variables, runtime log and scaling.
+
+7. Feel free to make any changes to your project, fork the repo or connect your own. Also see other Go recipes on our Github page.
+
+:::tip
+Have you got any additional question? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Homepage
+
+export const runtimes = [
+ { name: "Node.js", link: "/nodejs/overview", icon: },
+ { name: "PHP", link: "/php/overview", icon: },
+ { name: "Python", link: "/python/overview", icon: },
+ { name: "Go", link: "/go/overview", icon: },
+ { name: ".NET", link: "/dotnet/overview", icon: },
+ { name: "Rust", link: "/rust/overview", icon: },
+ { name: "Java", link: "/java/overview", icon: },
+ { name: "Deno", link: "/deno/overview", icon: },
+ { name: "Bun", link: "/bun/overview", icon: },
+ { name: "Elixir", link: "/elixir/overview", icon: },
+ { name: "Gleam", link: "/gleam/overview", icon: },
+ { name: "Nginx", link: "/nginx/overview", icon: },
+ { name: "Static", link: "/static/overview", icon: },
+]
+export const containers = [
+ { name: "Docker", link: "/docker/overview", icon: },
+ { name: "Alpine", icon: },
+ { name: "Ubuntu", icon: },
+]
+export const databases = [
+ { name: "PostgreSQL", link: "/postgresql/overview", icon: },
+ { name: "MariaDB", link: "/mariadb/overview", icon: },
+ { name: "Valkey", link: "/valkey/overview", icon: },
+ { name: "Elasticsearch", link: "/elasticsearch/overview", icon: },
+ { name: "Typesense", link: "/typesense/overview", icon: },
+ { name: "Meilisearch", link: "/meilisearch/overview", icon: },
+ { name: "Qdrant", link: "/qdrant/overview", icon: },
+ { name: "NATS", link: "/nats/overview", icon: },
+ { name: "KeyDB", link: "/keydb/overview", icon: },
+ { name: "Kafka", icon: },
+]
+export const storages = [
+ { name: "Object storage", link: "/object-storage/overview", icon: },
+ { name: "Shared storage", link: "/shared-storage/overview", icon: },
+]
+Zerops is a **developer-first Platform-as-a-Service**, running on bare metal, with every part built from scratch. Zerops aims to be the perfect mix of **developer experience**, **flexibility**, **scalability** and **affordability**, making it a great fit for applications of any size, complexity and traffic.
+## Natively supported services
+### Runtimes & web servers
+For these services Zerops provides pre-prepared build and runtime images and flexible pipeline that allows you to modify them and build your applications.
+### Linux containers & VMs
+These services can be deployed either as plain Linux containers or using Docker images, giving you flexibility to run any application or service.
+### Databases, search engines & message brokers
+These services are fully managed by Zerops and offered in highly available and single container modes.
+### Storages
+Fully managed S3 compatible storage running on a separate infrastructure and persistent disk that can be mounted to multiple services.
+## Quicklinks
+## Feature highlights
+Four concepts that play together to make Zerops developer-first and live up to the claim "no matter the size or environment".
+### ➡️ Custom dedicated infrastructure deployed with each project
+Zerops is made of three levels: **project** -> **service** -> **container**. For each project Zerops deploys dedicated **core services**, these consist of:
+- **L3 balancer** with a firewall and unique IP addresses assigned to it, this serves as the main entry point from the internet,
+- **Logger** and **Statistics** containers that gather logs and resource metrics from all services inside the project and allow for log forwarding
+- **L7 load balancer** that handles and routes http traffic, SSL termination and SSL certificates
+User services (which consist of one or more containers) inside the project share a private network created with VXLAN, have resources isolated with cgroups and can securely communicate with each other simply by using the hostname and ports and read and reference each other's environment variables.
+:::tip[**What does this mean for you?**]
+You get a fully managed, professional infrastructure setup that will scale no matter how much traffic you get and deals with all the networking, balancing and security stuff, so you can just focus on your actual applications.
+Read more about the project infrastructure
+:::
+### ➡️ Granular resource configuration, autoscaling and high availability of services
+Zerops has fully automatic horizontal and vertical scaling with configuration steps as small as 0.125 GB RAM and 1 CPU core. Your runtime services can go from a single container with 0.25 RAM and 1 CPU core to 10 containers each with 32 GB RAM and 10 CPU cores and then back in a matter of minutes. At the same time, all database and storage services are offered in well-crafted setups that go through performance optimizations while scaling and are available in both non-HA (single container) and high availability (multiple containers and balancers) modes.
+:::tip[**What does this mean for you?**]
+You won't ever overprovision or underprovision your resources and your services will always have the exact resources they need. There won't be any cutting corners like sharing too few CPU cores between too many services. You will be able to rely on professional, reliable and highly available database setups with auto-repairing abilities that will scale along with your applications.
+Read more about autoscaling and high availability
+:::
+### ➡️ Full Linux OS containers with a powerful, flexible build and deploy pipeline
+Zerops uses Incus to create containers, which means that you get a full Linux OS, either Ubuntu or Alpine, depending on your choices. This provides the perfect middle ground between a containerized process (Docker) and a full-fledged VM (Proxmox). Zerops provides build and runtime bases for all the popular runtime technologies and a powerful and flexible pipeline that allows you to modify and cache both the build and runtime images. This circumvents the need for Docker registries. The pipeline can be triggered either automatically, by connecting the service with GitHub or GitLab repositories, or manually using our CLI - either for triggering from your machine, or from any existing CI/CD process.
+:::tip[**What does this mean for you?**]
+You get a built-in powerful and flexible pipeline to modify build and runtime images and deploy your code, without any downtime. It can be used standalone or easily plugged into any existing CI/CD process.
+Read more about the build and deploy pipeline
+:::
+### ➡️ Pricing model that doesn't get in the way of good development practices
+"Simple and predictable pricing"... is what others say and what we actually do. In Zerops, cost per hardware resource (CPU, RAM, Disk) is 3-5x cheaper than with popular alternatives. And there are no plans, no feature tiers, no fees for seats. PaaS is just hardware with a cherry and bow on top, so why would we charge you for anything else but hardware resources?
+:::tip[**What does this mean for you?**]
+You get a powerful managed platform with all the best features unlocked for a price that's nearly on par with VPS. You can create as many environments as you need, even one for each developer working on a project, all with the same infrastructure as production, so they can utilize Zerops for their local development. No more "but it works on my machine".
+Read more about our developer first approach
+:::
+
+----------------------------------------
+
+# Java > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing Java application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](/java/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple Java web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Java > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](/java/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](/java/how-to/build-pipeline#ports) `8080`, simply use `http://app:8080`
+:::info
+Do not use `https://` when communicating with Java from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use Java environment variables
+Zerops creates default environment variables for each Java service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](/java/how-to/env-variables#generated-env-variables) of the Java service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](/java/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your Java application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access Java application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/java/how-to/env-variables) are available when connected through VPN. To connect to your Java application in Zerops set the hostname and [internal port](/java/how-to/build-pipeline#ports) e.g. http://app:8080
+:::info
+Do not use `https://` when communicating with Java over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your Java service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your Java service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/java/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Java > How To > Build Pipeline
+
+Zerops provides a customizable build and runtime environment for your Java application.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: java@latest
+ # OPTIONAL. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # REQUIRED. Build your application
+ buildCommands:
+ - ./mvnw clean install
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles: target/app.jar
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ # cache: some_file
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: java@latest
+ # OPTIONAL. Sets the internal port(s) your app listens on:
+ ports:
+ # port number
+ - port: 8080
+ # OPTIONAL. Customize the runtime Java environment by installing additional
+ # dependencies to the base Java runtime environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Java application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # REQUIRED. Your Java application start command
+ start: java -jar target/app.jar
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your Java application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Build pipeline configuration
+### base
+_REQUIRED._ Sets the base technology for the build environment.
+Following options are available for Java builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: java@latest
+ ...
+```
+ The base build environment contains {data.alpine.default}, the selected version
+ of Java, Zerops command line tool, `git` and
+ `wget`.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base:
+ - java@latest
+ prepareCommands:
+ - zsc add nodejs@latest
+ ...
+```
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
+To customize your build environment use the [prepareCommands](/java/how-to/build-pipeline#preparecommands) attribute.
+:::note
+Modifying the base technology will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### os
+_OPTIONAL._ Sets the operating system for the build environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customized.
+:::
+:::note
+Changing the OS setting will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache behavior.
+:::
+### prepareCommands
+_OPTIONAL._ Customizes the build environment by installing additional dependencies or tools to the base build environment.
+The base build environment contains:
+- {data.alpine.default}
+- selected version of Java defined in the [base](/java/how-to/build-pipeline#base) attribute
+- [Zerops command line tool](/references/cli)
+- `git` and `wget`
+To install additional packages or tools add one or more prepare commands:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: java@latest
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first build is triggered, Zerops will
+1. create a build container
+2. download your application code from your repository
+3. run the prepare commands in the defined order
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::note
+These commands are skipped when using cached environment. Modifying `prepareCommands` will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache invalidation.
+:::
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/java/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all prepare commands are finished, your custom build environment is ready for the build phase.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### buildCommands
+_REQUIRED._ Defines build commands.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: java@latest
+ # REQUIRED. Build your application
+ buildCommands:
+ - ./mvnw clean install
+ ...
+```
+At least one command is required. Zerops triggers each command in the defined order in a dedicated build container.
+Before the build commands are triggered the build container contains:
+1. base environment defined by the [base](/java/how-to/build-pipeline#base) attribute
+2. optional customisation of the base environment defined in the [prepareCommands](/java/how-to/build-pipeline#preparecommands) attribute
+3. your application code
+#### Run build commands as a single shell instance
+Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it. Suppose your `mvnw` executable file is in a `cmd` directory.
+```yaml
+buildCommands:
+ - |
+ cd cmd
+ ./mvnw clean install
+```
+#### Run build commands as a separate shell instances
+When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command. Suppose your `mvnw` executable file is in a `cmd` directory.
+```yaml
+buildCommands:
+ - cd cmd
+ - ./cmd/mvnw clean install
+```
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/java/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `-X` debug option.
+```yaml
+buildCommands:
+ - ./mvnw -X clean install
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the deploy phase.
+### deployFiles
+_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
+```yaml
+# REQUIRED. Select which files / folders to deploy after
+# the build has successfully finished
+deployFiles:
+ - app.jar
+```
+Determines files or folders produced by your build, which should be deployed to your runtime service containers.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Examples
+Deploys a folder, and a file from the project root directory:
+```yaml
+deployFiles:
+ - api
+ - app.jar
+```
+Deploys the whole content of the build container:
+```yaml
+deployFiles: .
+```
+Deploys a folder, and a file in a defined path:
+```yaml
+deployFiles:
+ - ./path/to/file.txt
+ - ./path/to/dir/
+```
+#### How to use a wildcard in the path
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+Deploys all folders that are located in any path that begins with `/path/to/`
+```yaml
+deployFiles: ./path/to/~/
+```
+Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/
+```
+:::note Example
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+:::
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+_OPTIONAL._ Defines which files or folders will be cached for the next build.
+```yaml
+# OPTIONAL. Which files / folders you want to cache for the next build.
+# Next builds will be faster when the cache is used.
+cache: file.txt
+```
+The cache attribute helps optimize build times by preserving specified files between builds.
+The cache attribute supports the [~ wildcard character](#how-to-use-a-wildcard-in-the-path).
+Learn more about the [build cache system](/features/build-cache) in Zerops.
+### envVariables
+_OPTIONAL._ Defines the environment variables for the build environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ base: java@latest
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/java/how-to/env-variables) in Zerops.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current Java version for your runtime.
+Following options are available for Java builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: java@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: java@latest
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the selected major
+ version of Java, Zerops command line tool, git` and `wget`.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: java@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base:
+ - java@latest
+ prepareCommands:
+ - zsc add nodejs@latest
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customize your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customized.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a Java service with hostname = "app" and port = 8080 from another service of the same project, simply use `app:8080`. Read more about [how to access a Java service](/java/how-to/access).
+Each port has following attributes:
+
+ Parameter
+ Description
+
+ port
+ Defines the port number. You can set any port number between 10 and 65435. Ports outside this interval are reserved for internal Zerops systems.
+
+ protocol
+ Optional. Defines the protocol. Allowed values are TCP or UDP. Default value is TCP.
+
+ httpSupport
+ Optional. httpSupport = true is the default setting for TCP protocol. Set httpSupport = false if a web server isn't running on the port. Zerops uses this information for the configuration of public access. httpSupport = true is available only in combination with the TCP protocol.
+
+### prepareCommands
+_OPTIONAL._ Customizes the Java runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base Java environment contains {data.alpine.default}, the selected major
+ version of Java, Zerops command line tool and
+ `git` and `wget`. To install additional packages or tools add one or more
+ prepare commands:
+```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 Java runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/java/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/java/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+When the prepare cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.default}, the selected
+ major version of Java, Zerops command line tool and `git` and `wget`.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare: ./runtime-config.yaml
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base Java runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Java application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your Java application is started via the [start command](/java/how-to/build-pipeline#start).
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](/java/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](/java/how-to/build-pipeline#preparecommands-1) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](/java/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/java/how-to/env-variables) in Zerops.
+### start
+_REQUIRED._ Defines the start command for your Java application.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Java application start command
+ start: java -jar target/app.jar
+```
+We recommend starting your Java application using `java -jar target/app.jar`.
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Java application start command
+ start: java -jar target/app.jar
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Java application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Java application start command
+ start: java -jar target/app.jar
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+### crontab
+_OPTIONAL._ Defines cron jobs.
+Setup cron jobs in the following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ crontab:
+ # REQUIRED. Sets the command to execute:
+ - command: ""
+ # REQUIRED. Sets the interval time to execute:
+ timing: "0 * * * *"
+```
+Read more about setting up [cron](/references/cron) in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](/java/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](/java/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Java application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](/java/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Java > How To > Build Process
+
+
+## Customize Java build environment
+The default Java build environment contains:
+- {data.alpine.default}
+- Selected version of Java when the runtime service was created.
+- [zCLI](/references/cli)
+- Git
+:::note
+To use Ubuntu instead of the default Alpine, set the [build.os](/zerops-yaml/specification#os-) attribute.
+Additional packages and tools can be installed using [build.prepareCommands](/zerops-yaml/specification#preparecommands-).
+:::
+## Description of the build process
+Zerops starts a temporary build container and performs following actions:
+1. Installs the build environment:
+ - Sets up base system and Go runtime
+ - Restores cached files if available (based on `build.cache` configuration)
+ - Validates cache against current `build.os`, `build.base`, and `build.prepareCommands`
+2. Downloads your application source code from [GitHub ↗](https://www.github.com), [GitLab ↗](https://www.gitlab.com) or via [Zerops CLI](/references/cli)
+3. Optionally [customizes the build environment](#customize-java-build-environment)
+4. Runs the build commands
+5. Uploads the application artefact to the internal Zerops storage
+6. Preserves specified files for future builds (based on `build.cache` configuration)
+7. Optionally [customizes the runtime environment](/java/how-to/customize-runtime)
+8. [Deploys your application](/java/how-to/deploy-process)
+The build container is automatically deleted after the build has finished or failed.
+## Cancel running build
+When you know that the running build is not correct and you want to cancel it, you can do it in Zerops GUI. Go to the service detail, select **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Cancel build** button.
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+## Customize Java build environment
+The default Java build environment contains:
+- {data.alpine.default}
+- selected version of Java defined in `zerops.yaml` [build.base](/java/how-to/build-pipeline#base) parameter
+- [zCLI](/references/cli), Zerops command line tool
+- `git` and `wget`
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/java/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](/java/how-to/build-pipeline#preparecommands) commands to your `zerops.yaml`.
+:::info
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::
+## Java build hardware resources
+Build of your Java application is run in a separate build container with following resource configuration:
+| HW resource | Minimum | Maximum |
+| ------------- | ------- | ------- |
+| **CPU cores** | 6 | 20 |
+| **RAM** | 8 GB | 8 GB |
+| **Disk** | 1 GB | 100 GB |
+| **Disk** | 1 GB | 100 GB |
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+## Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops will terminate the build pipeline and delete the build container.
+## Troubleshooting build-related problems
+### Failure of a build prepare command
+If any [prepare command](/java/how-to/build-pipeline#preparecommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/java/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom build environment is ready for the build phase.
+### Invalidate the build cache
+If you encounter unexpected build behavior or dependency issues, the problem might be related to [cached build data](/features/build-cache). While Zerops maintains the build cache to speed up deployments, sometimes you may need to start fresh.
+To invalidate the build cache:
+1. Go to your service detail in Zerops GUI
+2. Choose **Pipelines & CI/CD Settings** from the left menu
+3. Click on the **Invalidate build cache** button
+This will force Zerops to run the next build clean, including all prepare commands, which can help resolve cache-related issues. After invalidation, your next build will also create a fresh cache.
+### Failure of a build command
+If any [build command](/java/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/java/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the verbose `-X` debug option.
+```yaml
+build:
+ - ./mvnw -X clean install
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the [deploy](/java/how-to/deploy-process) phase.
+
+----------------------------------------
+
+# Java > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart Java service in Zerops GUI
+To stop the Java service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped Java service choose the **Start** item from the same menu.
+To restart the Java service choose the **Restart** item from the same menu.
+## Stop and start Java using zCLI
+zCLI is the Zerops command-line tool. To stop and start the Java service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and its services to choose from.
+:::
+
+----------------------------------------
+
+# Java > How To > Create
+
+Zerops provides a Java runtime service with extensive build support. Java runtime is highly scalable and customisable to suit both development and production.
+## Create Java service using Zerops GUI
+First, set up a project in Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new Java service:
+### Choose Java version
+Following Java versions are currently supported:
+:::info
+You can [change](/java/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app","cache", "gui" etc. Duplicate services with the same name in the same project are forbidden.
+#### Limitations:
+- maximum 25 characters
+- must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created. It can't be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as password, tokens, salts, certificates etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting the secret environment variables is optional. You can set them later in Zerops GUI.
+Read more about [different types of env variables](/java/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Set auto scaling configuration
+Zerops scales the Java services automatically both vertically and horizontally. Vertical scaling means increasing or decreasing the hardware resources (CPU, RAM and disk) of a Java container. Horizontal scaling adds or removes whole containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Java service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Java service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Java performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/java/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+:::info
+You can change the vertical auto scaling parameters later.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Java service. When your Java service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Java service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](/java/how-to/scaling) about Java auto scaling.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Create Java service using zCLI
+zCLI is the Zerops command-line tool. To create a new Java service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/java/how-to/create#create-a-project-description-file)
+3. [Create a project with a Java and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### Basic example:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in java@{version} format
+ type: java@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one Java version 1 service with default [auto scaling](/java/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/java/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Java and PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in java@{version} format
+ type: java@latest
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create secret env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+ - # second service hostname
+ hostname: db
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain a Java service and a [PostgreSQL](/postgresql/overview) service.
+Java service with "app" hostname, the internal port(s) the service listens on will be defined later in the zerops.yaml. Java service will run on version 1 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ The hostname of the new database will be set to the `hostname` value.
+
+ Limitations:
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [Java service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+
+ All verticalAutoscaling attributes are optional. Not specified attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add Java service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in java@{version} format
+ type: java@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Java service version 1 with default [auto scaling](/java/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Java > How To > Customize Runtime
+
+
+The default Java runtime environment contains:
+- {data.alpine.default}
+- Selected version of Java when the runtime service was created.
+- [zCLI](/references/cli)
+- Git
+:::note
+To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yaml/specification#os--1) attribute.
+Additional packages and tools can be installed using [run.prepareCommands](/zerops-yaml/specification#preparecommands--1).
+:::
+## Runtime Flow
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. Create a prepare runtime container
+2. Optionally: [copy selected folders or files from your build container](/java/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. Run the run.prepareCommands in the defined order
+### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/java/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+The prepare runtime container is automatically deleted after the prepare runtime phase has finished or failed.
+### Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the build.addToRunPrepare and run.prepareCommands attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+
+----------------------------------------
+
+# Java > How To > Delete
+
+## Delete Java service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete Java using zCLI
+zCLI is the Zerops command-line tool. To delete the Java service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Java > How To > Deploy Process
+
+
+## Application artefact
+When the [build phase](/java/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](/java/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/java/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/java/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/java/how-to/build-pipeline#initcommands)
+4. Starts your application using the [start command](/java/how-to/build-pipeline#start)
+5. Optionally waits until the [readiness check](/java/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/java/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customize the runtime environment](/java/how-to/customize-runtime).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The Java process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready to handle requests right after it is started via the [start command](/java/how-to/build-pipeline#start), configure a [readiness check](/java/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your Java service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/java/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Java > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+
+ Type
+ Environment
+ Defined in
+
+ basic
+ build
+ zerops.yaml
+
+ basic
+ runtime
+ zerops.yaml
+
+ secret
+ runtime
+ Zerops GUI
+
+Use the [secret env variables](/java/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](/java/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/java/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](/java/how-to/create) a new Java service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made to environment variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The Java process running in the container receives the list env variables only when it starts. Update of the env variables while the Java process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+These restrictions apply to all [types of env variables](/java/how-to/env-variables#types-of-env-variables-in-zerops).
+## Referencing other env variables
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your Java runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the Java service. The Java process running in the container receives the list env variables only when it starts. Update of the env variables while the Java process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a Java service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your Java app
+Zerops passes all environment variables from all project services when your Java app is deployed and started.
+To access the local environment variable i.e. the variable set to this Java service in your app, use:
+```sh
+os.Getenv("YOUR_VARIABLE_KEY_HERE")
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+
+----------------------------------------
+
+# Java > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Java > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](/java/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](/java/how-to/build-pipeline#preparecommands-1) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the runtime containers in Zerops CLI use
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## Java logging configuration
+Zerops logs all messages sent
+- to the standard error (`stderr`)
+- to the standard output (`stdout`)
+- via the Apache `log4j` package etc.
+### Severity level
+By default the `log4j` methods create messages with the `Informational (6)` severity.
+Add a severity number in the `` format as a prefix to set a custom severity as shown below:
+```java
+import org.apache.log4j.*;
+public class LogClass {
+ private static org.apache.log4j.Logger log = Logger.getLogger(LogClass.class);
+ public static void main(String[] args) {
+ log.info("A message with the informational severity ...")
+ log.info("Emergency (0) severity > system is unusable.")
+ log.info("Alert (1) severity > action must be taken immediately.")
+ log.info("Critical (2) severity > critical conditions.")
+ log.info("Error (3) severity > error conditions.")
+ log.info("Warning (4) severity > warning conditions.")
+ log.info("Notice (5) severity > normal, but significant, condition.")
+ log.info("Informational (6) severity > informational message.")
+ log.info("Debug (7) severity > debug-level message.")
+ }
+}
+```
+:::info
+`log.trace`, `log.info`, `log.debug`,
+`log.warn`,`log.error`, and `log.fatal` are
+just aliases to the `log.Info` method. They don't set the appropriate
+severity number. Use the `<N>` prefix instead. :::
+
+----------------------------------------
+
+# Java > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the Java service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Java service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Java service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Java performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Java service. When your Java service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Java service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each Java service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the Java service.
+### Not enough resources to scale up
+If one of the Java containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the Java service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor Java resources
+Zerops provides information about how much hardware resources the Java service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Java > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your Java service directly when creating a new shared storage service. Just select your Java service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the Java service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create Java service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new Java service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/java/how-to/shared-storage#create-a-project-description-file)
+3. [Create a project with a Java service and a shared storage](/java/how-to/shared-storage#create-a-project-with-a-java-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](/java/how-to/create#create-a-project-description-file) how to define the Java service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Java and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in java@{version} format
+ type: java@latest
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the Java service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with a Java service and a shared storage
+Follow the article [How to create a project based on the description.yaml](/java/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Java > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](/java/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](/java/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](/java/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Java > How To > Upgrade
+
+You can upgrade or downgrade your Java service to a different major Java version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/java/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Java version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Java version for your runtime.
+If you want to build your application with a different major Java version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
+
+----------------------------------------
+
+# Java > Overview
+
+# Java overview
+[Java ↗](https://www.java.com/en/) is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible.
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-java-hello-world), a **_recipe_**, containing the most simple Java web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of Java running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-java-hello-world/blob/main/import-project/description.yaml)):
+```yaml
+project:
+ name: my-first-project
+services:
+ - hostname: helloworld
+ type: java@latest
+ minContainers: 1
+ maxContainers: 3
+ buildFromGit: https://github.com/zeropsio/recipe-java-hello-world@main
+ enableSubdomainAccess: true
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://helloworld-24-8080.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+Hello, World!
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+## How to start
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Keydb > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops by running a predefined application consisting of a KeyDB service and a runtime service that handles the SQL queries.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own KeyDB service, feel free to head straight to the [How to](/keydb/how-to/create) section.
+## Guides
+We have created repositories, _recipes_, containing a simple web application and a KeyDB service, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Keydb > How To > Connect
+
+## Copy access details from Zerops GUI
+You will find the KeyDB access details under the **Access details** button in the project dashboard page.
+The same information is available in the service detail page in the left menu under the **Peek access details** button.
+### KeyDB access parameters:
+| Parameter | Description |
+| --------------------- | -------------------------------------------------------------------------------- |
+| **Hostname** | The service hostname specified when the KeyDB service was created. |
+| **Hostname** | The service hostname specified when the KeyDB service was created. |
+| **Port** | **6379**
+This port is fixed for all KeyDB services and cannot be customized. |
+| **Connection string** | The connection string for KeyDB service is:
+`redis://{hostname}:6379` |
+## Connect to KeyDB from runtime services of the same project
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+#### Example
+To connect to KeyDB `database1` service, set
+```
+host = database1
+```
+You will find the password under the [**Access details**](#copy-access-details-from-zerops-gui) button in Zerops GUI.
+:::caution
+Do not use SSL/TLS protocols when connecting to KeyDB from other runtime services in the same project. Zerops KeyDB is not configured to support these protocols. The security is assured by the project private network. Due to security reasons Zerops doesn't allow exposing KeyDB service to the internet.
+:::
+## Use KeyDB environment variables
+Zerops creates default environment variables for each KeyDB service to help you with connection from runtime services in the same project. To avoid the need to copy database access parameters manually, use environment variables in your [runtime service].
+### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example
+To access the `connectionString` env variable of the `keydb1` service, use `keudb1_connectionString` as the env variable key.
+### KeyDB environment variables
+List of service environment variables is available in Zerops GUI. Go to a KeyDB service detail and choose **Environment variables** in the left menu.
+Zerops creates following environment variables when the KeyDB service is created:
+| Variable | Description |
+| --------------------- | -------------------------------------------------------------------------------- |
+| **Hostname** | The service hostname specified when the KeyDB service was created. |
+| **Hostname** | The service hostname specified when the KeyDB service was created. |
+| **Port** | **5432**
+This port is fixed for all KeyDB services and cannot be customized. |
+| **projectId** | ID of the project. Generated by Zerops. |
+| **serviceId** | ID of the KeyDB service. Generated by Zerops. |
+| **Connection string** | The connection string for KeyDB service is:
+`redis://{hostname}:6379` |
+You can create own custom [environment variables](/features/env-variables) for the KeyDB service in Zerops GUI and use them in the same way as the default variables.
+## Connect to KeyDB in Zerops remotely
+:::caution
+Due to security reasons Zerops doesn't allow exposing KeyDB service directly to the internet.
+:::
+### Start VPN connection
+You can securely connect to KeyDB from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access KeyDB through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](#use-keydb-environment-variables) are available when connected through VPN. To connect to KeyDB in Zerops you have to copy the [access details](#copy-access-details-from-zerops-gui) manually from Zerops GUI.
+:::caution
+Do not use SSL/TLS protocols when connecting to KeyDB over VPN. Zerops KeyDB is not configured to support these protocols. The security is assured by the VPN.
+:::
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+### Connect to KeyDB from another Zerops project
+All services of the same project share a **dedicated private network**. You can use the service hostname to connect from one service to another within the same project.
+Different Zerops projects have no special connection. They can communicate with each other only via the internet. If you need to connect to a KeyDB service in a Zerops project from a runtime service in another project, you need to use the [Zerops VPN](#access-keydb-through-vpn). Due to security reasons Zerops doesn't allow exposing KeyDB service directly to the internet.
+
+----------------------------------------
+
+# Keydb > How To > Control
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart KeyDB service in Zerops GUI
+To stop the KeyDB service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped KeyDB service choose the **Start** item from the same menu.
+To restart the KeyDB service choose the **Restart** item from the same menu.
+## Stop and start KeyDB using zCLI
+zCLI is the Zerops command-line tool. To stop and start the KeyDB service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and its services to choose from.
+:::
+
+----------------------------------------
+
+# Keydb > How To > Create
+
+[KeyDB ↗](https://docs.keydb.dev/) is a fully open source database, backed by Snap, and a faster drop in alternative to Redis.
+## Create KeyDB using Zerops GUI
+First, set up a project in Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new KeyDB service:
+
+ Parameter
+ Description
+ Limitations
+
+ hostname
+ A unique service identifier like `keydb`, `db` etc.
+
+- duplicate services with the same name in the same project are forbidden
+
+- maximum 25 characters
+
+- must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+:::caution
+The hostname is fixed after the service is created. It can't be changed later.
+:::
+### Choose KeyDB service mode
+Zerops provides KeyDB service in two modes: **Highly available** and **Single container**.
+
+#### Highly available
+Creates a KeyDB cluster with **2 database containers**.
+This mode is suited for production.
+Zerops always keeps the 2 database containers on different physical machines. All your data is stored redundantly in 2 identical copies. In case of a failure of a container or the underlying physical machine, Zerops automatically disconnects the failed container from the cluster, creates a new container and syncs all data from the remaining copy. Finally the broken container is automatically deleted.
+[Learn more] about specific behaviour and technical limitations of the KeyDB cluster.
+#### Single container
+A KeyDB database installed in a single container is created. Useful for non-essential data or dev environments.
+:::caution
+Your data is stored only in a single container. If the container or the underlying physical machine fails, your data since the last backup are lost. Zerops doesn't provide any automatic repairs of single node KeyDB services.
+:::
+:::info
+The KeyDB service mode is fixed after the service is created. It can't be changed later.
+:::
+### Choose KeyDB version
+Following KeyDB versions are currently supported:
+### Set auto scaling configuration
+Zerops scales the KeyDB services automatically by raising or lowering the hardware resources of each database container.
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+For most cases, the default parameters will work without issues. If you need to limit the cost of the KeyDB service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient KeyDB performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/keydb/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+:::info
+You can change the auto scaling parameters later.
+:::
+:::tip
+[Learn more](/keydb/how-to/scale) about KeyDB auto scaling.
+:::
+## Create KeyDB using zCLI
+zCLI is the Zerops command-line tool. To create a new KeyDB service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](#create-a-project-description-file)
+3. Create a project and a KeyDB service
+### Create a project description file
+Zerops uses a yaml format file to describe the project infrastructure.
+#### Basic example
+Create a directory `my-project`. Create a `description.yaml` file inside the directory with the following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: keydb1
+ # service type and version number in keydb@6 format
+ type: keydb@6
+ # mode of operation "HA"/"NON_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain one KeyDB service in the [single container](#single-container) mode with default [auto scaling](/keydb/how-to/scale) configuration. Hostname will be set to `keydb1`.
+#### Full example
+Create a directory `my-project`. Create a `description.yaml` file inside the directory with the following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a KeyDB database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # first service hostname
+ hostname: keydb1
+ # service type and version number in keydb@6 format
+ type: keydb@6
+ # mode of operation "HA"/"NON_HA"
+ mode: HA
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ - # second service hostname
+ hostname: keydb2
+ # service type and version number in keydb@6 format
+ type: keydb@6
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain two KeyDB services.
+The hostname of the first service will be set to `keydb1`. The [high availability](#highly-available) mode will be chosen and the custom [auto scaling configuration](/keydb/how-to/scale) will be set.
+The hostname of the second service will be set to `keydb2`. The [single container](#single-container) mode will be chosen and the default [auto scaling configuration](/keydb/how-to/scale) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+ Limitations
+
+ name
+ The name of the new project. Duplicates are allowed.
+
+ description
+ Optional. Description of the new project.
+ Maximum 255 characters.
+
+ tags
+ Optional. One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects.
+
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains only KeyDB services but you can create a `description.yaml` with [different types] of services.
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ The hostname of the new database will be set to the `hostname` value.
+
+ Limitations:
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [KeyDB service types](/references/import-yaml/type-list#database-services) are currently supported.
+
+ mode
+
+ Defines the operation mode of KeyDB service.
+
+ HA
+
+ Creates a KeyDB cluster with 2 database containers. This mode is suited for production.
+
+ Zerops always keeps the 2 database containers on different physical machines. All your data is stored redundantly in 2 identical copies. In case of a failure of a container or the underlying physical machine, Zerops automatically disconnects the failed container from the cluster, creates a new container and syncs all data from the remaining copy. Finally the broken container is automatically deleted.
+
+ NON_HA
+
+ Zerops will create a KeyDB database installed in a single container. Useful for non-essential data or dev environments.
+
+ Your data is stored only in a single container. If the container or the underlying physical machine fails, your data since the last backup are lost. Zerops doesn't provide any automatic repairs of single node KeyDB services.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+
+ All verticalAutoscaling attributes are optional. Not specified attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+:::caution
+The KeyDB service **hostname** and **mode** are fixed after the service is created. They can't be changed later.
+:::
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add KeyDB service to an existing project
+#### Example
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```bash
+# array of project services
+services:
+ -
+ # service name
+ hostname: keydb1
+ # service type and version number in keydb@6 format
+ type: keydb@6
+ # mode of operation "HA"/"NON_HA"
+ mode: NON_HA
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one KeyDB service in the [single container mode](#single-container) with default [auto scaling](/keydb/how-to/scale) configuration will be added to your project. Hostname of the new service will be set to `keydb1`.
+The content of the `services:` section of `import.yaml` is identical to the [project description file](#create-a-project-description-file). The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the `import.yaml` file is 100 kB.
+
+----------------------------------------
+
+# Keydb > How To > Delete
+
+## Delete KeyDB service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete KeyDB using zCLI
+zCLI is the Zerops command-line tool. To delete the KeyDB service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Keydb > How To > Manage
+
+## How to use a database management tool on your workstation
+Do you already use a database management tool that supports KeyDB on your workstation? Connect it securely to KeyDB from your local workspace via Zerops VPN.
+Zerops VPN client is included into zCLI, the Zerops command-line tool. To start the VPN connection, read [how to connect to KeyDB remotely](/keydb/how-to/connect#connect-to-keydb-in-zerops-remotely).
+:::caution
+Do not use SSL/TLS protocols when connecting to KeyDB over VPN. Zerops KeyDB is not configured to support these protocols. The security is assured by the VPN.
+:::
+## How to use KeyDB Client CLI on your workstation
+If you use the [keydb-cli ↗](https://docs.keydb.dev/docs/keydbcli/) command-line client to manage your KeyDB on your local workspace, you can connect it securely to KeyDB via Zerops VPN.
+Zerops VPN client is included into zCLI, the Zerops command-line tool. To start the VPN connection, read [how to connect to KeyDB remotely](/keydb/how-to/connect#connect-to-keydb-in-zerops-remotely).
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/keydb/how-to/connect#connect-to-keydb-in-zerops-remotely) are available when connected through VPN. To connect to KeyDB in Zerops you have to copy the [access details](/keydb/how-to/connect#connect-to-keydb-in-zerops-remotely) manually from Zerops GUI.
+Use `keydb-cli` command to connect to KeyDB in Zerops:
+```sh
+keydb-cli -h [hostname]
+```
+:::caution
+Do not use SSL/TLS protocols when connecting to KeyDB over VPN. Zerops KeyDB is not configured to support these protocols. The security is assured by the VPN.
+:::
+
+----------------------------------------
+
+# Keydb > How To > Scale
+
+Zerops performs an automated scaling of hardware resources required to run your database based on its usage. If the current use of your database does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your database is under heavy load or needs to store more data, then auto scaling increases the resources for the database to make sure it runs smoothly.
+## Configure auto scaling
+To change the auto scaling settings go to the KeyDB service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU Mode
+**Shared**
+Your database gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your database gets is depended on other applications running on the same CPU core. At best case scenario your database gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your database.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+For most cases, the default parameters will work without issues. If you need to limit the cost of the KeyDB service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient KeyDB performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/keydb/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your database needs.
+:::
+:::tip
+[Learn more](/keydb/how-to/scale) about KeyDB auto scaling.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your database starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your database.
+
+If your database doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+The default minimum free RAM is preset according to the database type and version. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your database need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 62.5 MB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the database is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each KeyDB service. Zerops will never scale above the entered values. If your database is in [highly available mode], maximal resources are identical for all containers of the KeyDB service.
+### Not enough resources to scale up
+Zerops moves a container between physical machines only if there are not enough resources on the current physical machine to scale the container up. When this happens the behaviour is different for [highly available](/keydb/how-to/create#highly-available) and [single container](/keydb/how-to/create#single-container) mode.
+### Automatic scale down
+When the database no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the database from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal scaling
+Zerops provides KeyDB service in two modes: [Highly available](/keydb/how-to/create#highly-available) and [Single container](/keydb/how-to/create#single-container). The KeyDB service mode is chosen when creating a new service and cannot be changed later.
+Zerops doesn't scale KeyDB service horizontally, it means no containers are added or removed from the database cluster. Only in case of a failure of a container or the underlying physical machine, Zerops automatically replaces the broken container with a new one.
+## Monitor database resources
+Zerops provides information about how much hardware resources the KeyDB service is currently using. Go to KeyDB service detail in Zerops GUI and select **Service dashboard & database containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Keydb > Overview
+
+[KeyDB ↗](https://docs.keydb.dev/) is a fully open source database, a faster drop-in alternative to Redis. It offers enhanced performance, multithreading capabilities, and maintains full compatibility with Redis clients and APIs.
+:::important
+While KeyDB is available on Zerops, please note that KeyDB development has not been very active recently. For new Redis-compatible deployments, we recommend considering [Valkey](/valkey/overview) as the preferred alternative due to its active development and ongoing support.
+:::
+## Feature Highlights
+### Connect to KeyDB service
+## Popular Guides
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+
+----------------------------------------
+
+# Mariadb > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops by running a predefined application consisting of a MariaDB service and a runtime service that handles the SQL queries.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own MariaDB service, feel free to head straight to the [How to](/mariadb/how-to/create) section.
+## Guides
+We have created repositories, _recipes_, containing a simple web application and a MariaDB service, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Mariadb > How To > Backup
+
+Zerops provides data backup for certain services, including MariaDB. The data is stored in S3 storage.
+## Frequency and volume
+By default, your data is backed up automatically **every day** at 00:00:00 UTC, unless you update your settings:
+### In GUI
+Following changes are available in Zerops GUI. Go to the service detail and choose **Backups List & Configuration** section in the left menu.
+- do a one-time backup of your data
+- change time of your automatic backup
+- turn off backing up your data completely
+- view all of your backups
+- download a backup
+- delete a backup
+### Via API
+- do a one-time backup of your data
+- change time of your automatic backup
+### Limits
+- Each backup is stored for a maximum period of **1 month**.
+- For each **service** a maximum of **100 backups** is stored.
+- For each **project** a maximum of **25 GiB** of backup volume is stored. Only full backups are stored, the backup that exceeds the limit by its part is not stored.
+#### Examples
+1. If you backup your data every day, and the total volume is less than 25 GiB, the maximum number of backups is ~30 for the last month. A new backup is stored every day (with the oldest one being deleted), unless you exceed the 25 GiB limit.
+2. If you backup your data every hour, and the total volume is less than 25 GiB, the total number of backups is 100 for the last 100 hours. A new backup is stored every hour (with the oldest one being deleted), unless you exceed the 25 GiB limit.
+3. If you backup your data every hour, and your backups exceed 25 GiB after 50 hours, the total number of backups is 50, unless you delete some of your backups or wait the oldest one is older than 1 month.
+## Persistence
+When deleting a service or a project:
+* Project deletion affects backups of **all** services within that project
+* Backups remain accessible for 7 days
+* After 7 days, all backups are permanently removed
+## Security
+All backups are stored in a separate S3 instance, isolated from the instance accessible by users.
+A unique encryption key is created for every project and each backup of the project is encrypted with this key.
+
+----------------------------------------
+
+# Mariadb > How To > Connect
+
+## Default MariaDB database and user
+Zerops creates a default database and a default user automatically when a new MariaDB service is [created](/mariadb/how-to/create).
+#### Database
+The default database name is identical to the service hostname. The default encoding is set to `utf8mb4`.
+#### DB user
+Default user name is identical to the service hostname. Default user password is generated randomly. You will find the password in [Zerops GUI](/mariadb/how-to/connect#copy-access-details-from-zerops-gui) or you can use the [environment variable](#use-mariadb-environment-variables).
+:::info
+Zerops creates a second DB user: `zps` for maintenance reasons with full privileges. Do not delete, change the password or remove privileges from this user, it will disrupt Zerops ability to maintain the database cluster.
+:::
+## Copy access details from Zerops GUI
+You will find the MariaDB access details under the **Access details** button in the project dashboard page.
+The same information is available in the service detail page in the left menu under the **Peek access details** button.
+### MariaDB access parameters:
+| Parameter | Description |
+| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
+| **Hostname** | The service hostname specified when the MariaDB service was created. |
+| **Hostname** | The service hostname specified when the MariaDB service was created. |
+| **Port** | **3306**
+This port is fixed for all MariaDB services and cannot be customized. |
+| **User** | Zerops creates a database user automatically when the service is created. The user name is always identical to the service hostname. |
+| **Password** | Zerops sets a random password when the service is created. |
+| **Connection string** | The connection string for MariaDB service is:
+`mysql://${user}:${password}@{hostname}:3306` |
+## Connect to MariaDB from runtime services of the same project
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+#### Example
+To connect to MariaDB `database1` service, set
+```
+host = database1
+user = database1
+password = **********
+```
+You will find the password under the [**Access details**](/mariadb/how-to/connect#copy-access-details-from-zerops-gui) button in Zerops GUI.
+:::caution
+Do not use SSL/TLS protocols when connecting to MariaDB from other runtime services in the same project. Zerops MariaDB is not configured to support these protocols. The security is assured by the project private network. Due to security reasons Zerops doesn't allow exposing MariaDB service to the internet.
+:::
+## Use MariaDB environment variables
+Zerops creates default environment variables for each MariaDB service to help you with connection from runtime services in the same project. To avoid the need to copy database access parameters manually, use environment variables in your [runtime service].
+### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+### MariaDB environment variables
+List of service environment variables is available in Zerops GUI. Go to a MariaDB service detail and choose **Environment variables** in the left menu.
+Zerops creates following environment variables when the MariaDB service is created:
+| Variable | Description |
+| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **Hostname** | The service hostname specified when the MariaDB service was created. |
+| **Hostname** | The service hostname specified when the MariaDB service was created. |
+| **Port** | **3306**
+This port is fixed for all MariaDB services and cannot be customized. |
+| **projectId** | ID of the project. Generated by Zerops. |
+| **serviceId** | ID of the MariaDB service. Generated by Zerops. |
+| **Connection string** | The connection string for MariaDB service is:
+`mysql://${user}:${password}@{hostname}:3306`
+Connection string contains [references](/mariadb/how-to/connect#mariadb-access-parameters) to `user` and `password` variables. Each time the `user` or `password` variable is updated, the `connectionString` variable is automatically updated as well. |
+| **User** | Zerops creates a database user automatically when the service is created. The user name is always identical to the service hostname. |
+| **Password** | Zerops sets a random password when the service is created. |
+:::caution
+When you change the value of the password env variable, only the env variable is updated, not the actual password of the MariaDB user. You have to update the password of the database user manually.
+:::
+:::caution
+When you change the password of the default MariaDB user in the database, the new password is not synchronised to the password env variable. You have to update the `password` env variable manually.
+:::
+You can create own custom [environment variables](/features/env-variables) for the MariaDB service in Zerops GUI and use them in the same way as the default variables.
+## Connect to MariaDB in Zerops remotely
+:::caution
+Due to security reasons Zerops doesn't allow exposing MariaDB service directly to the internet.
+:::
+### Start VPN connection
+You can securely connect to MariaDB from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access MariaDB through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](#use-mariadb-environment-variables) are available when connected through VPN. To connect to MariaDB in Zerops you have to copy the [access details](#copy-access-details-from-zerops-gui) manually from Zerops GUI.
+:::caution
+Do not use SSL/TLS protocols when connecting to MariaDB over VPN. Zerops MariaDB is not configured to support these protocols. The security is assured by the VPN.
+:::
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+### Connect to MariaDB from another Zerops project
+All services of the same project share a **dedicated private network**. You can use the service hostname to connect from one service to another within the same project.
+Different Zerops projects have no special connection. They can communicate with each other only via the internet. If you need to connect to a MariaDB service in a Zerops project from a runtime service in another project, you need to use the [Zerops VPN](#access-mariadb-through-vpn). Due to security reasons Zerops doesn't allow exposing MariaDB service directly to the internet.
+
+----------------------------------------
+
+# Mariadb > How To > Control
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart MariaDB service in Zerops GUI
+To stop the MariaDB service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped MariaDB service choose the **Start** item from the same menu.
+To restart the MariaDB service choose the **Restart** item from the same menu.
+## Stop and start MariaDB using zCLI
+zCLI is the Zerops command-line tool. To stop and start the MariaDB service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Mariadb > How To > Create
+
+MariaDB is the open source relational database loved by developers all over the world. Created by MySQL’s original developers, MariaDB is compatible with MySQL and guaranteed to stay open source forever.
+Zerops provides the MariaDB Community Server edition as a managed database service.
+## Create MariaDB using Zerops GUI
+First, set up a project in Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new MariaDB service:
+
+ Parameter
+ Description
+ Limitations
+
+ hostname
+ A unique service identifier like `mariadb`,`sql`, `db` etc.
+
+- duplicate services with the same name in the same project are forbidden
+
+- maximum 25 characters
+
+- must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+:::caution
+The hostname is fixed after the service is created. It can't be changed later.
+:::
+### Choose MariaDB service mode
+Zerops provides MariaDB service in two modes: **Highly available** and **Single container**.
+
+#### Highly available
+Creates a MariaDB cluster with **3 database containers** and **2 free database proxies**.
+This mode is suited for production.
+Zerops always keeps the 3 database containers on different physical machines. All your data is stored redundantly in 3 identical copies. In case of a failure of a container or the underlying physical machine, Zerops automatically disconnects the failed container from the cluster, creates a new container and syncs all data from the remaining 2 copies. Finally the broken container is automatically deleted.
+[Learn more](/mariadb/tech-details/cluster) about specific behaviour and technical limitations of the MariaDB cluster.
+#### Single container
+A MariaDB database installed in a single container is created. Useful for non-essential data or dev environments.
+:::caution
+Your data is stored only in a single container. If the container or the underlying physical machine fails, your data since the last backup are lost. Zerops doesn't provide any automatic repairs of single node MariaDB services.
+:::
+:::info
+The MariaDB service mode is fixed after the service is created. It can't be changed later.
+:::
+### Choose MariaDB version
+Following MariaDB versions are currently supported:
+### Set auto scaling configuration
+Zerops scales the MariaDB services automatically by raising or lowering the hardware resources of each database container.
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+
+ Resources Type
+ Minimum resource
+ Maximum resource
+
+ CPU cores
+ 1
+ 5
+
+ RAM
+ 0.5 GB
+ 32 GB
+
+ Disk
+ 1 GB
+ 100 GB
+
+For most cases, the default parameters will work without issues. If you need to limit the cost of the MariaDB service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient MariaDB performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/mariadb/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+:::info
+You can change the auto scaling parameters later.
+:::
+:::tip
+[Learn more](/mariadb/how-to/scale) about MariaDB auto scaling.
+:::
+## Create MariaDB using zCLI
+zCLI is the Zerops command-line tool. To create a new MariaDB service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](#create-a-project-description-file)
+3. Create a project and a MariaDB service
+### Create a project description file
+Zerops uses a yaml format file to describe the project infrastructure.
+#### Basic example
+Create a directory `my-project`. Create a `description.yaml` file inside the directory with the following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: mariadb1
+ # service type and version number in mariadb@{version} format
+ type: mariadb@10.4
+ # mode of operation "HA"/"NON_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain one MariaDB 10.4 service in the [single container](#single-container) mode with default [auto scaling](/mariadb/how-to/scale) configuration. Hostname will be set to `mariadb1`.
+#### Full example
+Create a directory `my-project`. Create a `description.yaml` file inside the directory with the following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a MariaDB database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # first service hostname
+ hostname: mariadb1
+ # service type and version number in mariadb@{version} format
+ type: mariadb@10.4
+ # mode of operation "HA"/"NON_HA"
+ mode: HA
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ - # second service hostname
+ hostname: mariadb2
+ # service type and version number in mariadb@{version} format
+ type: mariadb@10.4
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain two MariaDB 10.4 services.
+The hostname of the first service will be set to `mariadb1`. The [high availability](#highly-available) mode will be chosen and the custom [auto scaling configuration](/mariadb/how-to/scale) will be set.
+The hostname of the second service will be set to `mariadb2`. The [single container](#single-container) mode will be chosen and the default [auto scaling configuration](/mariadb/how-to/scale) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+ Limitations
+
+ name
+ The name of the new project. Duplicates are allowed.
+
+ description
+ Optional. Description of the new project.
+ Maximum 255 characters.
+
+ tags
+ Optional. One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects.
+
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains only MariaDB services but you can create a `description.yaml` with [different types] of services.
+
+ Parameter
+ Description
+ Limitations
+
+ hostname
+ A unique service identifier like `mariadb`,`sql`, `db` etc.
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+ Specifies the service type and version.
+
+ See what [MariaDB service types](/references/import-yaml/type-list#database-services) are currently supported.
+
+ mode
+ Defines the operation mode of MariaDB service.
+
+ HA
+
+ Zerops will create a MariaDB cluster with 3 database containers and 2
+ free database proxies. This mode is suited for production.
+
+ Zerops always keep the 3 database containers on different physical
+ machines. All your data is stored redundantly in 3 copies. In case of a
+ failure of a container or the underlying physical machine, Zerops
+ automatically disconnects the failed container from the cluster, creates
+ a new container and syncs all data from the remaining 2 copies. Finally
+ the broken container is automatically deleted.
+
+ NON_HA
+
+ Zerops will create a MariaDB database installed in a single container.
+ Useful for non-essential data or dev environments.
+
+ Your data is stored only in a single container. If the container or the
+ underlying physical machine fails, your data since the last backup are
+ lost. Zerops doesn't provide any automatic repairs of single node
+ MariaDB services.
+
+ verticalAutoscaling
+ Defines custom vertical auto scaling parameters
+
+ All verticalAutoscaling attributes are optional. Not specified
+ attributes will be set to their default values.
+
+ - cpuMode
+ Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+ Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+ Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+ Set the minDisk or maxDisk in GB (float).
+
+:::caution
+The MariaDB service **hostname** and **mode** are fixed after the service is created. They can't be changed later.
+:::
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add MariaDB service to an existing project
+#### Example
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```bash
+# array of project services
+services:
+ -
+ # service name
+ hostname: mariadb1
+ # service type and version number in mariadb@{version} format
+ type: mariadb@10.4
+ # mode of operation "HA"/"NON_HA"
+ mode: NON_HA
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one MariaDB 10.4 service in the [single container mode](#single-container) with default [auto scaling](/mariadb/how-to/scale) configuration will be added to your project. Hostname of the new service will be set to `mariadb1`.
+The content of the `services:` section of `import.yaml` is identical to the [project description file](#create-a-project-description-file). The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the `import.yaml` file is 100 kB.
+
+----------------------------------------
+
+# Mariadb > How To > Delete
+
+## Delete MariaDB service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete MariaDB using zCLI
+zCLI is the Zerops command-line tool. To delete the MariaDB service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Mariadb > How To > Export Import Data
+
+## Use Adminer to export or import data
+[Adminer ↗](https://www.adminer.org) is an open source full-featured database management tool written in PHP.
+1. [Install Adminer to Zerops](/mariadb/how-to/manage#how-to-install-adminer-to-zerops)
+2. Use Adminer standard export or import functions
+## Use phpMyAdmin to export or import data
+[phpMyAdmin ↗](https://www.phpmyadmin.net) is a free software tool written in PHP, intended to handle the administration of MariaDB over the Web.
+1. [Install phpMyAdmin to Zerops](/mariadb/how-to/manage#how-to-install-phpmyadmin-to-zerops)
+2. Use phpMyAdmin standard export or import functions
+## Use a database management tool on your workstation to export or import data
+Do you already use a database management tool that supports MariaDB on your workstation? Connect it securely to MariaDB from your local workspace via Zerops VPN.
+Zerops VPN client is included into zCLI, the Zerops command-line tool. To start the VPN connection, read [how to connect to MariaDB remotely](/mariadb/how-to/connect#connect-to-mariadb-in-zerops-remotely).
+:::caution
+Do not use SSL/TLS protocols when connecting to MariaDB over VPN. Zerops MariaDB is not configured to support these protocols. The security is assured by the VPN.
+:::
+Once the connection to MariaDB is established, use the standard export or import functions of your favourite management tool.
+## Use mysql CLI to export or import data
+If you are using the [mysql ↗](https://dev.mysql.com/doc/refman/8.1/en/mysql.html) command-line client to manage your MariaDB on your local workspace, you can connect it securely to MariaDB via Zerops VPN.
+Zerops VPN client is included into zCLI, the Zerops command-line tool. To start the VPN connection, read [how to connect to MariaDB remotely](/mariadb/how-to/connect#connect-to-mariadb-in-zerops-remotely).
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/mariadb/how-to/connect#use-mariadb-environment-variables) are available when connected through VPN. To connect to MariaDB in Zerops you have to copy the [access details](/mariadb/how-to/connect#connect-to-mariadb-in-zerops-remotely) manually from Zerops GUI.
+Use [mysql ↗](https://dev.mysql.com/doc/refman/8.1/en/mysql.html) command to connect to MariaDB in Zerops:
+```sh
+mysql -h [hostname] -u [user] -p [password] [database_name]
+```
+:::caution
+Do not use SSL/TLS protocols when connecting to MariaDB over VPN. Zerops MariaDB is not configured to support these protocols. The security is assured by the VPN.
+:::
+To export your database data and structure, use the [mysqldump ↗](https://dev.mysql.com/doc/refman/8.1/en/mysqldump.html) command.
+```sh
+mysqldump -h [hostname] -u [user] –p [password] [database_name] > dumpfilename.sql
+```
+To import your database data and structure, use the `mysql` command.
+```sh
+mysql -h [hostname] -u [user] –p [password] [database_name] < dumpfilename.sql
+```
+
+----------------------------------------
+
+# Mariadb > How To > Manage
+
+## Default database and user
+Zerops creates a default database and a default user automatically when a new MariaDB service is [created](/mariadb/how-to/create).
+#### Database
+The default database name is identical to the service hostname. The default encoding is set to `utf8mb4`.
+#### DB user
+Default user name is identical to the service hostname. Default user password is generated randomly. You will find the password in [Zerops GUI](/mariadb/how-to/connect#copy-access-details-from-zerops-gui) or you can use the [environment variable](/mariadb/how-to/connect#use-mariadb-environment-variables).
+:::info
+Zerops creates a second DB user: `zps` for maintenance reasons with full privileges. Do not delete, change the password or remove privileges from this user, it will disrupt Zerops ability to maintain the database cluster.
+:::
+## How to install Adminer to Zerops
+[Adminer ↗](https://www.adminer.org) is a open source full-featured database management tool written in PHP.
+### Single-click installation
+To install Adminer into your project, open your project in Zerops GUI and select **import services** in the left menu.
+Copy the following yaml file into the text area and start the import:
+```yaml
+services:
+ - # Service will be accessible through zCLI VPN under: http://adminer
+ hostname: adminer
+ # Type and version of service used.
+ type: php-apache@8.0+2.4
+ # Whether the service will be run on one or multiple containers.
+ # Since this is a utility service, using a single container is fine.
+ minContainers: 1
+ maxContainers: 1
+ # Folder name used as the root of the publicly accessible web server content.
+ documentRoot: public
+ # Link to Zerops repository that contains Adminer code with Zerops build and deploy instructions.
+ buildFromGit: https://github.com/zeropsio/recipe-adminer@main
+```
+When the import is finished, Adminer will be running as a PHP service in your project.
+## How to access Adminer
+### Use Zerops VPN
+By default Adminer service is private and is accessible from your local workstation over VPN.
+You can securely connect to MariaDB from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn)
+3. Type `http://adminer` into your browser
+:::caution
+Do not use https when connecting to Adminer via VPN.
+:::
+### Enable public access
+You can enable the public access to the Adminer service via the [Zerops subdomain].
+Or you can configure the [Public routing] on the Adminer service to make it accessible on your own domain.
+## How to install phpMyAdmin to Zerops
+[phpMyAdmin ↗](https://www.phpmyadmin.net) is a free software tool written in PHP, intended to handle the administration of MariaDB over the Web.
+### Single-click installation
+To install phpMyAdmin into your project, open your project in Zerops GUI and select **import services** in the left menu.
+Copy the following yaml file into the text area and start the import:
+```yaml
+services:
+ - # Service will be accessible through zCLI VPN under: http://phpmyadmin
+ hostname: phpmyadmin
+ # Type and version of service used.
+ type: php-apache@8.1+2.4
+ # Whether the service will be run on one or multiple containers.
+ # Since this is a utility service, using a single container is fine.
+ minContainers: 1
+ maxContainers: 1
+ # Folder name used as the root of the publicly accessible web server content.
+ documentRoot: public
+ # Link to Zerops repository that contains Adminer code with Zerops build and deploy instructions.
+ buildFromGit: https://github.com/zeropsio/recipe-phpmyadmin@main
+```
+When the import is finished, phpMyAdmin will be running as a PHP service in your project.
+## How to access phpMyAdmin
+### Use Zerops VPN
+By default phpMyAdmin service is private and is accessible from your local workstation over VPN.
+You can securely connect to MariaDB from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn)
+3. Type `http://phpmyadmin` into your browser
+:::caution
+Do not use https when connecting to phpMyAdmin via VPN.
+:::
+### Enable public access
+You can enable the public access to the phpMyAdmin service via the [Zerops subdomain].
+Or you can configure the [Public routing] on the phpMyAdmin service to make it accessible on your own domain.
+## How to use a database management tool on your workstation
+Do you already use a database management tool that supports MariaDB on your workstation? Connect it securely to MariaDB from your local workspace via Zerops VPN.
+Zerops VPN client is included into zCLI, the Zerops command-line tool. To start the VPN connection, read [how to connect to MariaDB remotely](/mariadb/how-to/connect#connect-to-mariadb-in-zerops-remotely).
+:::caution
+Do not use SSL/TLS protocols when connecting to MariaDB over VPN. Zerops MariaDB is not configured to support these protocols. The security is assured by the VPN.
+:::
+## How to use mysql CLI on your workstation
+If you use the [mysql ↗](https://dev.mysql.com/doc/refman/8.1/en/mysql.html) command-line client to manage your MariaDB on your local workspace, you can connect it securely to MariaDB via Zerops VPN.
+Zerops VPN client is included into zCLI, the Zerops command-line tool. To start the VPN connection, read [how to connect to MariaDB remotely](/mariadb/how-to/connect#connect-to-mariadb-in-zerops-remotely).
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/mariadb/how-to/connect#connect-to-mariadb-in-zerops-remotely) are available when connected through VPN. To connect to MariaDB in Zerops you have to copy the [access details](/mariadb/how-to/connect#connect-to-mariadb-in-zerops-remotely) manually from Zerops GUI.
+Use `mysql` command to connect to MariaDB in Zerops:
+```sh
+mysql -h [hostname] -u [user] -p [password] [database_name]
+```
+:::caution
+Do not use SSL/TLS protocols when connecting to MariaDB over VPN. Zerops MariaDB is not configured to support these protocols. The security is assured by the VPN.
+:::
+
+----------------------------------------
+
+# Mariadb > How To > Scale
+
+Zerops performs an automated scaling of hardware resources required to run your database based on its usage. If the current use of your database does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your database is under heavy load or needs to store more data, then auto scaling increases the resources for the database to make sure it runs smoothly.
+## Configure auto scaling
+To change the auto scaling settings go to the MariaDB service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU Mode
+**Shared**
+Your database gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your database gets is depended on other applications running on the same CPU core. At best case scenario your database gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your database.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+For most cases, the default parameters will work without issues. If you need to limit the cost of the MariaDB service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient MariaDB performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/mariadb/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your database needs.
+:::
+:::tip
+[Learn more](/mariadb/how-to/scale) about MariaDB auto scaling.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your database starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your database.
+
+If your database doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+The default minimum free RAM is preset according to the database type and version. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your database need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the database is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each MariaDB service. Zerops will never scale above the entered values. If your database is in [highly available mode], maximal resources are identical for all containers of the MariaDB service.
+### Not enough resources to scale up
+Zerops moves a container between physical machines only if there are not enough resources on the current physical machine to scale the container up. When this happens the behaviour is different for [highly available](/mariadb/how-to/create#highly-available) and [single container](/mariadb/how-to/create#single-container) mode.
+### Automatic scale down
+When the database no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the database from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal scaling
+Zerops provides MariaDB service in two modes: [Highly available](/mariadb/how-to/create#highly-available) and [Single container](/mariadb/how-to/create#single-container). The MariaDB service mode is chosen when creating a new service and cannot be changed later.
+Zerops doesn't scale MariaDB service horizontally, it means no containers are added or removed from the database cluster. Only in case of a failure of a container or the underlying physical machine, Zerops automatically replaces the broken container with a new one.
+## Monitor database resources
+Zerops provides information about how much hardware resources the MariaDB service is currently using. Go to MariaDB service detail in Zerops GUI and select **Service dashboard & database containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Mariadb > Overview
+
+[MariaDB ↗](https://mariadb.org/) is one of the most popular open source relational databases. It’s made by the original developers of MySQL and guaranteed to stay open source.
+## Feature Highlights
+### Connect to MariaDB service
+### Others
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Mariadb > Tech Details > Cluster
+
+The following description applies only to the [highly available mode](/mariadb/how-to/create#highly-available) of the MariaDB service.
+## Description of MariaDB cluster
+MariaDB cluster in highly available mode contains 3 database containers and 2 free database proxies.
+#### 1 write node + 2 read nodes
+Zerops always keeps the 3 database containers on different physical machines. A MariaDB cluster node is installed in each database container. First a writer node is started followed by 2 read nodes. All your data is stored redundantly in 3 identical copies.
+If the container with one of the reader nodes fails, Zerops disconnects it from the MariaDB cluster. Zerops then creates a new container with a MariaDB read node inside, connects it to the cluster and starts the synchronisation of the data to the new node. Finally the broken container is deleted.
+If the container with the writer node fails, Zerops disconnects it from the MariaDB cluster and one of the read nodes is automatically promoted to the writer node. Zerops creates a new container with a MariaDB read node inside, connects it to the cluster and starts the synchronisation of the data to the new node. Finally the broken container is deleted.
+#### 2 database proxies
+Zerops uses [MaxScale 2.5 ↗](https://mariadb.com/kb/en/maxscale/), this database proxy is optimised specifically for MariaDB. MaxScale database proxy understands the mysql protocol. It forwards all **write requests** to the writer node and all **read requests** to read nodes.
+Zerops creates 2 containers with MaxScale database proxy and connects them to the database cluster in the highly available infrastructure. Zerops always keep the 2 database proxies on different physical machines.
+If a container with the database proxy fails, Zerops starts a new container automatically. Database proxy doesn't contain any data therefore the start of the new database proxy is fast.
+## Synchronous vs. Asynchronous replication
+#### Synchronous replication
+Synchronous replication guarantees that when a change happens on the write node, it is replicated on the read nodes synchronously. Synchronous replication uses a distributed locking which proved to be very slow. The data replication from the write node to the read nodes takes some time and the write transactions must wait until the changed data is successfully replicated to all database nodes. In case one of the database nodes is overloaded, the whole cluster becomes very slow.
+#### Asynchronous replication
+Asynchronous replication gives no guarantees about the delay between applying changes on the write node and the propagation of changes to all read nodes. The delay is usually very short but when one of the read containers is overloaded the delay can be longer. The main benefit of the asynchronous replication is the performance. Write transaction is completed when the write node successfully commits the transaction locally and writes it to the write-ahead log that prevents the loss of data.
+The downside of the asynchronous replication is no guarantee that the read nodes will always return the current data. In some cases a `SELECT` query that quickly follows the previous `COMMIT` may return old data. As mentioned above, the database proxy forwards all read requests to read nodes. When the read node processes the `SELECT` query before the replication of the previous transaction is finished, old data is returned.
+Zerops uses the asynchronous replication in MariaDB cluster.
+## How to deal with situations when old data is returned
+#### Use explicit transactions
+MariaDB cluster returns old data most often when you use the `SELECT` query right after the `COMMIT` in the same algorithm. This problem can be solved by moving the `SELECT` query into the transaction. All queries inside a `BEGIN..COMMIT` transaction are always executed against the write node.
+#### Enable synchronous checks for SELECT queries
+For a critical read that must have the most up-to-date data use the `wsrep_sync_wait` option:
+```sh
+SET SESSION wsrep_sync_wait=1;
+SELECT ...;
+SET SESSION wsrep_sync_wait=0;
+```
+When the `wsrep_sync_wait=1` option is used, the read node will synchronise data from the write node before executing the query. The read node will wait until all updates from the write node that were committed before the `SELECT` query was received and only then executes the query.
+
+----------------------------------------
+
+# Mariadb > Tech Details > Limitations
+
+The following description applies only to the [highly available mode](/mariadb/how-to/create#highly-available) of the MariaDB service.
+#### InnoDB only
+Only the InnoDB storage engine is supported.
+#### Mandatory table primary key
+All database tables should have a primary key. A multi-column primary key can also be used. `DELETE` operations are unsupported on tables without a primary key. Also, rows in tables without a primary key may appear in a different order on different nodes.
+#### Limited locks support
+No support for explicit locks, including `LOCK TABLES`, `FLUSH TABLES {explicit table list} WITH READ LOCK`, `GET_LOCK`, `RELEASE_LOCK`. These limitations can be overcome using transactions. Global locking operators like `FLUSH TABLES WITH READ LOCK` are supported.
+#### Do not use local exports
+Do not use `SELECT INTO OUTFILE` or `SELECT INTO DUMPFILE` commands. It will create a file on one of the database containers that will receive the request. Zerops doesn't support direct access into the MariaDB database containers so you won't be able to access the file. Learn more about [how to export and import MariaDB data](/mariadb/how-to/export-import-data).
+[Full list of MariaDB cluster limitations ↗](https://mariadb.com/kb/en/mariadb-galera-cluster-known-limitations/)
+
+----------------------------------------
+
+# Mariadb > Tutorial > Quickstart
+
+As said, there is no need for coding yet, we have created multiple repositories, **_recipes_**, containing a PostgreSQL service with a simple web application. The repo will be used as a source from which the app will be built.
+ Ghost is an open source blogging platform that can be used as a headless CMS.
+ This recipe showcases how to properly setup and run Ghost on Zerops.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. Choose a recipe based on your desired technology and copy the content of the yaml config in a `README` file
+3. In Zerops GUI, in the **Projects** box click on **Import a project** and paste the config.
+4. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://golang1-24-8080.prg1.zerops.app`.
+2. Click on the `subdomain` URL to open it in a browser and you should see:
+```
+Entry added successfully with random data: f47ac10b-58cc-0372-8567-0e02b2c3d479. Total count: 1
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation, and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Mariadb > Tutorial > Step By Step
+
+Choose from the technologies below and follow the guide:
+:::tip
+Have you got any additional question? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Meilisearch > Overview
+
+Deploy and manage Meilisearch on a fully managed infrastructure. Get instant access to fast, typo-tolerant search with zero operational overhead.
+## Supported Versions
+Currently supported Meilisearch versions:
+Import configuration version:
+## Service Configuration
+Our Meilisearch implementation runs as a **single-node** setup, as Meilisearch does not currently support cluster configurations.
+### Environment Modes
+:::note
+Environment mode affects the availability of certain features and can impact your application's security. Choose carefully based on your use case.
+:::
+#### Production Mode (Default)
+- Optimized for performance and security
+- Search Preview (Mini-dashboard) disabled
+- Recommended for production deployments
+#### Development Mode
+- Includes Search Preview (Mini-dashboard)
+- Enhanced debugging capabilities
+- Suitable for development and testing
+To switch between modes:
+1. Navigate to the **Environment variables** section in the Meilisearch service detail and scroll to the **Generated Variables**
+2. Set the `environment` variable to either:
+ - `production` - for production mode (default)
+ - `development` - for development mode with Mini-dashboard
+3. Restart the service to apply changes
+### API Key Management
+The service provides three pre-configured API keys, each with specific access levels:
+#### `masterKey`
+- Root access to your Meilisearch instance
+- Use only for initial setup and key management
+- **Never expose in application code or frontend**
+#### `defaultSearchKey`
+- Read-only search operations across all indices
+- Safe for frontend implementations
+- **Can be exposed in client-side code**
+#### `defaultAdminKey`
+- Full administrative access to all indices
+- For backend operations and index management
+- **Keep secure in backend services only**
+[Custom API keys](https://www.meilisearch.com/docs/reference/api/keys) provide fine-grained access control for specific use cases. For example, you might create:
+- Search-only keys for specific indices
+- Temporary keys with expiration dates
+- Keys with restricted actions for third-party integrations
+## Network Architecture & Access
+### Access Methods
+#### Public HTTPS Access
+When enabled, access via [Zerops subdomain](/features/access#public-access-through-zerops-subdomain).
+#### Internal Project Access
+Services within the same project can reach Meilisearch directly:
+```
+http://{hostname}:7700
+```
+## Quick Start Example
+Here's a minimal example of implementing search in a React application:
+```javascript
+const MEILISEARCH_URL = process.env.zeropsSubdomain;
+const SEARCH_KEY = process.env.defaultSearchKey;
+function SearchComponent() {
+ const [results, setResults] = useState([]);
+ const handleSearch = async (query) => {
+ const response = await fetch(`${MEILISEARCH_URL}/indexes/products/search`, {
+ method: 'POST',
+ headers: {
+ 'Authorization': `Bearer ${SEARCH_KEY}`,
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify({
+ q: query,
+ limit: 10
+ })
+ });
+ const data = await response.json();
+ setResults(data.hits);
+ };
+ return (
+
+ handleSearch(e.target.value)}
+ placeholder="Search products..."
+ />
+
+ {results.map(hit => (
+ {hit.name}
+ ))}
+
+ );
+}
+```
+## Best Practices
+#### Security
+- Store sensitive keys (`masterKey`, `defaultAdminKey`) securely in backend services
+- Use `defaultSearchKey` or custom keys with minimal permissions for frontend
+- Rotate custom keys periodically
+#### Performance
+- Implement debouncing for search inputs
+- Cache frequently accessed search results
+- Monitor response times and adjust index settings
+- Use appropriate batch sizes for bulk operations
+#### Error Handling
+- Implement retry logic for temporary failures
+- Set appropriate timeout values for your use case
+- Handle rate limiting gracefully
+## Troubleshooting
+### Common Issues
+#### Connection Problems
+- Check if your instance is in the correct environment mode
+- Ensure your API keys have the necessary permissions
+- Confirm your service is running and healthy in the Zerops dashboard
+#### Search Performance
+- Review your index settings for optimal search performance
+- Monitor your instance's resource usage
+- Consider implementing client-side caching for frequent searches
+#### API Key Issues
+- Verify you're using the correct key type for your operation (search vs. admin)
+- Check key permissions match your intended operations
+- Ensure keys are properly formatted in your Authorization header
+- Remember that master and admin keys should never be used in frontend code
+## Learn More
+- [Official Meilisearch Documentation](https://www.meilisearch.com/docs) - Comprehensive guide to all Meilisearch features and capabilities
+- [API Reference](https://www.meilisearch.com/docs/reference/api/overview) - Detailed API specifications and usage examples
+## Support
+For advanced configurations or custom requirements:
+- Join our [Discord community](https://discord.gg/zeropsio)
+- Contact support via [email](mailto:support@zerops.io)
+
+----------------------------------------
+
+# Nats > Overview
+
+Zerops provides a fully managed [NATS](https://nats.io/) messaging system with automated scaling and zero infrastructure overhead, letting developers focus entirely on development.
+## Supported Versions
+Currently supported NATS version:
+Import configuration version:
+## Service Configuration
+Our NATS implementation features optimized default settings designed for common use cases.
+**Key configuration aspects** include:
+- Standard protocol port `4222` for client connections
+- HTTP monitoring interface `8222` for management
+- Secure authentication with automatically generated credentials
+- Optimized settings for performance and reliability
+You can fine-tune your NATS service by adjusting **environment variables**:
+### Available Configuration Options
+:::note
+If certain variables are not visible in your configuration, they may have been introduced after your service was created. Simply add them as [secret variables](/features/env-variables#2-secret-variables) to access the functionality.
+:::
+
+ Variable
+ Description
+
+ MAX_PAYLOAD
+ Defines the maximum allowed message size for all NATS traffic. Default: 8MB, Maximum: 64MB. See NATS limits documentation for details.
+
+ JET_STREAM_ENABLED
+ Controls whether JetStream functionality is enabled. Default: 1 (enabled), Set to 0 to disable. See JetStream Configuration section below for more details.
+
+:::important
+Configuration changes require a service **restart** to take effect. While NATS itself supports configuration hot-reload, this feature will be implemented in a future Zerops update.
+:::
+After restarting, check your service logs to confirm the changes were applied successfully.
+### JetStream Configuration
+The service includes [JetStream](https://docs.nats.io/nats-concepts/jetstream) functionality **enabled by default**, providing persistent storage capabilities for your messaging workloads:
+- **Memory store**: Up to 40GB for high-performance message caching
+- **File store**: Up to 250GB for persistent storage
+- **Regular sync intervals**: Ensures data durability and consistency
+:::note
+In HA deployments, data persistence is further enhanced with 1-minute sync intervals across all nodes, ensuring robust data durability and high availability.
+:::
+This configuration provides a robust foundation for message persistence while balancing performance and reliability.
+:::tip
+Disabling JetStream can reduce resource utilization for applications that don't require message persistence.
+:::
+### Deployment Modes
+:::warning
+Deployment mode is selected during service creation and cannot be changed later.
+:::
+#### Non-HA Mode
+- Suitable for development and testing
+- Data persistence not guaranteed during node failures
+- Lower resource requirements
+#### HA Mode
+- Creates a multi-node NATS cluster
+- Configures routes between cluster nodes automatically
+- Implements [NATS clustering](https://docs.nats.io/running-a-nats-service/configuration/clustering) for high availability
+- Provides improved reliability compared to non-HA deployments
+### Authentication Management
+Authentication credentials are automatically generated and managed by the platform. The system creates a default user (`zerops`) with a secure 16-character password. You can access these credentials through:
+- The service access details in the Zerops GUI
+- Environment variables in your service configuration:
+ - `user` - Username for authentication (default: "zerops")
+ - `password` - Generated secure password
+ - `connectionString` - Complete connection string in the format `nats://${dbUser}:${dbPassword}@${hostname}:${port}`
+## Health Monitoring
+Zerops continuously monitors your NATS service health using built-in health checks:
+- **HTTP Health Check**: The system checks the `/healthz` endpoint at port 8222
+- **Self-Healing**: The platform automatically recovers unhealthy nodes when issues are detected
+### Health Status
+You can check the health status of your NATS service:
+1. Through the Zerops GUI dashboard
+2. By accessing the management interface at port `8222`
+## Backup and Recovery
+Zerops provides built-in backup functionality for your NATS JetStream data, ensuring your message streams and configurations can be safely preserved and restored when needed.
+### Backup Process
+Backups are created in `.tar.gz` format using the `nats` backup command. They are saved to local disk, compressed, streamed to backup storage, and then deleted locally.
+For general information about backup frequency and storage limits, see our [Backup documentation](/features/backup).
+## Support
+For advanced configurations or custom requirements:
+- Join our [Discord community](https://discord.gg/zerops)
+- Contact support via [email](mailto:support@zerops.io)
+
+----------------------------------------
+
+# Nginx > Faq
+
+ Question: How do I enable SEO optimization with prerender.io?
+Answer:
+ Zerops provides built-in prerender.io support. Simply set the `PRERENDER_TOKEN` environment variable with your prerender.io service token. See our [prerender.io documentation](/nginx/how-to/env-variables#prerenderio-support) for details.
+
+
+----------------------------------------
+
+# Nginx > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing Nginx application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](/nginx/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple Nginx web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Nginx > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](/nginx/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](/nginx/how-to/build-pipeline#ports) `80`, simply use `http://app:80`
+:::info
+Do not use `https://` when communicating with Nginx from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use Nginx environment variables
+Zerops creates default environment variables for each Nginx static service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](/nginx/how-to/env-variables#generated-env-variables) of the Nginx static service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](/nginx/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your Nginx application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access Nginx application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/nginx/how-to/env-variables) are available when connected through VPN. To connect to your Nginx application in Zerops set the hostname and [internal port](/nginx/how-to/build-pipeline#ports) e.g. http://app:80
+:::info
+Do not use `https://` when communicating with Nginx over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your Nginx static service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your Nginx static service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/nginx/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Nginx > How To > Build Pipeline
+
+export const languages = [
+ { name: "Node.js", link: "/nodejs/how-to/build-pipeline" },
+ { name: "PHP", link: "/php/how-to/build-pipeline" },
+ { name: "Python", link: "/python/how-to/build-pipeline" },
+ { name: "Go", link: "/go/how-to/build-pipeline" },
+ { name: ".NET", link: "/dotnet/how-to/build-pipeline" },
+ { name: "Rust", link: "/rust/how-to/build-pipeline" },
+ { name: "Java", link: "/java/how-to/build-pipeline" },
+]
+Zerops provides a customizable build and runtime environment for your static content.
+Zerops supports different build environments:
+If you just need to deploy your static content, use the [manual deploy](/nginx/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) via Zerops CLI.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: nodejs@latest
+ # OPTIONAL. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # REQUIRED. Build your application
+ buildCommands:
+ - npm i
+ - npm run build
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - dist
+ - package.json
+ - node_modules
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ cache: node_modules
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: nginx@latest
+ # OPTIONAL. Customize the runtime Nginx environment by installing additional
+ # dependencies to the base Nginx runtime environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Nginx application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # OPTIONAL. Customize the folder that will be used as the root of the publicly
+ # accessible web server content. Enter the path relative to the /var/www folder.
+ documentRoot: public
+ # OPTIONAL. Sets the custom Nginx configuration. The file must be deployed in
+ # the runtime container. Enter the path to the file relative to the /var/www folder
+ siteConfigPath: site_config.tmpl
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your Nginx application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current Nginx version for your runtime.
+Following options are available for Nginx builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. 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
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the
+ selected major version of Nginx, Zerops command line tool and `composer`, `git` and `wget`.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. 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
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customize your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customized.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+:::info
+If no ports are specified, Zerops adds the port TCP 80 automatically.
+:::
+:::caution
+If you want the web server to listen on other port(s) than `:80`, you must [customize](/nginx/how-to/customize-web-server) your web server configuration as well.
+:::
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a Nginx static service with hostname = "app" and port = 80 from another service of the same project, simply use `app:80`. Read more about [how to access a Nginx static service](/nginx/how-to/access).
+:::info
+Do not use the port **:443**. All the incoming traffic is terminated on the Zerops internal balancer where the SSL certificate is installed and the request is forwarded to your Nginx static service as a **http://** on the port **:80**.
+:::
+Each port has following attributes:
+
+ Parameter
+ Description
+
+ port
+ Defines the port number. You can set any port number between 10 and 65435. Ports outside this interval are reserved for internal Zerops systems.
+
+ protocol
+ Optional. Defines the protocol. Allowed values are TCP or UDP. Default value is TCP.
+
+ httpSupport
+ Optional. httpSupport = true is the default setting for TCP protocol. Set httpSupport = false if a web server isn't running on the port. Zerops uses this information for the configuration of public access. httpSupport = true is available only in combination with the TCP protocol.
+
+### prepareCommands
+_OPTIONAL._ Customizes the Nginx runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base Nginx environment contains {data.alpine.default}, the selected
+ major version of Nginx, Zerops command line tool and `composer`, `git` and `wget`. To install
+ additional packages or tools add one or more prepare commands:
+```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 Nginx runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/nginx/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/nginx/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+
+When the prepare cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances.
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.default}, the
+ selected major version of Nginx, Zerops command line tool and `composer`, `git` and `wget`.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the build section of your chosen technology.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare: ./runtime-config.yaml
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base Nginx runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Nginx application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your Nginx application is started.
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](/nginx/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](/nginx/how-to/build-pipeline#preparecommands) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](/nginx/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances.
+### documentRoot
+_OPTIONAL._ Customizes the folder that will be used as the root of the publicly accessible web server content.
+:::info
+By default, the document root is configured to `/var/www`.
+:::
+Customize the folder that will be used as the root of the publicly accessible web server content. Enter the path relative to the `/var/www` folder.
+E.g. `documentRoot: public` will set the web server document root to `/var/www/public`.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the folder that will be used as the root of the publicly
+ # accessible web server content. Enter the path relative to the /var/www folder.
+ documentRoot: public
+```
+### siteConfigPath
+_OPTIONAL._ Sets the custom Nginx configuration.
+:::info
+If you don't set your custom configuration Zerops applies the [default](/nginx/how-to/customize-web-server#default-nginx-configuration) configuration.
+:::
+The file must be deployed in the runtime container. Enter the path to the file relative to the `/var/www` folder.
+Read more about the [web server customization](/nginx/how-to/customize-web-server).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/nginx/how-to/env-variables) in Zerops.
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the folder that will be used as the root of the publicly
+ # accessible web server content. Enter the path relative to the /var/www folder.
+ documentRoot: public
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Nginx application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the folder that will be used as the root of the publicly
+ # accessible web server content. Enter the path relative to the /var/www folder.
+ documentRoot: public
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](/nginx/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](/nginx/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Nginx application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](/nginx/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Nginx > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart Nginx static service in Zerops GUI
+To stop the Nginx static service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped Nginx static service choose the **Start** item from the same menu.
+To restart the Nginx static service choose the **Restart** item from the same menu.
+## Stop and start Nginx using zCLI
+zCLI is the Zerops command-line tool. To stop and start the Nginx static service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Nginx > How To > Create
+
+The Nginx static service contains the Nginx web server optimized for your static content. Nginx static service is highly scalable and customisable to suit both development and production.
+## Create Nginx static service using Zerops GUI
+First, set up a project in Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new Nginx static service:
+### Choose Nginx version
+Following Nginx versions are currently supported:
+:::info
+You can [change](/nginx/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app","cache", "gui" etc. Duplicate services with the same name in the same project are forbidden.
+#### Limitations:
+- maximum 25 characters
+- must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created. It can't be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as password, tokens, salts, certificates etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting the secret environment variables is optional. You can set them later in Zerops GUI.
+Read more about [different types of env variables](/nginx/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Set auto scaling configuration
+Zerops scales the Nginx static services automatically both vertically and horizontally. Vertical scaling means increasing or decreasing the hardware resources (CPU, RAM and disk) of a Nginx container. Horizontal scaling adds or removes whole containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Nginx static service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Nginx static service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Nginx performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/nginx/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+:::info
+You can change the vertical auto scaling parameters later.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Nginx static service. When your Nginx static service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Nginx static service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](/nginx/how-to/scaling) about Nginx auto scaling.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Create Nginx static service using zCLI
+zCLI is the Zerops command-line tool. To create a new Nginx static service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/nginx/how-to/create#create-a-project-description-file)
+3. [Create a project with a Nginx and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### Basic example:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in nginx@{version} format
+ type: nginx@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one Nginx version 8.1 service with default [auto scaling](/nginx/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/nginx/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Nginx static service
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in nginx@{version} format
+ type: nginx@latest
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create secret env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain an Nginx static service with `app` hostname. The internal port(s) the service listens on will be defined later in the [zerops.yaml](/nginx/how-to/build-pipeline#ports). Nginx static service will run on version 1.22 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+ Limitations
+
+ name
+ The name of the new project. Duplicates are allowed.
+
+ description
+ Optional. Description of the new project.
+ Maximum 255 characters.
+
+ tags
+ Optional. One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects.
+
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains an Nginx static service but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [nginx service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+ All verticalAutoscaling attributes are optional. Not specified
+ attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers
+ for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value
+ map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add Nginx static service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in nginx@{version} format
+ type: nginx@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Nginx static service version 1.22 with default [auto scaling](/nginx/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Nginx > How To > Customize Runtime
+
+
+The default Nginx runtime environment contains:
+- {data.alpine.default}
+- Selected version of Nginx when the runtime service was created.
+- [zCLI](/references/cli)
+- Git and Composer
+:::note
+To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yaml/specification#os--1) attribute.
+Additional packages and tools can be installed using [run.prepareCommands](/zerops-yaml/specification#preparecommands--1).
+:::
+### Runtime Flow
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/nginx/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the run.prepareCommands commands in the defined order
+### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/nginx/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+The prepare runtime container is automatically deleted after the prepare runtime phase has finished or failed.
+### Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the build.addToRunPrepare and run.prepareCommands attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+
+----------------------------------------
+
+# Nginx > How To > Customize Web Server
+
+## Default Nginx configuration
+The default Nginx static service has following configuration:
+```
+server {
+ listen 80 default_server;
+ listen [::]:80 default_server;
+ server_name _;
+ root {{.DocumentRoot}};
+ location / {
+ try_files $uri $uri/ /index.html;
+ }
+ access_log syslog:server=unix:/dev/log,facility=local1,tag=nginx,severity=info default_short;
+ error_log syslog:server=unix:/dev/log,facility=local1,tag=nginx,severity=error;
+}
+```
+The configuration contains 2 variables:
+- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yaml`. If the attribute is not specified, the default value `/var/www` is used.
+## Customize Nginx configuration
+Follow these steps to customize the Nginx configuration in Nginx static service:
+1. Create a **.tmpl** file with the Nginx configuration in your repository.
+2. Optionally use following variables:
+- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yaml`. If the attribute is not specified, the default value `/var/www` is used.
+Example:
+```
+root {{.DocumentRoot}};
+```
+- **`{{.Environment.ENV_NAME}}`** is replaced by the [env variable](/nginx/how-to/env-variables) value. The env variable must be either defined in [run.envVariables](/nginx/how-to/build-pipeline#envvariables) in `zerops.yaml` or set as a [secret](/nginx/how-to/env-variables#set-secret-env-variables-in-zerops-gui) or [generated](/nginx/how-to/env-variables#generated-env-variables) env variable in Zerops GUI.
+:::caution
+Use the **.tmpl** file extension to make Zerops interpret the file as a template. Zerops will replace the supported variables listed above.
+:::
+3. Check that your Nginx configuration is consistent with Zerops requirements:
+- Do not use IP addresses in the `listen` directive
+- If you use other ports than `:80` in the `listen` directive, add them to the `run.ports` in your `zerops.yaml` as well.
+- Do not use the port **:443**. All the incoming `https://` traffic is terminated on the Zerops internal balancer where the SSL certificate is installed and the request is forwarded to your Nginx static service as a **http://** on the port **:80**.
+4. Add the `siteConfigPath` to the run section of your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: nodejs@latest
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - vendor
+ - public
+ # ==== how to run your application ====
+ run:
+ documentRoot: public
+ # OPTIONAL. Sets the custom Nginx or Apache configuration. The file must be deployed in the runtime container. Enter the path to the file relative to the /var/www folder
+ siteConfigPath: site_config.tmpl
+```
+5. Ensure that the `build.deployFiles` contains the folder with the `siteConfigPath` or add the path to the Nginx config file to the `deployFiles` list. Zerops will deploy the file to the runtime container(s).
+6. [Trigger](/nginx/how-to/trigger-pipeline) the build & deploy pipeline.
+### Built-in Prerender.io Support
+The default Nginx configuration includes automatic prerender.io support for SEO optimization. When `PRERENDER_TOKEN` is set, Nginx will automatically serve pre-rendered content to search engines and social media crawlers.
+See [environment variables](/nginx/how-to/env-variables#prerenderio-support) for configuration details.
+
+----------------------------------------
+
+# Nginx > How To > Delete
+
+## Delete Nginx static service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete Nginx using zCLI
+zCLI is the Zerops command-line tool. To delete the Nginx static service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Nginx > How To > Deploy Process
+
+
+## Application artefact
+If you triggered the deploy pipeline [manually](/nginx/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/nginx/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/nginx/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/nginx/how-to/build-pipeline#initcommands)
+4. Starts your application
+5. Optionally waits until the [readiness check](/nginx/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/nginx/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customize the runtime environment](/nginx/how-to/customize-runtime).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The Nginx process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready as soon as it is started, configure a [readiness check](/nginx/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your Nginx static service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/nginx/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Nginx > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+
+ Type
+ Environment
+ Defined in
+
+ basic
+ build
+ zerops.yaml
+
+ basic
+ runtime
+ zerops.yaml
+
+ secret
+ runtime
+ Zerops GUI
+
+Use the [secret env variables](/nginx/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](/nginx/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/nginx/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](/nginx/how-to/create) a new Nginx static service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made to environment variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The Nginx process running in the container receives the list env variables only when it starts. Update of the env variables while the Nginx process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+These restrictions apply to all [types of env variables](/nginx/how-to/env-variables#types-of-env-variables-in-zerops).
+## Referencing other env variables
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your Nginx runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the Nginx static service. The Nginx process running in the container receives the list env variables only when it starts. Update of the env variables while the Nginx process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a Nginx static service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your Nginx app
+Zerops passes all environment variables from all project services when your Nginx app is deployed and started.
+To access the local environment variable i.e. the variable set to this Nginx static service in your app, use:
+```sh
+getenv('YOUR_VARIABLE_KEY_HERE');
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+## Prerender.io Support
+Zerops provides built-in prerender.io support for SEO optimization. Configure it using these environment variables:
+
+ Variable
+ Required
+ Description
+ Default
+
+ PRERENDER_TOKEN
+ Yes
+ Your prerender.io service token
+ -
+
+ PRERENDER_HOST
+ No
+ Prerender service host
+ service.prerender.io
+
+:::tip
+Set `PRERENDER_TOKEN` as a secret environment variable in Zerops GUI for security.
+:::
+Example in zerops.yaml:
+```yaml
+zerops:
+ - setup: app
+ run:
+ envVariables:
+ PRERENDER_HOST: "custom.prerender.host"
+```
+
+----------------------------------------
+
+# Nginx > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Nginx > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](/nginx/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](/nginx/how-to/build-pipeline#preparecommands) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the runtime containers in Zerops CLI use
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## Nginx logging configuration
+By default Nginx static containers logs the content of Nginx access log and error log to syslog:
+```
+ access_log syslog:server=unix:/dev/log,facility=local1,tag=nginx,severity=info default_short;
+ error_log syslog:server=unix:/dev/log,facility=local1,tag=nginx,severity=error;
+```
+The syslog messages are stored and are accessible as a runtime log in Zerops GUI or zCLI.
+
+----------------------------------------
+
+# Nginx > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the Nginx static service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Nginx static service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Nginx static service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient performance or capacity of Nginx static service, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Nginx static service. When your Nginx static service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Nginx static service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 62.5 MB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each Nginx static service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the Nginx static service.
+### Not enough resources to scale up
+If one of the Nginx containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the Nginx static service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor Nginx resources
+Zerops provides information about how much hardware resources the Nginx static service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Nginx > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your Nginx static service directly when creating a new shared storage service. Just select your Nginx static service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the Nginx static service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create Nginx static service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new Nginx static service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](#create-a-project-description-file)
+3. [Create a project with a Nginx static service and a shared storage](#create-a-project-with-nginx-static-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](/nginx/how-to/create#create-a-project-description-file) how to define the Nginx static service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Nginx and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in nginx@{version} or nginx@latest format
+ type: nginx@latest
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the Nginx static service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with Nginx static service and a shared storage
+Follow the article [How to create a project based on the description.yaml](/nginx/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Nginx > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](/nginx/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](/nginx/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](/nginx/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Nginx > How To > Upgrade
+
+You can upgrade or downgrade your Nginx static service to a different major Nginx version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/nginx/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Nginx version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Nginx version for your runtime.
+
+----------------------------------------
+
+# Nginx > Overview
+
+The Nginx static service contains the [Nginx ↗](https://nginx.org/) web server optimized for your static content.
+## How to start
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Nginx > Tutorial > Quickstart
+
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-php-hello-world), a **_recipe_**, containing the most simple Nginx web application. The repo will be used as a source from which the app will be built.
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-php-hello-world/blob/main/import-project/description.yaml)):
+```yaml
+project:
+ name: my-first-project
+services:
+ - hostname: helloworld
+ type: php-apache@8.1+2.4
+ minContainers: 1
+ maxContainers: 3
+ buildFromGit: https://github.com/zeropsio/recipe-php-hello-world@main
+ enableSubdomainAccess: true
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://helloworld-24-8080.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+Hello, World!
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Nginx > Tutorial > Runtime Sql
+
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-onboarding-php), a **_recipe_**, containing a PostgreSQL service with a simple Nginx application. The repo will be used as a source from which the app will be built.
+:::tip
+Follow the steps below and when everything is working as expected, fork the repo, try making various changes or be bold and connect your own.
+:::
+:::note
+In the detail of each step, you can find a link with more information about the topic.
+:::
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+ 2. Create a project.
+
+ Learn more about projects in Zerops. See how to
+ import a whole project into Zerops.
+
+ 3. In the left menu, click on Import services, copy & paste the
+ contents of the `import-services.yaml` config file from the recipe
+ repository of your choice. Then click on Import service.
+
+ Learn more about services in
+ Zerops and how to import a service to an existing project.
+
+ The yaml file includes a `buildFromGit` directive, which ensures
+ a one-time build from Git repository source. See how to connect a Github or Gitlab repository to be able to
+ trigger automatic builds & deploys.
+
+ 4. Several pipelines are created, one for project creation and the rest for the activation of the services. Wait for all to finish.
+
+ Learn more about how the pipelines can be triggered and about build and deploy processes of a Nginx application in Zerops.
+Learn more about how to access build log of your Nginx static service in Zerops.
+
+ 5. In the service detail, open the Public access & internal ports section, and Enable Zerops Subdomain.
+
+ Learn more about how to access your Nginx
+ static service in Zerops.
+
+ 6. Once the pipeline has finished, click on the activated subdomain URL. You should see a simple page with
+`Entry added successfully with random data: f47ac10b-58cc-0372-8567-0e02b2c3d479. Total count: 1`
+
+ Congratulations! You have created your first application in Zerops, and we hope to see your own projects soon.
+For now, check out other features, such as environment variables, runtime log and scaling.
+
+ 7. One of the services is `adminer`, a database management tool.
+ See how to access it.
+
+ Learn more about how to use `psql` command-line tool instead or how to import and export data from your database.
+
+8. Feel free to make any changes to your project, fork the repo or connect your own. Also see other Nginx and PostgreSQL recipes on our Github page.
+
+:::tip
+Have you got any additional question? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Nginx > Tutorial > Step By Step
+
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-php-hello-world), a **_recipe_**, containing the most simple Nginx web application. The repo will be used as a source from which the app will be built.
+:::tip
+Follow the steps below and when everything is working as expected, fork the repo, try making various changes or be bold and connect your own.
+:::
+:::note
+In the detail of each step, you can find a link with more information about the topic.
+:::
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+ 2. Create a project.
+
+ Learn more about projects in
+ Zerops. See how to import a whole project into Zerops.
+
+ 3. In the left menu, click on Import services, copy & paste the
+ contents of this yaml file and click on Import service.
+
+ Learn more about services in Zerops and how to import a service to an existing project.
+
+ The yaml file includes a `buildFromGit` directive, which ensures
+ a one-time build from Git repository source. See how to connect a Github or Gitlab repository to be able to
+ trigger automatic builds & deploys.
+
+ 4. Two pipelines are created, one for project creation and one for the service activation. Wait for both to finish.
+
+ Learn more about how the pipelines can be triggered and about build and deploy processes of a Nginx application in Zerops.
+Learn more about how to access build log of your Nginx static service in Zerops.
+
+ 5. In the service detail, open the Public access & internal ports section, and Enable Zerops Subdomain.
+
+ Learn more about how to access your Nginx
+ static service in Zerops.
+
+ 6. Once the pipeline has finished, click on the activated subdomain URL:
+ You should see a simple page with `Hello World!` printed.
+
+ Congratulations! You have created your first application in Zerops, and we hope to see your own projects soon.
+For now, check out other features, such as environment variables, runtime log and scaling.
+
+7. Feel free to make any changes to your project, fork the repo or connect your own. Also see other Nginx recipes on our Github page.
+
+:::tip
+Have you got any additional question? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Nodejs > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing Node.js application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](/nodejs/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple Node.js web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Nodejs > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](/nodejs/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](/nodejs/how-to/build-pipeline#ports) `3000`, simply use `http://app:3000`
+:::info
+Do not use `https://` when communicating with Node.js from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use Node.js environment variables
+Zerops creates default environment variables for each Node.js service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](/nodejs/how-to/env-variables#generated-env-variables) of the Node.js service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](/nodejs/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your Node.js application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access Node.js application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/nodejs/how-to/env-variables) are available when connected through VPN. To connect to your Node.js application in Zerops set the hostname and [internal port](/nodejs/how-to/build-pipeline#ports) e.g. http://app:3000
+:::info
+Do not use `https://` when communicating with Node.js over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your Node.js service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your Node.js service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/nodejs/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Nodejs > How To > Build Pipeline
+
+Zerops provides a customizable build and runtime environment for your Node.js application.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: nodejs@latest
+ # OPTIONAL. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # REQUIRED. Build your application
+ buildCommands:
+ - npm i
+ - npm run build
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - dist
+ - package.json
+ - node_modules
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ cache: node_modules
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: nodejs@latest
+ # OPTIONAL. Sets the internal port(s) your app listens on:
+ ports:
+ # port number
+ - port: 3000
+ # OPTIONAL. Customize the runtime Node.js environment by installing additional
+ # dependencies to the base Node.js runtime environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Node.js application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # REQUIRED. Your Node.js application start command
+ start: npm start
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your Node.js application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Build pipeline configuration
+### base
+_REQUIRED._ Sets the base technology for the build environment.
+Following options are available for Node.js builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: nodejs@latest
+ ...
+```
+ The base build environment contains {data.alpine.default}, the selected
+ major version of Node.js, Zerops command line tool, `npm`, `yarn`, `git` and `npx` tools.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base:
+ - nodejs@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
+To customize your build environment use the [prepareCommands](/nodejs/how-to/build-pipeline#preparecommands) attribute.
+:::note
+Modifying the base technology will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### os
+_OPTIONAL._ Sets the operating system for the build environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customized.
+:::
+:::note
+Changing the OS setting will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache behavior.
+:::
+### prepareCommands
+_OPTIONAL._ Customizes the build environment by installing additional dependencies or tools to the base build environment.
+The base build environment contains:
+- {data.alpine.default}
+- selected version of Node.js defined in the [base](/nodejs/how-to/build-pipeline#base) attribute
+- [Zerops command line tool](/references/cli)
+- `npm`, `yarn`, `git` and `npx` tools
+To install additional packages or tools add one or more prepare commands:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: nodejs@latest
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first build is triggered, Zerops will
+1. create a build container
+2. download your application code from your repository
+3. run the prepare commands in the defined order
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::note
+These commands are skipped when using cached environment. Modifying `prepareCommands` will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache invalidation.
+:::
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/nodejs/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all prepare commands are finished, your custom build environment is ready for the build phase.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### buildCommands
+_REQUIRED._ Defines build commands.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: nodejs@latest
+ # REQUIRED. Build your application
+ buildCommands:
+ - npm i
+ - npm run build
+ ...
+```
+At least one command is required. Zerops triggers each command in the defined order in a dedicated build container.
+Before the build commands are triggered the build container contains:
+1. base environment defined by the [base](/nodejs/how-to/build-pipeline#base) attribute
+2. optional customisation of the base environment defined in the [prepareCommands](/nodejs/how-to/build-pipeline#preparecommands) attribute
+3. your application code
+#### Run build commands as a single shell instance
+Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it.
+```yaml
+buildCommands:
+ - |
+ npm i
+ npm run build
+```
+#### Run build commands as a separate shell instances
+When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command.
+```yaml
+buildCommands:
+ - npm i
+ - npm run build
+```
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/nodejs/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the --verbose option.
+```yaml
+buildCommands:
+ - npm i --verbose
+ - npm run build
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the deploy phase.
+### deployFiles
+_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
+```yaml
+# REQUIRED. Select which files / folders to deploy after
+# the build has successfully finished
+deployFiles:
+ - dist
+ - package.json
+ - node_modules
+```
+Determines files or folders produced by your build, which should be deployed to your runtime service containers.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Examples
+Deploys a folder, and a file from the project root directory:
+```yaml
+deployFiles:
+ - dist
+ - package.json
+```
+Deploys the whole content of the build container:
+```yaml
+deployFiles: .
+```
+Deploys a folder, and a file in a defined path:
+```yaml
+deployFiles:
+ - ./path/to/file.txt
+ - ./path/to/dir/
+```
+#### How to use a wildcard in the path
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+Deploys all folders that are located in any path that begins with `/path/to/`
+```yaml
+deployFiles: ./path/to/~/
+```
+Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/
+```
+:::note Example
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+:::
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+_OPTIONAL._ Defines which files or folders will be cached for the next build.
+```yaml
+# OPTIONAL. Which files / folders you want to cache for the next build.
+# Next builds will be faster when the cache is used.
+cache: file.txt
+```
+The cache attribute helps optimize build times by preserving specified files between builds.
+The cache attribute supports the [~ wildcard character](#how-to-use-a-wildcard-in-the-path).
+Learn more about the [build cache system](/features/build-cache) in Zerops.
+### envVariables
+_OPTIONAL._ Defines the environment variables for the build environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ base: nodejs@latest
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/nodejs/how-to/env-variables) in Zerops.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current Node.js version for your runtime.
+Following options are available for Node.js builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. 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: nodejs@latest
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the
+ selected major version of Node.js, Zerops command line tool, `npm`, `yarn`, `git` and `npx` tools.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. 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:
+ - nodejs@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customize your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customized.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a Node.js service with hostname = "app" and port = 3000 from another service of the same project, simply use `app:3000`. Read more about [how to access a Node.js service](/nodejs/how-to/access).
+Each port has following attributes:
+
+ Parameter
+ Description
+
+ port
+ Defines the port number. You can set any port number between 10 and 65435. Ports outside this interval are reserved for internal Zerops systems.
+
+ protocol
+ Optional. Defines the protocol. Allowed values are TCP or UDP. Default value is TCP.
+
+ httpSupport
+ Optional. httpSupport = true is the default setting for TCP protocol. Set httpSupport = false if a web server isn't running on the port. Zerops uses this information for the configuration of public access. httpSupport = true is available only in combination with the TCP protocol.
+
+### prepareCommands
+_OPTIONAL._ Customises the Node.js runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base Node.js environment contains {data.alpine.current} the selected
+ major version of Node.js, Zerops command line tool and `npm`, `yarn`, `git` and `npx` tools. To install
+ additional packages or tools add one or more prepare commands:
+```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 Node.js runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/nodejs/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/nodejs/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.current}, the
+ selected major version of Node.js, Zerops command line tool and `npm`, `yarn`, `git` and `npx` tools.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare: ./runtime-config.yaml
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base Node.js runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Node.js application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your Node.js application is started via the [start command](/nodejs/how-to/build-pipeline#start).
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](/nodejs/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](/nodejs/how-to/build-pipeline#preparecommands-1) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](/nodejs/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/nodejs/how-to/env-variables) in Zerops.
+### start
+_REQUIRED._ Defines the start command for your Node.js application.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Node.js application start command
+ start: npm start
+```
+We recommend starting your Node.js application using `npm start`.
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Node.js application start command
+ start: npm start
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Node.js application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Node.js application start command
+ start: npm start
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+### crontab
+_OPTIONAL._ Defines cron jobs.
+Setup cron jobs in the following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ crontab:
+ # REQUIRED. Sets the command to execute:
+ - command: ""
+ # REQUIRED. Sets the interval time to execute:
+ timing: "0 * * * *"
+```
+Read more about setting up [cron](/references/cron) in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](/nodejs/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](/nodejs/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Node.js application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](/nodejs/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Nodejs > How To > Build Process
+
+
+## Customize NodeJS build environment
+The default NodeJS build environment contains:
+- {data.alpine.default}
+- Selected version of Node.js when the runtime service was created.
+- [zCLI](/references/cli)
+- NPM, Yarn, Git and NPX tools
+:::note
+To use Ubuntu instead of the default Alpine, set the [build.os](/zerops-yaml/specification#os-) attribute.
+Additional packages and tools can be installed using [build.prepareCommands](/zerops-yaml/specification#preparecommands-).
+:::
+## Description of the build process
+Zerops starts a temporary build container and performs following actions:
+1. Installs the build environment:
+ - Sets up base system and Go runtime
+ - Restores cached files if available (based on `build.cache` configuration)
+ - Validates cache against current `build.os`, `build.base`, and `build.prepareCommands`
+2. Downloads your application source code from [GitHub ↗](https://www.github.com), [GitLab ↗](https://www.gitlab.com) or via [Zerops CLI](/references/cli)
+3. Optionally [customizes the build environment](#customize-nodejs-build-environment)
+4. Runs the build commands
+5. Uploads the application artefact to the internal Zerops storage
+6. Preserves specified files for future builds (based on `build.cache` configuration)
+7. Optionally [customizes the runtime environment](/nodejs/how-to/customize-runtime)
+8. [Deploys your application](/nodejs/how-to/deploy-process)
+The build container is automatically deleted after the build has finished or failed.
+## Cancel running build
+When you know that the running build is not correct and you want to cancel it, you can do it in Zerops GUI. Go to the service detail, open the list of running processes and click on the **Open pipeline detail** button. Then click on the **Cancel build** button.
+
+:::caution
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+:::
+## Customize Node.js build environment
+The default Node.js build environment contains:
+- {data.alpine.default}
+- selected version of Node.js defined in `zerops.yaml` [build.base](/nodejs/how-to/build-pipeline#base) parameter
+- [zCLI](/references/cli), Zerops command line tool
+- `npm`, `yarn`, `git` and `npx` tools
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/nodejs/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](/nodejs/how-to/build-pipeline#preparecommands) commands to your `zerops.yaml`.
+:::info
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::
+## Node.js build hardware resources
+Build of your Node.js application is run in a separate build container with following resource configuration:
+| HW resource | Minimum | Maximum |
+| ------------- | ------- | ------- |
+| **CPU cores** | 6 | 20 |
+| **RAM** | 8 GB | 8 GB |
+| **Disk** | 1 GB | 100 GB |
+| **Disk** | 1 GB | 100 GB |
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+## Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops will terminate the build pipeline and delete the build container.
+## Troubleshooting build-related problems
+### Failure of a build prepare command
+If any [prepare command](/nodejs/how-to/build-pipeline#preparecommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/nodejs/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom build environment is ready for the build phase.
+### Invalidate the build cache
+If you encounter unexpected build behavior or dependency issues, the problem might be related to [cached build data](/features/build-cache). While Zerops maintains the build cache to speed up deployments, sometimes you may need to start fresh.
+To invalidate the build cache:
+1. Go to your service detail in Zerops GUI
+2. Choose **Pipelines & CI/CD Settings** from the left menu
+3. Click on the **Invalidate build cache** button
+This will force Zerops to run the next build clean, including all prepare commands, which can help resolve cache-related issues. After invalidation, your next build will also create a fresh cache.
+### Failure of a build command
+If any [build command](/nodejs/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/nodejs/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `--verbose` option.
+```yaml
+buildCommands:
+ - npm i --verbose
+ - npm run build
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the [deploy](/nodejs/how-to/deploy-process) phase.
+
+----------------------------------------
+
+# Nodejs > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart Node.js service in Zerops GUI
+To stop the Node.js service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped Node.js service choose the **Start** item from the same menu.
+To restart the Node.js service choose the **Restart** item from the same menu.
+## Stop and start Node.js using zCLI
+zCLI is the Zerops command-line tool. To stop and start the Node.js service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Nodejs > How To > Create
+
+Zerops provides a powerful Node.js runtime service with extensive build support. The Node.js runtime is highly scalable and customizable to suit your development and production needs. With just a few clicks or commands, you can have a production-ready Node.js environment up and running in no time.
+## Create a Node.js service using Zerops GUI
+First, set up a project in the Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu under the **Services** section. From there, you can add a new Node.js service:
+### Choose a Node.js version
+Zerops supports the following Node.js versions:
+:::info
+You can easily [upgrade](/nodejs/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app", "cache", "gui", etc. Duplicate services with the same name within the same project are not allowed.
+#### Limitations:
+- Maximum 25 characters
+- Must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created and cannot be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as passwords, tokens, salts, certificates, etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting secret environment variables is optional. You can always set them later in the Zerops GUI.
+Read more about the [different types of environment variables](/nodejs/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Configure auto scaling
+Zerops automatically scales Node.js services both vertically and horizontally. Vertical scaling adjusts the hardware resources (CPU, RAM, and disk) of a Node.js container, while horizontal scaling adds or removes entire containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. The power your application receives depends on the other applications running on the same CPU core. In the best-case scenario, your application gets 10/10 of the CPU core power, and 1/10 in the worst-case scenario.
+**Dedicated**
+The CPU core is dedicated exclusively to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+You can choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has the following default configuration:
+Node.js services always start with the minimal resources.
+In most cases, the default parameters will work without issues. If you need to limit the cost of the Node.js service, you can lower the maximum resources. Zerops will never scale above the selected maximums.
+If you experience insufficient Node.js performance or capacity, you can increase the minimum resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine-tune](/nodejs/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application's needs.
+:::
+:::info
+You can change the vertical auto scaling parameters at any time.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but is already consuming the maximum resources defined for vertical auto scaling, Zerops will add a new container to your Node.js service. When your Node.js service doesn't need as much power and all containers are vertically scaled down such that their CPU allocation is near the minimum resources, Zerops will gradually remove entire containers.
+Horizontal auto scaling has the following default configuration:
+
+ Parameter
+ Value
+
+ Minimum containers
+ 1
+
+ Maximum containers
+ 6
+
+Node.js services always start with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](/nodejs/how-to/scaling) about Node.js auto scaling in Zerops.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will automatically start a new container and deploy your application. However, the application will be unavailable for a short period. This mode is recommended for non-critical applications or development environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers based on your application's load. An application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed down to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents temporary outages in case any of the Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically, and the broken container will be deleted.
+:::caution
+Make sure your application is designed to run in multiple containers.
+:::
+## Create a Node.js service using zCLI
+zCLI is the Zerops command-line tool. To create a new Node.js service via the command line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/nodejs/how-to/create#create-a-project-description-file)
+3. [Create a project with a Node.js and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a YAML format to describe the project infrastructure.
+#### Basic example:
+Create a directory called `my-project`. Inside the `my-project` directory, create a `description.yaml` file with the following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in nodejs@{version} format
+ type: nodejs@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one Node.js version 20 service with default [auto scaling](/nodejs/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/nodejs/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Node.js and PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in nodejs@{version} format
+ type: nodejs@latest
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+ - # second service hostname
+ hostname: db
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain a Node.js service and a [PostgreSQL](/postgresql/overview) service.
+Node.js service with "app" hostname, the internal port(s) the service listens on will be defined later in the [zerops.yaml](/nodejs/how-to/build-pipeline#ports). Node.js service will run on version 20 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+ Limitations
+
+ name
+ The name of the new project. Duplicates are allowed.
+
+ description
+ Optional. Description of the new project.
+ Maximum 255 characters.
+
+ tags
+ Optional. One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects.
+
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains Node.js and PostgreSQL services but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ The hostname of the new database will be set to the `hostname` value.
+
+ Limitations:
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [Node.js service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+
+ All verticalAutoscaling attributes are optional. Not specified attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add Node.js service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in nodejs@{version} format
+ type: nodejs@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Node.js service version 20 with default [auto scaling](/nodejs/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Nodejs > How To > Customize Runtime
+
+
+### Runtime Environment
+The default Node.js runtime environment contains:
+- {data.alpine.default}
+- Selected version of Node.js when the runtime service was created.
+- [zCLI](/references/cli)
+- NPM, Yarn, Git and NPX tools
+:::note
+To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yaml/specification#os--1) attribute.
+Additional packages and tools can be installed using [run.prepareCommands](/zerops-yaml/specification#preparecommands--1).
+:::
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. Create a prepare runtime container
+2. Optionally: [copy selected folders or files from your build container](/nodejs/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. Run the run.prepareCommands in the defined order
+### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/nodejs/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+The prepare runtime container is automatically deleted after the prepare runtime phase has finished or failed.
+### Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the build.addToRunPrepare and run.prepareCommands attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+
+----------------------------------------
+
+# Nodejs > How To > Delete
+
+## Delete Node.js service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete Node.js using zCLI
+zCLI is the Zerops command-line tool. To delete the Node.js service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Nodejs > How To > Deploy Process
+
+
+## Application artefact
+When the [build phase](/nodejs/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](/nodejs/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/nodejs/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/nodejs/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/nodejs/how-to/build-pipeline#initcommands)
+4. Starts your application using the [start command](/nodejs/how-to/build-pipeline#start)
+5. Optionally waits until the [readiness check](/nodejs/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/nodejs/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customize the runtime environment](/nodejs/how-to/build-pipeline#preparecommands-1).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The Node.js process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready to handle requests right after it is started via the [start command](/nodejs/how-to/build-pipeline#start), configure a [readiness check](/nodejs/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your Node.js service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/nodejs/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Nodejs > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+
+ Type
+ Environment
+ Defined in
+
+ basic
+ build
+ zerops.yaml
+
+ basic
+ runtime
+ zerops.yaml
+
+ secret
+ runtime
+ Zerops GUI
+
+Use the [secret env variables](/nodejs/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](/nodejs/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/nodejs/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](/nodejs/how-to/create) a new Node.js service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made to environment variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The Node.js process running in the container receives the list env variables only when it starts. Update of the env variables while the Node.js process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ NODE_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+These restrictions apply to all [types of env variables](/nodejs/how-to/env-variables#types-of-env-variables-in-zerops).
+## Referencing other env variables
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your Node.js runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the Node.js service. The Node.js process running in the container receives the list env variables only when it starts. Update of the env variables while the Node.js process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a Node.js service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your Node.js app
+Zerops passes all environment variables from all project services when your Node.js app is deployed and started.
+To access the local environment variable i.e. the variable set to this Node.js service in your app, use:
+```sh
+process.env.YOUR_VARIABLE_KEY_HERE
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+
+----------------------------------------
+
+# Nodejs > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Nodejs > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](/nodejs/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](/nodejs/how-to/build-pipeline#preparecommands-1) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the runtime containers in Zerops CLI use
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## Node.js logging configuration
+Zerops logs all messages sent
+- to the standard error (`stderr`)
+- to the standard output (`stdout`)
+- via the Node.js `console.log` method
+### Severity level
+By default the `console.log` creates a message with the `Informational (6)` severity.
+Add a severity number in the `` format as a prefix to set a custom severity as shown below:
+```js
+console.log('A message with the informational severity ...');
+console.log('Emergency (0) severity > system is unusable.');
+console.log('Alert (1) severity > action must be taken immediately.');
+console.log('Critical (2) severity > critical conditions.');
+console.log('Error (3) severity > error conditions.');
+console.log('Warning (4) severity > warning conditions.');
+console.log('Notice (5) severity > normal, but significant, condition.');
+console.log('Informational (6) severity > informational message.');
+console.log('Debug (7) severity > debug-level message.');
+```
+:::info
+`console.info`, `console.warn`, `console.debug`
+, and `console.error` are just aliases to the `
+ console.log
+` method. They don't set the appropriate severity number. Use the `
+ <N>
+` prefix instead. :::
+
+----------------------------------------
+
+# Nodejs > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the Node.js service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Node.js service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Node.js service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Node.js performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Node.js service. When your Node.js service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Node.js service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each Node.js service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the Node.js service.
+### Not enough resources to scale up
+If one of the Node.js containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the Node.js service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor Node.js resources
+Zerops provides information about how much hardware resources the Node.js service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Nodejs > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your Node.js service directly when creating a new shared storage service. Just select your Node.js service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the Node.js service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create Node.js service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new Node.js service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/nodejs/how-to/shared-storage#create-a-project-description-file)
+3. [Create a project with a Node.js service and a shared storage](/nodejs/how-to/shared-storage#create-a-project-with-a-nodejs-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](/nodejs/how-to/create#create-a-project-description-file) how to define the Node.js service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Node.js and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in nodejs@{version} format
+ type: nodejs@latest
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the Node.js service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with a Node.js service and a shared storage
+Follow the article [How to create a project based on the description.yaml](/nodejs/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Nodejs > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](/nodejs/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](/nodejs/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](/nodejs/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Nodejs > How To > Upgrade
+
+You can upgrade or downgrade your Node.js service to a different major Node.js version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/nodejs/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Node.js version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Node.js version for your runtime.
+If you want to build your application with a different major Node.js version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
+
+----------------------------------------
+
+# Nodejs > Overview
+
+[Node.js ↗](https://nodejs.org/en) is an asynchronous event-driven JavaScript runtime, which is designed to build scalable network applications.
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-nodejs), a **_recipe_**, containing the most simple Node.js web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of Node.js app running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-nodejs/blob/main/zerops-project-import.yaml)):
+```yaml
+project:
+ name: recipe-nodejs
+ tags:
+ - zerops-recipe
+services:
+ - hostname: api
+ type: nodejs@20
+ enableSubdomainAccess: true
+ buildFromGit: https://github.com/zeropsio/recipe-nodejs
+ - hostname: db
+ type: postgresql@16
+ mode: NON_HA
+ priority: 1
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://helloworld-24-8080.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+Hello, World!
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+## How to start
+It doesn't matter whether it's your first curious introduction to Zerops, you have already mastered the basics and are looking for a tiny detail or inspiration. Below, choose a section that fits your needs:
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Object Storage > How To > Access
+
+Zerops Object storage is powered by [MinIO](https://min,io), a high-performance, S3 compatible object store. Object storage services are operated on an independent infrastructure separated from your other project services. You can access the object storage from any service hosted in Zerops or remotely over the internet.
+## Object storage bucket
+Zerops creates one bucket automatically for each new Object storage service.
+:::note
+Each Object storage service can only contain one bucket. If your application needs multiple buckets, add more Object storage services.
+:::
+#### Name
+Bucket is created with a name based on the selected service name and a random prefix. The name of the bucket cannot be changed later.
+#### Access policy
+The bucket's access policy was defined when the Object storage service was created. You can [change it] later in Zerops GUI.
+#### Quota
+The bucket quota size was defined when the Object storage service was created. You can [change it] later in Zerops GUI.
+## Copy access details from Zerops GUI
+You will find the Object storage access details under the **Access details** button in the project dashboard page.
+The same information is available in the service detail page under the **Access & bucket details** menu.
+
+### Object storage access parameters
+| Parameter | Description |
+| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **API URL** | URL of the Object storage service |
+| **Bucket Name** | Bucket is created with a name based on the selected service name and a random prefix. The name of the bucket is fixed and cannot be changed later. |
+| **Access Key ID** | The S3 Access Key ID |
+| **Secret Key** | The S3 Secret Key |
+| **Secret Key** | The S3 Secret Key |
+## Use Object storage environment variables
+Zerops creates default environment variables for each Object storage service to help you with connection from any runtime services in the same project. To avoid the need to copy Object storage access parameters manually, use environment variables in your runtime service.
+### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service name and underscore.
+#### Example
+To access the `bucketName` env variable of the `upload` service, use `upload_bucketName` as the env variable key. To access the `secretAccessKey` env variable of the `storage` service, use `storage_secretAccessKey` as the env variable key.
+### Object storage environment variables
+List of service environment variables is available in Zerops GUI. Go to an Object storage service detail and choose **Environment variables** in the left menu.
+
+Zerops creates following environment variables when the Object storage service is created:
+| Variable | Description |
+| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **apiUrl** | URL of the Object storage service |
+| **accessKeyId** | The S3 Access Key ID |
+| **secretAccessKey** | The S3 Secret Key |
+| **bucketName** | Bucket is created with a name based on the selected service name and a random prefix. The name of the bucket is fixed and cannot be changed later. |
+| **quotaGBytes** | The bucket quota in GB. |
+| **projectId** | ID of the project. Generated by Zerops. |
+| **serviceId** | ID of the Object storage service. Generated by Zerops. |
+| **hostname** | The name of the Object storage service. |
+| **hostname** | The name of the Object storage service. |
+
+----------------------------------------
+
+# Object Storage > How To > Create
+
+Zerops provides a S3 compatible Object storage service to store your files. Zerops Object storage is powered by [MinIO](https://min.io), a high-performance, S3 compatible object store. MinIO is built for large scale AI/ML, data lake and database workloads.
+## Create Object storage service using Zerops GUI
+First, set up a project in Zerops GUI and add a runtime service. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new Object storage service:
+### Set a name
+Enter a unique service identifier like `storage`,`s3` etc. Duplicate services with the same name in the same project are forbidden.
+#### Limitations:
+maximum 25 characters
+must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::note
+The name is fixed after the service is created. It can't be changed later.
+:::
+### Object storage bucket
+Zerops creates one bucket automatically for each new Object storage service.
+:::note
+Each Object storage service can only contain one bucket. If your application needs multiple buckets, add more Object storage services.
+:::
+#### Name
+Bucket will be created with a name based on the given service name and a random prefix. The name of the bucket cannot be changed later.
+#### Access policy
+Select one of the basic policy templates:
+
+ Template
+ Description
+
+ Public read
+
+ Allows anyone:
+
+ to read the bucket's location `(s3:GetBucketLocation)`
+ to list all bucket's objects `(s3:ListBucket)`
+ to get any object of the bucket `(s3:GetObject)`
+
+ Public objects read
+
+ Allows anyone:
+
+ to read the bucket's location `(s3:GetBucketLocation)`
+ to get any object of the bucket `(s3:GetObject)`
+
+ Public read write
+
+ Allows anyone:
+
+ to read the bucket's location `(s3:GetBucketLocation)`
+ to list all bucket's objects `(s3:ListBucket)`
+ to get any object of the bucket `(s3:GetObject)`
+ to create a new object in the bucket `(s3:PutObject,s3:ListMultipartUploadParts, s3:AbortMultipartUpload, s3:ListBucketMultipartUploads)`
+ to delete any object of the bucket `(s3:DeleteObject)`
+
+ Public write
+ Allows anyone to create objects in the bucket `(PutObject action)`
+
+ Private
+ Denies the access to unauthenticated users.
+
+Or you can set your own access policy in the [IAM Policy JSON format](https://min.io/docs/minio/linux/administration/identity-access-management/policy-based-access-control.html#policy-document-structure).
+#### Example:
+```yaml
+{
+ 'Version': '2012-10-17',
+ 'Statement':
+ [
+ {
+ 'Effect': 'Allow',
+ 'Principal': { 'AWS': ['*'] },
+ 'Action': ['s3:GetBucketLocation', 's3:ListBucket'],
+ 'Resource': ['arn:aws:s3:::{{.BucketName}}'],
+ },
+ {
+ 'Effect': 'Allow',
+ 'Principal': { 'AWS': ['*'] },
+ 'Action': ['s3:GetObject'],
+ 'Resource': ['arn:aws:s3:::{{.BucketName}}/*'],
+ },
+ ],
+}
+```
+:::tip
+The `{{ .BucketName }}` variable will be replaced by the bucket name.
+:::
+The bucket's policy can be changed later in Zerops GUI.
+#### Quota
+Set the bucket quota size in GB. The quota must be set manually. It can be changed later in Zerops GUI. Zerops doesn't support Object storage autoscaling. You can set the bucket quota from 1 to 100 GB.
+
+## Create Object storage using zCLI
+zCLI is the Zerops command-line tool. To create a new Object storage service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](#create-a-project-description-file)
+3. Create a project and an Object storage service
+### Create a project description file
+Zerops uses a yaml format file to describe the project infrastructure.
+#### Example
+Create a directory `my-project`. Create a `description.yaml` file inside the directory with the following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with an Object storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: upload
+ # service type
+ type: objectstorage
+ # Object storage size in GB
+ objectStorageSize: 73
+ # Choose object storage policy from a predefined list
+ objectStoragePolicy: public-write
+ # Or define a custom policy
+ objectStorageRawPolicy:
+```
+The yaml file describes your future project infrastructure. The project will contain one Object storage service named `upload`. The bucket quota will be set to 73 GB and the bucket access policy will be set to `public-write`.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+ Limitations
+
+ name
+ The name of the new project. Duplicates are allowed.
+ Maximum 255 characters
+
+ description
+ Optional. Description of the new project.
+
+ tags
+ Optional. One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects.
+
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains only Object storage service but you can create a description.yaml with different types of services.
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ Limitations:
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the Object storage type objectstorage and version.
+
+ Set type: `objectstorage`
+
+ Limitations:
+
+ Currently `objectstorage` or `object-storage` is available.
+
+ objectStorageSize
+
+ The size of the bucket quota in GB.
+
+ Limitations:
+
+ Set a whole number between 1 and 100.
+
+ objectStoragePolicy
+
+ Optional. Either `objectStoragePolicy` or `objectStorageRawPolicy` is required.
+
+ Set one of allowed values:
+
+ `public-read`
+ `public-objects-read`
+ `public-read-write`
+ `public-write`
+ `private`
+
+ Read more about the basic policy templates.
+
+ objectStorageRawPolicy
+
+ Optional. Either `objectStoragePolicy` or `objectStorageRawPolicy` is required.
+
+ Set your own access policy in the IAM Policy JSON format.
+
+ The `{{ .BucketName }}` variable will be replaced by the bucket name.
+
+Zerops creates one bucket automatically for each new Object storage service.
+:::note
+Each Object storage service can only contain one bucket. If your application needs multiple buckets, add more Object storage services.
+:::
+Bucket will be created with a name based on the given service name and a random prefix. The name of the bucket cannot be changed later.
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add Object service to an existing project
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# array of project services
+services:
+ - # service name
+ hostname: upload
+ # service type
+ type: objectstorage
+ # Object storage size in GB
+ objectStorageSize: 73
+ # Choose object storage policy from a predefined list
+ objectStoragePolicy: public-write
+ # Or define a custom policy
+ objectStorageRawPolicy:
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Object storage service named upload will be created. The bucket quota will be set to 73 GB and the bucket access policy will be set to `public-write`.
+The content of the `services:` section of `import.yaml` is identical to the [project description file]. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the `import.yaml` file is 100 kB.
+#### Example
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```bash
+# array of project services
+services:
+ -
+ # service name
+ hostname: storage
+ # service type
+ type: objectstorage
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Object storage service in the single container mode with default auto scaling configuration will be added to your project. Hostname of the new service will be set to `storage`.
+The content of the `services:` section of `import.yaml` is identical to the [project description file](#create-a-project-description-file). The `import.yaml` never contains the `project:` section because the project already exists.
+
+----------------------------------------
+
+# Object Storage > How To > Curl File
+
+This guide explains how to download a single file from a private Object Storage bucket using cURL and a bash script with Zerops object storage.
+## Prerequisites
+- Access to Zerops Object Storage
+- Storage credentials (`ACCESS_KEY_ID` and `SECRET_ACCESS_KEY`)
+- Bash environment
+- OpenSSL and cURL installed
+:::caution
+Store your storage credentials securely and never commit them to version control.
+:::
+## Script
+Save this script as `download-storage.sh`:
+```bash
+#!/bin/bash
+server="${3:-storage-prg1.zerops.io}"
+file_path=$2
+bucket=$1
+set -eu pipefail
+contentType="application/octet-stream"
+dateValue=`date -R`
+signature_string="GET\n\n${contentType}\n${dateValue}\n/${bucket}/${file_path}"
+signature_hash=`echo -en ${signature_string} | openssl sha1 -hmac ${SECRET_ACCESS_KEY} -binary | base64`
+curl -sSo ${file_path} \
+ -H "Date: ${dateValue}" \
+ -H "Content-Type: ${contentType}" \
+ -H "Authorization: AWS ${ACCESS_KEY_ID}:${signature_hash}" \
+ "https://${server}/${bucket}/${file_path}"
+```
+## Usage
+1. Make the script executable:
+```bash
+chmod +x download-storage.sh
+```
+2. Set your storage credentials as environment variables:
+```bash
+export ACCESS_KEY_ID=your-access-key
+export SECRET_ACCESS_KEY=your-secret-key
+```
+3. Run the script:
+```bash
+./download-storage.sh my-bucket file.pdf
+```
+## Troubleshooting
+- **Permission Denied**: Check your `ACCESS_KEY_ID` and `SECRET_ACCESS_KEY`
+- **File Not Found**: Verify bucket name and file path
+- **Script Error**: Ensure the script has execute permissions
+
+----------------------------------------
+
+# Object Storage > How To > Delete
+
+## Delete Object storage service in Zerops GUI
+Go to the project dashboard and select the delete service menu item in the top right corner.
+
+## Delete Object storage using zCLI
+zCLI is the Zerops command-line tool. To delete the Object storage service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Object Storage > How To > Update Bucket
+
+Zerops creates one bucket automatically for each new Object storage service.
+:::note
+Each Object storage service can only contain one bucket. If your application needs multiple buckets, add more Object storage services.
+:::
+To change the bucket size or the access policy, go to the **Access & bucket details** in the Object service detail in Zerops GUI, scroll down and click on the **Configure bucket quota size and access policy** button.
+
+### Quota
+Set the bucket quota size in GB. The quota must be set manually. It can be changed later in Zerops GUI. Zerops doesn't support Object storage autoscaling. You can set the bucket quota from 1 to 100 GB.
+### Access policy
+Zerops creates one bucket automatically for each new Object storage service.
+:::note
+Each Object storage service can only contain one bucket. If your application needs multiple buckets, add more Object storage services.
+:::
+#### Name
+Bucket will be created with a name based on the given service name and a random prefix. The name of the bucket cannot be changed later.
+#### Access policy
+Select one of the basic policy templates:
+| Template | Description |
+| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Public read | Allows anyone:to read the bucket's location `(s3:GetBucketLocation)` to list all bucket's objects `(s3:ListBucket)` to get any object of the bucket `(s3:GetObject)` |
+| Public objects read | Allows anyone:to read the bucket's location `(s3:GetBucketLocation)` to get any object of the bucket `(s3:GetObject)` |
+| Public read write | Allows anyone:to read the bucket's location `(s3:GetBucketLocation)` to list all bucket's objects `(s3:ListBucket)` to get any object of the bucket `(s3:GetObject)` to create a new object in the bucket `(s3:PutObject,s3:ListMultipartUploadParts, s3:AbortMultipartUpload, s3:ListBucketMultipartUploads)` to delete any object of the bucket `(s3:DeleteObject)` |
+| Public write | Allows anyone to create objects in the bucket `(PutObject action)` |
+| Private | Denies the access to unauthenticated users. |
+| Private | Denies the access to unauthenticated users. |
+Or you can set your own access policy in the [IAM Policy JSON format](https://min.io/docs/minio/linux/administration/identity-access-management/policy-based-access-control.html#policy-document-structure).
+#### Example:
+```yaml
+{
+ 'Version': '2012-10-17',
+ 'Statement':
+ [
+ {
+ 'Effect': 'Allow',
+ 'Principal': { 'AWS': ['*'] },
+ 'Action': ['s3:GetBucketLocation', 's3:ListBucket'],
+ 'Resource': ['arn:aws:s3:::{{.BucketName}}'],
+ },
+ {
+ 'Effect': 'Allow',
+ 'Principal': { 'AWS': ['*'] },
+ 'Action': ['s3:GetObject'],
+ 'Resource': ['arn:aws:s3:::{{.BucketName}}/*'],
+ },
+ ],
+}
+```
+:::tip
+The `{{ .BucketName }}` variable will be replaced by the bucket name.
+:::
+
+----------------------------------------
+
+# Object Storage > Overview
+
+Zerops Object storage is powered by [MinIO ↗](https://min.io/), a high-performance, open-source S3 compatible object store. MinIO is built for large scale AI/ML, data lake and database workloads.
+## Feature Highlights
+## Popular Guides
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+
+----------------------------------------
+
+# Php > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing PHP application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](/php/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple PHP web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Php > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](/php/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](/php/how-to/build-pipeline#ports) `80`, simply use `http://app:80`
+:::info
+Do not use `https://` when communicating with PHP from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use PHP environment variables
+Zerops creates default environment variables for each PHP service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](/php/how-to/env-variables#generated-env-variables) of the PHP service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](/php/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your PHP application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access PHP application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/php/how-to/env-variables) are available when connected through VPN. To connect to your PHP application in Zerops set the hostname and [internal port](/php/how-to/build-pipeline#ports) e.g. http://app:80
+:::info
+Do not use `https://` when communicating with PHP over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your PHP service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your PHP service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/php/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Php > How To > Build Pipeline
+
+Zerops provides a customizable build and runtime environment for your PHP application.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: php-apache@latest
+ # OPTIONAL. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Build your application
+ buildCommands:
+ - composer install
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - vendor
+ - public
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ # cache: vendor
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: php-apache@latest
+ # OPTIONAL. Customize the runtime PHP environment by installing additional
+ # dependencies to the base PHP runtime environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your PHP application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # OPTIONAL. Customize the folder that will be used as the root of the publicly
+ # accessible web server content. Enter the path relative to the /var/www folder.
+ documentRoot: public
+ # OPTIONAL. Sets the custom Nginx or Apache configuration. The file must be deployed in
+ # the runtime container. Enter the path to the file relative to the /var/www folder
+ siteConfigPath: site_config.tmpl
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your PHP application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Build pipeline configuration
+### base
+_REQUIRED._ Sets the base technology for the build environment.
+Following options are available for PHP builds:
+```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
+ ...
+```
+ The base build environment contains {data.alpine.default}, the selected
+ major version of PHP, Zerops command line tool, `composer`, `git` and `wget`.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
+```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
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
+To customise your build environment use the [prepareCommands](/php/how-to/build-pipeline#preparecommands) attribute.
+:::note
+Modifying the base technology will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### os
+_OPTIONAL._ Sets the operating system for the build environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+:::note
+Changing the OS setting will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache behavior.
+:::
+### prepareCommands
+_OPTIONAL._ Customises the build environment by installing additional dependencies or tools to the base build environment.
+The base build environment contains:
+- {data.alpine.default}
+- selected version of PHP defined in the [base](/php/how-to/build-pipeline#base) attribute
+- [Zerops command line tool](/references/cli)
+- `composer`, `git` and `wget`
+To install additional packages or tools add one or more prepare commands:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: php-apache@latest
+ # OPTIONAL. Customise the build environment by installing additional packages
+ # or tools to the base build environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first build is triggered, Zerops will
+1. create a build container
+2. download your application code from your repository
+3. run the prepare commands in the defined order
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::note
+These commands are skipped when using cached environment. Modifying `prepareCommands` will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache invalidation.
+:::
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/php/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all prepare commands are finished, your custom build environment is ready for the build phase.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### buildCommands
+_REQUIRED._ Defines build commands.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: php-apache@latest
+ # REQUIRED. Build your application
+ buildCommands:
+ - composer install
+ ...
+```
+At least one command is required. Zerops triggers each command in the defined order in a dedicated build container.
+Before the build commands are triggered the build container contains:
+1. base environment defined by the [base](/php/how-to/build-pipeline#base) attribute
+2. optional customisation of the base environment defined in the [prepareCommands](/php/how-to/build-pipeline#preparecommands) attribute
+3. your application code
+#### Run build commands as a single shell instance
+Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it.
+```yaml
+buildCommands:
+ - |
+ composer install --optimize-autoloader --no-dev
+ php artisan env
+```
+#### Run build commands as a separate shell instances
+When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command.
+```yaml
+buildCommands:
+ - composer install --optimize-autoloader --no-dev
+ - php artisan env
+```
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/php/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the verbose option.
+```yaml
+buildCommands:
+ - composer install -v
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the deploy phase.
+### deployFiles
+_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
+```yaml
+# REQUIRED. Select which files / folders to deploy after
+# the build has successfully finished
+deployFiles:
+ - vendor
+ - public
+```
+Determines files or folders produced by your build, which should be deployed to your runtime service containers.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Examples
+Deploys a folder, and a file from the project root directory:
+```yaml
+deployFiles:
+ - public
+ - file.txt
+```
+Deploys the whole content of the build container:
+```yaml
+deployFiles: .
+```
+Deploys a folder, and a file in a defined path:
+```yaml
+deployFiles:
+ - ./path/to/file.txt
+ - ./path/to/dir/
+```
+#### How to use a wildcard in the path
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+Deploys all folders that are located in any path that begins with `/path/to/`
+```yaml
+deployFiles: ./path/to/~/
+```
+Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/
+```
+:::note Example
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+:::
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+_OPTIONAL._ Defines which files or folders will be cached for the next build.
+```yaml
+# OPTIONAL. Which files / folders you want to cache for the next build.
+# Next builds will be faster when the cache is used.
+cache: file.txt
+```
+The cache attribute helps optimize build times by preserving specified files between builds.
+The cache attribute supports the [~ wildcard character](#how-to-use-a-wildcard-in-the-path).
+Learn more about the [build cache system](/features/build-cache) in Zerops.
+### envVariables
+_OPTIONAL._ Defines the environment variables for the build environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ base: php-apache@latest
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ PHP_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/php/how-to/env-variables) in Zerops.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current PHP version for your runtime.
+Following options are available for PHP builds:
+```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
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the
+ selected major version of PHP, Zerops command line tool and `composer`, `git` and `wget`.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```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
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customise your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+:::info
+If no ports are specified, Zerops adds the port TCP 80 automatically.
+:::
+:::caution
+If you want the web server to listen on other port(s) than `:80`, you must [customize](/php/how-to/customize-web-server) your web server configuration as well.
+:::
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a PHP service with hostname = "app" and port = 80 from another service of the same project, simply use `app:80`. Read more about [how to access a PHP service](/php/how-to/access).
+:::info
+Do not use the port **:443**. All the incoming traffic is terminated on the Zerops internal balancer where the SSL certificate is installed and the request is forwarded to your PHP+Nginx / PHP+Apache service as a **http://** on the port **:80**.
+:::
+Each port has following attributes:
+
+ Parameter
+ Description
+
+ port
+ Defines the port number. You can set any port number between 10 and 65435. Ports outside this interval are reserved for internal Zerops systems.
+
+ protocol
+ Optional. Defines the protocol. Allowed values are TCP or UDP. Default value is TCP.
+
+ httpSupport
+ Optional. httpSupport = true is the default setting for TCP protocol. Set httpSupport = false if a web server isn't running on the port. Zerops uses this information for the configuration of public access. httpSupport = true is available only in combination with the TCP protocol.
+
+### prepareCommands
+_OPTIONAL._ Customises the PHP runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base PHP environment contains {data.alpine.default}, the selected
+ major version of PHP, Zerops command line tool and `composer`, `git` and `wget`. To install
+ additional packages or tools add one or more prepare commands:
+```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 PHP runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/php/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/php/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+
+When the prepare cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.default}, the
+ selected major version of PHP, Zerops command line tool and `composer`, `git` and `wget`.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare: ./runtime-config.yaml
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base PHP runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your PHP application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your PHP application is started.
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](/php/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](/php/how-to/build-pipeline#preparecommands-1) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](/php/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### documentRoot
+_OPTIONAL._ Customizes the folder that will be used as the root of the publicly accessible web server content.
+:::info
+By default, the document root is configured to `/var/www`.
+:::
+Customize the folder that will be used as the root of the publicly accessible web server content. Enter the path relative to the `/var/www` folder.
+E.g. `documentRoot: public` will set the web server document root to `/var/www/public`.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the folder that will be used as the root of the publicly
+ # accessible web server content. Enter the path relative to the /var/www folder.
+ documentRoot: public
+```
+### siteConfigPath
+_OPTIONAL._ Sets the custom Nginx or Apache configuration.
+:::info
+By default, the default [nginx](/php/how-to/customize-web-server#default-nginx-configuration) or [Apache](/php/how-to/customize-web-server#default-apache-configuration) web server configuration is set.
+:::
+The file must be deployed in the runtime container. Enter the path to the file relative to the `/var/www` folder.
+Read more about the [web server customization](/php/how-to/customize-web-server).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ PHP_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/php/how-to/env-variables) in Zerops.
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the folder that will be used as the root of the publicly
+ # accessible web server content. Enter the path relative to the /var/www folder.
+ documentRoot: public
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your PHP application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the folder that will be used as the root of the publicly
+ # accessible web server content. Enter the path relative to the /var/www folder.
+ documentRoot: public
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+### crontab
+_OPTIONAL._ Defines cron jobs.
+Setup cron jobs in the following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ crontab:
+ # REQUIRED. Sets the command to execute:
+ - command: ""
+ # REQUIRED. Sets the interval time to execute:
+ timing: "0 * * * *"
+```
+Read more about setting up [cron](/references/cron) in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](/php/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](/php/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your PHP application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](/php/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Php > How To > Build Process
+
+
+The build container is automatically deleted after the build has finished or failed.
+:::info
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::
+## Cancel running build
+To cancel an ongoing build:
+1. Go to service detail
+2. Select "Service dashboard & runtime containers"
+3. Click "Open pipeline detail"
+4. Click "Cancel build"
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+## Customize PHP build environment
+The default PHP build environment contains:
+- {data.alpine.default}
+- selected version of PHP defined in `zerops.yaml` [build.base](/php/how-to/build-pipeline#base) parameter
+- Git and Composer
+- [zCLI](/references/cli)
+:::note
+To use Ubuntu instead of the default Alpine, set the [build.os](/zerops-yaml/specification#os-) attribute.
+Additional packages and tools can be installed using [build.prepareCommands](/zerops-yaml/specification#preparecommands-).
+:::
+## PHP build hardware resources
+Build of your PHP application is run in a separate build container with following resource configuration:
+| HW resource | Minimum | Maximum |
+| ------------- | ------- | ------- |
+| **CPU cores** | 6 | 20 |
+| **RAM** | 8 GB | 8 GB |
+| **Disk** | 1 GB | 100 GB |
+| **Disk** | 1 GB | 100 GB |
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+## Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops will terminate the build pipeline and delete the build container.
+## Troubleshooting build-related problems
+### Failure of a build prepare command
+If any [prepare command](/php/how-to/build-pipeline#preparecommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/php/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom build environment is ready for the build phase.
+### Invalidate the build cache
+If you encounter unexpected build behavior or dependency issues, the problem might be related to [cached build data](/features/build-cache). While Zerops maintains the build cache to speed up deployments, sometimes you may need to start fresh.
+To invalidate the build cache:
+1. Go to your service detail in Zerops GUI
+2. Choose **Pipelines & CI/CD Settings** from the left menu
+3. Click on the **Invalidate build cache** button
+This will force Zerops to run the next build clean, including all prepare commands, which can help resolve cache-related issues. After invalidation, your next build will also create a fresh cache.
+### Failure of a build command
+If any [build command](/php/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/php/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `-v` verbose option.
+```yaml
+buildCommands:
+ - composer install -v
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the [deploy](/php/how-to/deploy-process) phase.
+
+----------------------------------------
+
+# Php > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart PHP service in Zerops GUI
+To stop the PHP service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped PHP service choose the **Start** item from the same menu.
+To restart the PHP service choose the **Restart** item from the same menu.
+## Stop and start PHP using zCLI
+zCLI is the Zerops command-line tool. To stop and start the PHP service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Php > How To > Create
+
+Zerops provides 2 PHP services with an included web server: **PHP+Nginx** and **PHP+Apache**. PHP runtime is highly scalable and customisable to suit both development and production.
+## Create PHP service using Zerops GUI
+First, set up a project in Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new PHP service:
+### Choose PHP version
+Following PHP versions are currently supported:
+:::info
+You can [change](/php/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app","cache", "gui" etc. Duplicate services with the same name in the same project are forbidden.
+#### Limitations:
+- maximum 25 characters
+- must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created. It can't be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as password, tokens, salts, certificates etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting the secret environment variables is optional. You can set them later in Zerops GUI.
+Read more about [different types of env variables](/php/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Set auto scaling configuration
+Zerops scales the PHP services automatically both vertically and horizontally. Vertical scaling means increasing or decreasing the hardware resources (CPU, RAM and disk) of a PHP container. Horizontal scaling adds or removes whole containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+PHP service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the PHP service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient PHP performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/php/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+:::info
+You can change the vertical auto scaling parameters later.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your PHP service. When your PHP service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ Parameter
+ Value
+
+ minimum containers
+ 1
+
+ maximum containers
+ 6
+
+PHP service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](/php/how-to/scaling) about PHP auto scaling.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Create PHP service using zCLI
+zCLI is the Zerops command-line tool. To create a new PHP service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/php/how-to/create#create-a-project-description-file)
+3. [Create a project with a PHP and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### Basic example:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in php-apache@{version} or php-nginx@{version} format
+ type: php-nginx@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one PHP version 8.1 service with default [auto scaling](/php/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/php/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a PHP and PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in php-apache@{version} or php-nginx@{version} format
+ type: php-nginx@latest
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create secret env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+ - # second service hostname
+ hostname: db
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain a PHP service and a [PostgreSQL](/postgresql/overview) service.
+PHP service with "app" hostname, the internal port(s) the service listens on will be defined later in the [zerops.yaml](/php/how-to/build-pipeline#ports). PHP service will run on version 8.1 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+ Limitations
+
+ name
+ The name of the new project. Duplicates are allowed.
+
+ description
+ Optional. Description of the new project.
+ Maximum 255 characters.
+
+ tags
+ Optional. One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects.
+
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains PHP and PostgreSQL services but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ The hostname of the new service will be set to the `hostname` value.
+
+ Limitations:
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [PHP service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+
+ All verticalAutoscaling attributes are optional. Not specified attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add PHP service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in php-apache@{version} or php-nginx@{version} format
+ type: php-nginx@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one PHP service version 8.1 with default [auto scaling](/php/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Php > How To > Customize Runtime
+
+The default PHP runtime environment contains:
+- {data.alpine.default}
+- Selected version of PHP when the runtime service was created
+- [zCLI](/references/cli)
+- Git and Composer
+:::note
+To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yaml/specification#os--1) attribute.
+Additional packages and tools can be installed using [run.prepareCommands](/zerops-yaml/specification#preparecommands--1).
+:::
+## Runtime Flow
+
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. Create a prepare runtime container
+2. Optionally: [copy selected folders or files from your build container](/php/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. Run the [run.prepareCommands](/zerops-yaml/specification#preparecommands--1) commands in the defined order
+## Command exit code
+Failed commands return non-zero exit codes and cancel deployment. Check [prepare runtime logs](/php/how-to/logs#prepare-runtime-log) for errors.
+Successful commands return exit code 0, triggering the next command. After all prepareCommands complete, the runtime environment is ready for deployment.
+The prepare runtime container is deleted once the phase completes or fails.
+## Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the build.addToRunPrepare and run.prepareCommands attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+### Clearing Zerops runtime cache
+1. Go to service detail
+2. Select "Service dashboard & runtime containers"
+3. Click "Open pipeline detail"
+4. Click "Clear runtime prepare cache"
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+### Overwrite php.ini files
+You can override PHP configuration directives by setting environment variables in your `zerops.yaml` file.
+Here's an example of how to adjust PHP's `post_max_size` directive:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: php-nginx@8.3
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ PHP_INI_post_max_size: 10M
+```
+
+----------------------------------------
+
+# Php > How To > Customize Web Server
+
+## PHP + Nginx
+### Default Nginx configuration
+The default PHP+Nginx service has following Nginx configuration:
+```
+server {
+ listen 80;
+ listen [::]:80;
+ server_name _;
+ # Be sure that you set up the correct document root!
+ root {{.DocumentRoot}};
+ location ~ \.php {
+ try_files _ @backend;
+ }
+ location / {
+ # use this for pretty url
+ try_files $uri /$uri /index.html /index.php$is_args$args;
+ }
+ location @backend {
+ fastcgi_pass unix:{{.PhpSocket}};
+ fastcgi_split_path_info ^(.+\.php)(/.*)$;
+ include fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
+ fastcgi_param DOCUMENT_ROOT $realpath_root;
+ internal;
+ }
+ access_log syslog:server=unix:/dev/log,facility=local1,tag=nginx,severity=info default_short;
+ error_log syslog:server=unix:/dev/log,facility=local1,tag=nginx,severity=error;
+}
+```
+The configuration contains 2 variables:
+- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yaml`. If the attribute is not specified, the default value `/var/www` is used.
+- **`{{.PhpSocket}}`** is replaced by a path to the PHP socket based on the PHP version.
+### Customize Nginx configuration
+Follow these steps to customize the Nginx configuration in PHP+Nginx service:
+1. Create a **.tmpl** file with the Apache configuration in your repository.
+2. Optionally use following variables:
+- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yaml`. If the attribute is not specified, the default value `/var/www` is used.
+Example:
+```
+root {{.DocumentRoot}};
+```
+- **`{{.PhpSocket}}`** is replaced by a path to the PHP socket based on the PHP version.
+Example:
+```
+fastcgi_pass unix:{{.PhpSocket}};
+```
+- **`{{.Environment.ENV_NAME}}`** is replaced by the [env variable](/php/how-to/env-variables) value. The env variable must be either defined in [run.envVariables](/php/how-to/build-pipeline#envvariables-1) in `zerops.yaml` or set as a [secret](/php/how-to/env-variables#set-secret-env-variables-in-zerops-gui) or [generated](/php/how-to/env-variables#generated-env-variables) env variable in Zerops GUI.
+:::caution
+Use the **.tmpl** file extension to make Zerops interpret the file as a template. Zerops will replace the supported variables listed above.
+:::
+3. Check that your Nginx configuration is consistent with Zerops requirements:
+- Do not use IP addresses in the `listen` directive
+- If you use other ports than `:80` in the `listen` directive, add them to the `run.ports` in your `zerops.yaml` as well.
+- Do not use the port **:443**. All the incoming `https://` traffic is terminated on the Zerops internal balancer where the SSL certificate is installed and the request is forwarded to your PHP+Nginx service as a **http://** on the port **:80**.
+4. Add the `siteConfigPath` to the run section of your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: php-nginx@latest
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - vendor
+ - public
+ # ==== how to run your application ====
+ run:
+ documentRoot: public
+ # OPTIONAL. Sets the custom Nginx or Apache configuration. The file must be deployed in the runtime container. Enter the path to the file relative to the /var/www folder
+ siteConfigPath: site_config.tmpl
+```
+5. Ensure that the `build.deployFiles` contains the folder with the `siteConfigPath` or add the path to the Nginx config file to the `deployFiles` list. Zerops will deploy the file to the runtime container(s).
+6. [Trigger]() the build & deploy pipeline.
+## PHP + Apache
+### Default Apache configuration
+The default PHP+Apache service has following Apache configuration:
+```
+ ServerName localhost
+ DocumentRoot {{.DocumentRoot}}
+ DirectoryIndex index.htm index.html index.shtml index.php index.phtml
+
+ Options -Indexes
+ Options FollowSymLinks
+ AllowOverride All
+ Require all granted
+
+ SetHandler "proxy:unix:{{.PhpSocket}}|fcgi://localhost/"
+
+ ErrorLog "| /usr/bin/logger -tapache -plocal1.err"
+ CustomLog "| /usr/bin/logger -tapache -plocal1.notice" combined
+```
+The configuration contains 2 variables:
+- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yaml`. If the attribute is not specified, the default value `/var/www` is used.
+- **`{{.PhpSocket}}`** is replaced by a path to the PHP socket based on the PHP version.
+### Customize Apache configuration
+Follow these steps to customize the Apache configuration in PHP+Apache service:
+1. Create a **.tmpl** file with the Nginx configuration in your repository.
+2. Optionally use following variables:
+- **`{{.DocumentRoot}}`** is replaced by the `run.documentRoot` attribute from the `zerops.yaml`. If the attribute is not specified, the default value `/var/www` is used.
+Example:
+```
+DocumentRoot {{.DocumentRoot}};
+```
+- **`{{.PhpSocket}}`** is replaced by a path to the PHP socket based on the PHP version.
+Example:
+```
+ SetHandler "proxy:unix:{{.PhpSocket}}|fcgi://localhost/"
+```
+- **`{{.Environment.ENV_NAME}}`** is replaced by the [env variable](/php/how-to/env-variables) value. The env variable must be either defined in [run.envVariables]() in `zerops.yaml` or set as a [secret](/php/how-to/env-variables#set-secret-env-variables-in-zerops-gui) or [generated](/php/how-to/env-variables#generated-env-variables) env variable in Zerops GUI.
+:::caution
+Use the **.tmpl** file extension to make Zerops interpret the file as a template. Zerops will replace the supported variables listed above.
+:::
+3. Check that your Apache configuration is consistent with Zerops requirements:
+- Do not use IP addresses in the `` directive
+- If you use other ports than `:80` in the `` directive, add them to the `run.ports` in your `zerops.yaml` as well.
+ Do not use the port **:443**. All the incoming `https://` traffic is terminated on the Zerops internal balancer where the SSL certificate is installed and the request is forwarded to your PHP+Apache service as a **http://** on the port **:80**.
+4. Add the `siteConfigPath` to the run section of your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: php-apache@latest
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - vendor
+ - public
+ # ==== how to run your application ====
+ run:
+ documentRoot: public
+ # OPTIONAL. Sets the custom Nginx or Apache configuration. The file must be deployed in the runtime container. Enter the path to the file relative to the /var/www folder
+ siteConfigPath: site_config.tmpl
+```
+5. Ensure that the `build.deployFiles` contains the folder with the `siteConfigPath` or add the path to the Apache config file to the `deployFiles` list. Zerops will deploy the file to the runtime container(s).
+6. [Trigger](/php/how-to/trigger-pipeline) the build & deploy pipeline.
+
+----------------------------------------
+
+# Php > How To > Delete
+
+## Delete PHP service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete PHP using zCLI
+zCLI is the Zerops command-line tool. To delete the PHP service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Php > How To > Deploy Process
+
+
+## Application artefact
+When the [build phase](/php/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](/php/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/php/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/php/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/php/how-to/build-pipeline#initcommands)
+4. Starts your application
+5. Optionally waits until the [readiness check](/php/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/php/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customize the runtime environment](/php/how-to/customize-runtime).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The PHP process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready as soon as it starts, configure a [readiness check](/php/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your PHP service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/php/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Php > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+
+ Type
+ Environment
+ Defined in
+
+ basic
+ build
+ zerops.yaml
+
+ basic
+ runtime
+ zerops.yaml
+
+ secret
+ runtime
+ Zerops GUI
+
+Use the [secret env variables](/php/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](/php/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/php/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](/php/how-to/create) a new PHP service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made to environment variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The PHP process running in the container receives the list env variables only when it starts. Update of the env variables while the PHP process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+These restrictions apply to all [types of env variables](/php/how-to/env-variables#types-of-env-variables-in-zerops).
+## Referencing other env variables
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your PHP runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the PHP service. The PHP process running in the container receives the list env variables only when it starts. Update of the env variables while the PHP process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a PHP service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your PHP app
+To access the local environment variable i.e. the variable set to this PHP service in your app, use:
+```sh
+getenv('YOUR_VARIABLE_KEY_HERE');
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+
+----------------------------------------
+
+# Php > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Php > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](/php/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](/php/how-to/build-pipeline#preparecommands-1) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the runtime containers in Zerops CLI use
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## PHP logging configuration
+Zerops logs all messages sent
+- to the standard error (`stderr`)
+- to the standard output (`stdout`)
+- via the PHP `var_dump` method
+### Severity level
+By default the `console.log` creates a message with the `Informational (6)` severity.
+Add a severity number in the `` format as a prefix to set a custom severity as shown below:
+// FIXME
+```php
+console.log('A message with the informational severity ...');
+console.log('Emergency (0) severity > system is unusable.');
+console.log('Alert (1) severity > action must be taken immediately.');
+console.log('Critical (2) severity > critical conditions.');
+console.log('Error (3) severity > error conditions.');
+console.log('Warning (4) severity > warning conditions.');
+console.log('Notice (5) severity > normal, but significant, condition.');
+console.log('Informational (6) severity > informational message.');
+console.log('Debug (7) severity > debug-level message.');
+```
+:::info
+`console.info`, `console.warn`, `console.debug`
+, and `console.error` are just aliases to the `
+ console.log
+` method. They don't set the appropriate severity number. Use the `
+ <N>
+` prefix instead. :::
+
+----------------------------------------
+
+# Php > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the PHP service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+PHP service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the PHP service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient PHP performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your PHP service. When your PHP service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+PHP service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each PHP service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the PHP service.
+### Not enough resources to scale up
+If one of the PHP containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the PHP service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor PHP resources
+Zerops provides information about how much hardware resources the PHP service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Php > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your PHP service directly when creating a new shared storage service. Just select your PHP service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the PHP service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create PHP service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new PHP service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/php/how-to/shared-storage#create-a-project-description-file)
+3. [Create a project with a PHP service and a shared storage](/php/how-to/shared-storage#create-a-project-with-a-php-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](/php/how-to/create#create-a-project-description-file) how to define the PHP service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a PHP and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in php-apache@8.1+2.4 format
+ type: php-apache@8.1+2.4
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the PHP service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with a PHP service and a shared storage
+Follow the article [How to create a project based on the description.yaml](/php/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Php > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](/php/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](/php/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](/php/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Php > How To > Upgrade
+
+You can upgrade or downgrade your PHP service to a different major PHP version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/php/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required PHP version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current PHP version for your runtime.
+If you want to build your application with a different major PHP version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
+
+----------------------------------------
+
+# Php > Overview
+
+[PHP ↗](https://www.php.net/), a popular general-purpose scripting language that is especially suited to web development.
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-php-hello-world), a **_recipe_**, containing the most simple PHP web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of PHP running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-php-hello-world/blob/main/import-project/description.yaml)):
+```yaml
+project:
+ name: my-first-project
+services:
+ - hostname: helloworld
+ type: php-apache@8.1+2.4
+ minContainers: 1
+ maxContainers: 3
+ buildFromGit: https://github.com/zeropsio/recipe-php-hello-world@main
+ enableSubdomainAccess: true
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://helloworld-24-8080.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+Hello, World!
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+## How to start
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Postgresql > Faq
+
+ Question: Why is my connection to PostgreSQL from third-party software failing?
+Answer:
+ *One possible cause:*
+ The connection string in Zerops always starts with `postgresql://`. While the official PostgreSQL documentation
+ states that both `postgresql://` and `postgres://` URIs are valid, some software requires the shorter `postgres://`
+ version.
+
+ To resolve this, create your own environment variable with the correct URI. For example, if your PostgreSQL service is named `db`, use the following format:
+
+ ```
+ postgres://${db_user}:${db_password}@${db_hostname}:${db_port}
+ ```
+
+
+----------------------------------------
+
+# Postgresql > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops by running a predefined application consisting of a PostgreSQL service and a runtime service that handles the SQL queries.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own PostgreSQL service, feel free to head straight to the [How to](/postgresql/how-to/create) section.
+## Guides
+We have created repositories, _recipes_, containing a simple web application and a PostgreSQL service, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Postgresql > How To > Connect
+
+This guide covers how to connect to your PostgreSQL database in Zerops, both from services within the same project and from outside the Zerops environment.
+## Connection Options Overview
+Zerops provides several ways to connect to PostgreSQL:
+1. **Internal connections** - Between services in the same Zerops project (via private network)
+2. **Remote connections**:
+ - **VPN access** - From your local machine via Zerops VPN
+ - **Direct IP access** - Enables external applications to connect using TLS encryption by opening public ports on IPv6 (available by default) or IPv4 (requires add-on activation if not already enabled)
+## Connection Details
+You'll find internal PostgreSQL connection details in two places in the Zerops GUI:
+1. Under the **Access details** button in the project dashboard
+2. In the service detail page under the **Peek access details** button
+### Connection Parameters
+
+ Parameter
+ Internal Connection
+ Direct IP Access (TLS)
+
+ Hostname/IP
+ Service hostname
+ Public IP address
+
+ Port
+ 5432
+ 6432
+
+ User
+ Identical to the service hostname
+ Same as internal
+
+ Password
+ Randomly generated during service creation
+ Same as internal
+
+ Port env variable
+ `port`
+ `portTls`
+
+ Connection string env variable
+ `connectionString`
+ `connectionTlsString`
+
+:::warning
+Zerops creates a system user named `zps` with full privileges for maintenance purposes. Do not delete, change the password, or remove privileges from this user, as it will disrupt Zerops' ability to maintain the database cluster.
+:::
+:::info
+For more information about default PostgreSQL setup, users, and databases, see [Manage PostgreSQL Users and Databases](/postgresql/how-to/manage).
+:::
+## Connect from Services in the Same Project
+All services within a Zerops project share a dedicated private network. There are two ways to implement connections between services in the same project:
+### Method 1: Direct Connection Parameters
+You can directly use the connection parameters from Access Details:
+```
+host = database1
+port = 5432
+user = database1
+password = ********** (find under Access Details)
+```
+### Method 2: Environment Variables (Recommended)
+For better maintainability, Zerops creates environment variables for each PostgreSQL service that you can use in your application configuration. List of service environment variables is available in Zerops GUI. Go to a PostgreSQL service detail and choose **Environment variables**.
+To use variables from one service in another, prefix the variable name with the service hostname and underscore - to access the `connectionString` variable of `postgresql1`, use `postgresql1_connectionString`.
+For more details on how to use environment variables, and instructions for adding your own custom variables, see the [Environment Variables](/features/env-variables) documentation.
+:::caution Important notes
+- When changing passwords, update both the database user password and the environment variable separately - they don't automatically synchronize.
+- While both `postgresql://` and `postgres://` URI formats are valid, Zerops uses the `postgresql://` format. If your software requires `postgres://`, create a custom environment variable with this format.
+- Do not use SSL/TLS protocols for internal connections. Security is assured by the project's private network.
+:::
+## Connect Remotely
+Zerops offers two methods for connecting to your PostgreSQL database from outside the Zerops environment:
+### Method 1: Connect via Zerops VPN
+You can securely connect to PostgreSQL from your local workstation via Zerops VPN:
+1. [Install & set up zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+3. Use the connection details from Access Details in the PostgreSQL service detail in Zerops GUI
+4. When finished, [stop the Zerops VPN](/references/vpn#stop-vpn)
+:::warning Important notes
+* Do not use SSL/TLS protocols when connecting over VPN. Security is provided by the VPN tunnel.
+* If your connection over VPN doesn't work, try adding `.zerops` suffix to the service hostname (e.g., `database1.zerops`). For additional help, check the [VPN troubleshooting page](/references/vpn/troubleshooting).
+:::
+### Method 2: Connect via Direct IP Access
+Direct IP Access uses [pgBouncer](https://www.pgbouncer.org/) for connection pooling and TLS termination.
+Internally, port `5432` is available without SSL. Externally, connections are secured with TLS through pgBouncer (port `6432`) before being routed to your PostgreSQL service.
+#### Enable external access
+1. Navigate to your PostgreSQL service in the Zerops GUI and choose the **Public Access through IP Addresses** section
+2. Choose either IPv6 (available by default) or IPv4 (requires the [unique IPv4](/features/access#dedicated-ipv4-address-330-days) add-on)
+3. Open one or more ports and point them to your PostgreSQL service (the system will direct them through pgBouncer)
+ - Choose any port from 10-65435 (except 80 and 443)
+ - Select destination service and internal port
+ - Each public port can be mapped to any internal service port
+ - Multiple public ports can point to the same internal port if needed
+ - Port configurations can be set independently for IPv4 and IPv6
+4. Optionally enable firewall protection for additional security
+5. Click the **Publish X IP access change(s)** button to apply your settings
+For database management tools and how to manage users and databases, see [Manage PostgreSQL Users and Databases](/postgresql/how-to/manage).
+
+----------------------------------------
+
+# Postgresql > How To > Control
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart PostgreSQL service in Zerops GUI
+To stop the PostgreSQL service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped PostgreSQL service choose the **Start** item from the same menu.
+To restart the PostgreSQL service choose the **Restart** item from the same menu.
+## Stop and start PostgreSQL using zCLI
+zCLI is the Zerops command-line tool. To stop and start the PostgreSQL service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Postgresql > How To > Create
+
+## Create PostgreSQL using Zerops GUI
+First, set up a project in Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new PostgreSQL service:
+
+ Parameter
+ Description
+ Limitations
+
+ hostname
+ A unique service identifier like `postgresql`,`sql`, `db` etc.
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+:::caution
+The hostname is fixed after the service is created. It can't be changed later.
+:::
+### Choose PostgreSQL service mode
+Zerops provides PostgreSQL service in two modes: **Highly available** and **Single container**.
+
+#### Highly available
+Creates a PostgreSQL cluster with **3 database containers** and **2 free database proxies**.
+This mode is suited for production.
+Zerops always keeps the 3 database containers on different physical machines. All your data is stored redundantly in 3 identical copies. In case of a container or the underlying physical machine failure, Zerops automatically disconnects the failed container from the cluster, creates a new container, and syncs all data from the remaining 2 copies. Finally, the broken container is automatically deleted.
+[Learn more](/postgresql/tech-details/cluster) about specific behaviour and technical limitations of the PostgreSQL cluster.
+#### Single container
+A PostgreSQL database installed in a single container is created. Useful for non-essential data or dev environments.
+:::caution
+Your data is stored only in a single container. If the container or the underlying physical machine fails, your data since the last backup is lost. Zerops doesn't provide any automatic repairs of single-node PostgreSQL services.
+:::
+:::info
+The PostgreSQL service mode is fixed after the service is created. It can't be changed later.
+:::
+### Choose PostgreSQL version
+Following PostgreSQL versions are currently supported:
+### Set auto-scaling configuration
+Zerops scales the PostgreSQL services automatically by raising or lowering the hardware resources of each database container.
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode, the power your application gets is dependent on other applications running on the same CPU core. In best case scenario your application gets 10/10 of CPU core power and 1/10 in the worst-case scenario.
+**Dedicated**
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto-scaling
+Vertical auto-scaling has the following default configuration:
+For most cases, the default parameters will work without issues. If you need to limit the cost of the PostgreSQL service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient PostgreSQL performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/postgresql/how-to/scaling#fine-tune-the-auto-scaling) the auto-scaling to fit your application needs.
+:::
+:::info
+You can change the auto-scaling parameters later.
+:::
+:::tip
+[Learn more](/postgresql/how-to/scale) about PostgreSQL auto-scaling.
+:::
+## Create PostgreSQL using zCLI
+zCLI is the Zerops command-line tool. To create a new PostgreSQL service via the command line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](#create-a-project-description-file)
+3. Create a project and a PostgreSQL service
+### Create a project description file
+Zerops uses a YAML format file to describe the project infrastructure.
+#### Basic example
+Create a directory `my-project`. Create a `description.yaml` file inside the directory with the following content:
+```yaml
+# Basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: postgresql1
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"NON_HA"
+ mode: NON_HA
+```
+The YAML file describes your future project infrastructure. The project will contain one PostgreSQL service in the [single container](#single-container) mode with default [auto scaling](/postgresql/how-to/scale) configuration. The hostname will be set to `postgresql1`.
+#### Full example
+Create a directory `my-project`. Create a `description.yaml` file inside the directory with the following content:
+```yaml
+# Basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # first service hostname
+ hostname: postgresql1
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"NON_HA"
+ mode: HA
+ # optional: vertical auto-scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ - # second service hostname
+ hostname: postgresql2
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The YAML file describes your future project infrastructure. The project will contain two PostgreSQL services.
+The hostname of the first service will be set to `postgresql1`. The [high availability](#highly-available) mode will be chosen and the custom [auto scaling configuration](/postgresql/how-to/scale) will be set.
+The hostname of the second service will be set to `postgresql2`. The [single container](#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/scale) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+ Limitations
+
+ name
+ The name of the new project. Duplicates are allowed.
+
+ description
+ Optional. Description of the new project.
+ Maximum 255 characters.
+
+ tags
+ Optional. One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects.
+
+At least one service in the `services:` section is required. You can create a project with multiple services. The example above contains only PostgreSQL services but you can create a `description.yaml` with [different types] of services.
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ The hostname of the new database will be set to the `hostname` value.
+
+ Limitations:
+
+- duplicate services with the same name in the same project are
+ forbidden
+
+ - maximum 25 characters
+
+- must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [PostgreSQL service types](/references/import-yaml/type-list#database-services) are currently supported.
+
+ mode
+
+ Defines the operation mode of the PostgreSQL service.
+
+ HA
+
+ Creates a PostgreSQL cluster with 3 database containers and 2 free
+ database proxies. This mode is suited for production.
+
+ Zerops always keeps the 3 database containers on different physical
+ machines. All your data is stored redundantly in 3 identical copies. In
+ case of a failure of a container or the underlying physical machine,
+ Zerops automatically disconnects the failed container from the cluster,
+ creates a new container and syncs all data from the remaining 2 copies.
+ Finally, the broken container is automatically deleted.
+
+ NON_HA
+
+ Zerops will create a PostgreSQL database installed in a single
+ container. Useful for non-essential data or dev environments.
+
+ Your data is stored only in a single container. If the container or the
+ the underlying physical machine fails, your data since the last backup are
+ lost. Zerops doesn't provide any automatic repairs of a single node
+ PostgreSQL services.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto-scaling parameters.
+ All verticalAutoscaling attributes are optional. Not specified
+ attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+:::caution
+The PostgreSQL service **hostname** and **mode** are fixed after the service is created. They can't be changed later.
+:::
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project will be created.
+ --workingDie string Sets a custom working directory. The default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+The maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add PostgreSQL service to an existing project
+#### Example
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```bash
+# array of project services
+services:
+ -
+ # service name
+ hostname: postgresql1
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"NON_HA"
+ mode: NON_HA
+```
+The YAML file describes the list of one or more services that you want to add to your existing project. In the example above, one PostgreSQL service in the [single container mode](#single-container) with default [auto scaling](/postgresql/how-to/scale) configuration will be added to your project. The hostname of the new service will be set to `postgresql1`.
+The content of the `services:` section of `import.yaml` is identical to the [project description file](#create-a-project-description-file). The `import.yaml` never contains the `project:` section because the project already exists.
+When your `import.yaml` is ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command will be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+The maximum size of the `import.yaml` file is 100 kB.
+
+----------------------------------------
+
+# Postgresql > How To > Delete
+
+## Delete PostgreSQL service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete PostgreSQL using zCLI
+zCLI is the Zerops command-line tool. To delete the PostgreSQL service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Postgresql > How To > Export Import Data
+
+## Use Adminer or phpMyAdmin to export or import data
+* [Adminer ↗](https://www.adminer.org) - an open source full-featured database management tool written in PHP
+* [phpMyAdmin ↗](https://www.phpmyadmin.net) - a free software tool written in PHP, intended to handle the administration of PostgreSQL over the Web
+1. [Install the tools to Zerops](/postgresql/how-to/manage#installing-management-tools)
+2. Use their standard export or import functions
+## Use a database management tool on your workstation to export or import data
+Do you already use a database management tool that supports PostgreSQL on your workstation? Connect it securely to PostgreSQL from your local workspace via Zerops VPN.
+Zerops VPN client is included into zCLI, the Zerops command-line tool. To start the VPN connection, read [how to connect to PostgreSQL remotely](/postgresql/how-to/connect#connect-remotely).
+:::caution
+Do not use SSL/TLS protocols when connecting to PostgreSQL over VPN. Zerops PostgreSQL is not configured to support these protocols. The security is assured by the VPN.
+:::
+Once the connection to PostgreSQL is established, use the standard export or import functions of your favourite management tool.
+## Use psql CLI to export or import data
+If you are using the [psql ↗](https://www.postgresql.org/docs/current/app-psql.html) command-line client to manage your PostgreSQL on your local workspace, you can connect it securely to PostgreSQL via Zerops VPN.
+Zerops VPN client is included into zCLI, the Zerops command-line tool. To start the VPN connection, read [how to connect to PostgreSQL remotely](/postgresql/how-to/connect#connect-remotely).
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/postgresql/how-to/connect#method-2-environment-variables-recommended) are available when connected through VPN. To connect to PostgreSQL in Zerops you have to copy the [access details](/postgresql/how-to/connect#connection-details) manually from Zerops GUI.
+Use [psql ↗](https://www.postgresql.org/docs/current/app-psql.html) command to connect to PostgreSQL in Zerops:
+```sh
+psql -h [hostname] -U [user] -p [password] -d [database_name]
+```
+:::caution
+Do not use SSL/TLS protocols when connecting to PostgreSQL over VPN. Zerops PostgreSQL is not configured to support these protocols. The security is assured by the VPN.
+:::
+To export your database data and structure, use the [pg_dump ↗](https://www.postgresql.org/docs/current/backup-dump.html) command.
+```sh
+pg_dump [database_name] > dumpfilename.sql
+```
+To import your database data and structure, use the `mysql` command.
+```sh
+mysql [database_name] < dumpfilename.sql
+```
+
+----------------------------------------
+
+# Postgresql > How To > Manage
+
+This guide covers how to manage your PostgreSQL databases in Zerops, including default setup, database management tools, plugins, and best practices.
+## Default Database and User
+Zerops creates a default database and user automatically when a new PostgreSQL service is [created](/postgresql/how-to/create).
+### Database
+- **Name**: Identical to the service hostname
+- **Encoding**: `utf8mb4`
+### DB User
+- **Username**: Identical to the service hostname
+- **Password**: Generated randomly
+:::info
+For connection methods and environment variables, see the [Connect to PostgreSQL in Zerops](/postgresql/how-to/connect) page.
+:::
+:::caution Important notes
+- When changing passwords, update both the database user password and the environment variable separately - they don't automatically synchronize.
+- While both `postgresql://` and `postgres://` URI formats are valid, Zerops uses the `postgresql://` format. If your software requires `postgres://`, create a custom environment variable with this format.
+- Do not use SSL/TLS protocols for internal connections. Security is assured by the project's private network.
+:::
+## Database Management Tools
+You can use any PostgreSQL management tool of your choice to administer your databases in Zerops. For convenience, Zerops provides ready-to-use recipes for two popular web-based database management tools:
+* [AdminerEvo](https://github.com/adminerevo/adminerevo) - developed by the AdminerEvo community and is a continuation of the [Adminer](https://www.adminer.org) project by Jakub Vrána
+* [phpMyAdmin](https://www.phpmyadmin.net) - a popular free database administration tool that works with both MySQL and PostgreSQL databases
+### Installing Management Tools
+You can install these tools with a simple one-click import in Zerops:
+1. In Zerops GUI, open your project and select **Import services** from the left menu
+2. Copy and paste one of the following YAML configurations:
+### Accessing Management Tools
+After installation, you can access these tools via VPN:
+1. [Start the Zerops VPN](/references/vpn)
+2. Type `http://adminerevo` or `http://phpmyadmin` in your browser
+:::tip
+Try `http://adminerevo.zerops` or `http://phpmyadmin.zerops` if you encounter any connection issues.
+:::
+:::caution
+Do not use https when connecting to management tools via VPN.
+:::
+## Database Tools on Your Workstation
+You can use various database management tools from your local workstation to connect to your PostgreSQL database in Zerops:
+1. **Establish a secure tunnel** using the [Zerops VPN](/references/vpn) to create an encrypted connection to your Zerops project
+2. **Obtain the [connection details](/postgresql/how-to/connect#connection-details)** from Zerops GUI
+ - Environment variables are not available through VPN connections
+3. Connect with your **preferred database tool**
+ - Do not use SSL/TLS (security is provided by the VPN)
+ - **Desktop Database Tools** - popular GUI tools like pgAdmin, DBeaver, DataGrip, or any other PostgreSQL-compatible client will work with Zerops
+ - **Command Line with psql** - connect using the standard PostgreSQL command-line client with the credential obtained above:
+ ```sh
+ psql -h [hostname] -U [user] -d [database_name]
+ ```
+:::tip
+ Try `{hostname}.zerops` instead of just `{hostname}` if you encounter any connection issues.
+:::
+## How to install and manage PostgreSQL plugins
+### Viewing available plugins
+You can list all available PostgreSQL plugins by running the following query *(superuser privileges not required)*:
+```sql
+SELECT * FROM pg_available_extensions ORDER BY name;
+```
+### Installing plugins (requires superuser)
+1. **Connect with superuser credentials**:
+ - Use the `superUser` (user `postgres`) and `superUserPassword` environment variables from your PostgreSQL service
+2. **Switch to your service database**:
+ When logging in as the superuser, you're initially in the `postgres` database, not your service database.
+3. **Install required extensions**:
+ ```sql
+ CREATE EXTENSION pg_stat_statements;
+ CREATE EXTENSION vector;
+ CREATE EXTENSION postgis;
+ ```
+:::warning
+Currently, it is not possible to add new plugins that are not already listed in `pg_available_extensions`.
+:::
+When working with text search functionality, you'll need to reference the correct `stop`, `dict`, and `affix` files when creating dictionaries in your database. These files are essential for proper text search configuration.
+Zerops PostgreSQL includes the following dictionary files:
+**Stop word files** - used to remove common words that don't add significant meaning:
+```
+czech.stop
+danish.stop
+dutch.stop
+english.stop
+finnish.stop
+french.stop
+german.stop
+hungarian.stop
+italian.stop
+nepali.stop
+norwegian.stop
+polish.stop
+portuguese.stop
+russian.stop
+slovak.stop
+spanish.stop
+swedish.stop
+turkish.stop
+```
+**Dictionary and affix files** - used for stemming and word normalization:
+```
+cs_CZ.affix
+cs_CZ.dict
+en_US.affix
+en_US.dict
+pl_PL.affix
+pl_PL.dict
+sk_SK.affix
+sk_SK.dict
+```
+**Special rules file:**
+```
+unaccent.rules
+```
+For more information on text search dictionaries, refer to the [PostgreSQL documentation](https://www.postgresql.org/docs/16/textsearch-dictionaries.html).
+
+----------------------------------------
+
+# Postgresql > How To > Scale
+
+Zerops performs an automated scaling of hardware resources required to run your database based on its usage. If the current use of your database does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your database is under heavy load or needs to store more data, then auto scaling increases the resources for the database to make sure it runs smoothly.
+## Configure auto scaling
+To change the auto scaling settings go to the PostgreSQL service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU Mode
+**Shared**
+Your database gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your database gets is depended on other applications running on the same CPU core. At best case scenario your database gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your database.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+For most cases, the default parameters will work without issues. If you need to limit the cost of the PostgreSQL service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient PostgreSQL performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/postgresql/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your database needs.
+:::
+:::tip
+[Learn more](/postgresql/how-to/scale) about PostgreSQL auto scaling.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your database starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your database.
+
+If your database doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+The default minimum free RAM is preset according to the database type and version. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your database need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the database is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each PostgreSQL service. Zerops will never scale above the entered values. If your database is in [highly available mode], maximal resources are identical for all containers of the PostgreSQL service.
+### Not enough resources to scale up
+Zerops moves a container between physical machines only if there are not enough resources on the current physical machine to scale the container up. When this happens the behaviour is different for [highly available](/postgresql/how-to/create#highly-available) and [single container](/postgresql/how-to/create#single-container) mode.
+### Automatic scale down
+When the database no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the database from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal scaling
+Zerops provides PostgreSQL service in two modes: [Highly available](/postgresql/how-to/create#highly-available) and [Single container](/postgresql/how-to/create#single-container). The PostgreSQL service mode is chosen when creating a new service and cannot be changed later.
+Zerops doesn't scale PostgreSQL service horizontally, it means no containers are added or removed from the database cluster. Only in case of a failure of a container or the underlying physical machine, Zerops automatically replaces the broken container with a new one.
+## Monitor database resources
+Zerops provides information about how much hardware resources the PostgreSQL service is currently using. Go to PostgreSQL service detail in Zerops GUI and select **Service dashboard & database containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Postgresql > Overview
+
+[PostgreSQL ↗](https://www.postgresql.org/) is a powerful, open source object-relational database system with over 35 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.
+## Feature Highlights
+### Connect to PostgreSQL service
+### Others
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Python > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing Python application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](/python/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple Python web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Python > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](/python/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](/python/how-to/build-pipeline#ports) `8000`, simply use `http://app:8000`
+:::info
+Do not use `https://` when communicating with Python from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use Python environment variables
+Zerops creates default environment variables for each Python service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](/python/how-to/env-variables#generated-env-variables) of the Python service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](/python/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your Python application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access Python application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/python/how-to/env-variables) are available when connected through VPN. To connect to your Python application in Zerops set the hostname and [internal port](/python/how-to/build-pipeline#ports) e.g. http://app:8000
+:::info
+Do not use `https://` when communicating with Python over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your Python service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your Python service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/python/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Python > How To > Build Pipeline
+
+Zerops provides a customizable build and runtime environment for your Python application.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: python@latest
+ # OPTIONAL. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - app.py
+ # OPTIONAL. Copy files from build container to runtime container.
+ addToRunPrepare:
+ - requirements.txt
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ # cache: file.txt
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: python@latest
+ # OPTIONAL. Sets the internal port(s) your app listens on:
+ ports:
+ # port number
+ - port: 8000
+ # OPTIONAL. Customize the runtime Python environment by installing additional
+ # dependencies to the base Python runtime environment.
+ # prepareCommands:
+ # - python3 -m pip install --ignore-installed -r requirements.txt
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Python application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # REQUIRED. Your Python application start command
+ start: python3 app.py
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your Python application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Build pipeline configuration
+### base
+_REQUIRED._ Sets the base technology for the build environment.
+Following options are available for Python builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: python@latest
+ ...
+```
+ The base build environment contains {data.alpine.default}, the selected
+ major version of Python, Zerops command line tool, `pip` and `git`.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base:
+ - python@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
+To customize your build environment use the [prepareCommands](/python/how-to/build-pipeline#preparecommands) attribute.
+:::note
+Modifying the base technology will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### os
+_OPTIONAL._ Sets the operating system for the build environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customized.
+:::
+:::note
+Changing the OS setting will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache behavior.
+:::
+### prepareCommands
+_OPTIONAL._ Customizes the build environment by installing additional dependencies or tools to the base build environment.
+The base build environment contains:
+- {data.alpine.default}
+- selected version of Python defined in the [base](/python/how-to/build-pipeline#base) attribute
+- [Zerops command line tool](/references/cli)
+- `pip` and `git`
+To install additional packages or tools add one or more prepare commands:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: python@latest
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ prepareCommands:
+ - apt install python3-pip # already installed for Python services
+ ...
+```
+When the first build is triggered, Zerops will
+1. create a build container
+2. download your application code from your repository
+3. run the prepare commands in the defined order
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::note
+These commands are skipped when using cached environment. Modifying `prepareCommands` will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache invalidation.
+:::
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/python/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all prepare commands are finished, your custom build environment is ready for the build phase.
+#### Run prepare commands as a single shell instance
+Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it.
+```yaml
+prepareCommands:
+ - |
+ apt update
+ apt install python3-pip # already installed for Python services
+```
+#### Run prepare commands as a separate shell instances
+When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command.
+```yaml
+prepareCommands:
+ - apt update
+ - apt install python3-pip # already installed for Python services
+```
+### deployFiles
+_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
+```yaml
+# REQUIRED. Select which files / folders to deploy after
+# the build has successfully finished
+deployFiles:
+ - app.py
+```
+Determines files or folders produced by your build, which should be deployed to your runtime service containers.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Examples
+Deploys a folder, and a file from the project root directory:
+```yaml
+deployFiles:
+ - app.py
+```
+Deploys the whole content of the build container:
+```yaml
+deployFiles: .
+```
+Deploys a folder, and a file in a defined path:
+```yaml
+deployFiles:
+ - ./path/to/file.txt
+ - ./path/to/dir/
+```
+#### How to use a wildcard in the path
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+Deploys all folders that are located in any path that begins with `/path/to/`
+```yaml
+deployFiles: ./path/to/~/
+```
+Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/
+```
+:::note Example
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+:::
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+_OPTIONAL._ Defines which files or folders will be cached for the next build.
+```yaml
+# OPTIONAL. Which files / folders you want to cache for the next build.
+# Next builds will be faster when the cache is used.
+cache: file.txt
+```
+The cache attribute helps optimize build times by preserving specified files between builds.
+The cache attribute supports the [~ wildcard character](#how-to-use-a-wildcard-in-the-path).
+Learn more about the [build cache system](/features/build-cache) in Zerops.
+### envVariables
+_OPTIONAL._ Defines the environment variables for the build environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ base: python@latest
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ PYTHON_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/python/how-to/env-variables) in Zerops.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current Python version for your runtime.
+Following options are available for Python builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: python@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: python@latest
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the
+ selected major version of Python, Zerops command line tool, `pip` and `git`.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: python@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base:
+ - python@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customize your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a Python service with hostname = "app" and port = 8000 from another service of the same project, simply use `app:8000`. Read more about [how to access a Python service](/python/how-to/access).
+Each port has following attributes:
+
+ Parameter
+ Description
+
+ port
+ Defines the port number. You can set any port number between 10 and 65435. Ports outside this interval are reserved for internal Zerops systems.
+
+ protocol
+ Optional. Defines the protocol. Allowed values are TCP or UDP. Default value is TCP.
+
+ httpSupport
+ Optional. httpSupport = true is the default setting for TCP protocol. Set httpSupport = false if a web server isn't running on the port. Zerops uses this information for the configuration of public access. httpSupport = true is available only in combination with the TCP protocol.
+
+### prepareCommands
+_OPTIONAL._ Customises the Python runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base Python environment contains {data.alpine.default}, the selected
+ major version of Python, Zerops command line tool, `pip` and `git`. To install additional packages or tools add one or more
+ prepare commands:
+```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 Python runtime environment.
+ prepareCommands:
+ - python3 -m pip install --ignore-installed -r requirements.txt
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/python/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/python/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+When the prepare cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build:prepareCommands](#preparecommands).
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.default} the
+ selected major version of Python, Zerops command line tool, `pip` and `git`.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare:
+ - requirements.txt
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base Python runtime environment.
+ prepareCommands:
+ - python3 -m pip install --ignore-installed -r requirements.txt
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Python application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your Python application is started via the [start command](/python/how-to/build-pipeline#start).
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](/python/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](/python/how-to/build-pipeline#preparecommands-1) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](/python/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances. The format is identical to [build:prepareCommands](#preparecommands).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ PYTHON_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/python/how-to/env-variables) in Zerops.
+### start
+_REQUIRED._ Defines the start command for your Python application.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Python application start command
+ start: app.py
+```
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Python application start command
+ start: app.py
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Python application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Python application start command
+ start: app.py
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+### crontab
+_OPTIONAL._ Defines cron jobs.
+Setup cron jobs in the following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ crontab:
+ # REQUIRED. Sets the command to execute:
+ - command: ""
+ # REQUIRED. Sets the interval time to execute:
+ timing: "0 * * * *"
+```
+Read more about setting up [cron](/references/cron) in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](/python/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](/python/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Python application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](/python/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Python > How To > Build Process
+
+
+## Description of the build process
+Zerops starts a temporary build container and performs following actions:
+1. Installs the build environment:
+ - Sets up base system and Go runtime
+ - Restores cached files if available (based on `build.cache` configuration)
+ - Validates cache against current `build.os`, `build.base`, and `build.prepareCommands`
+2. Downloads your application source code from [GitHub ↗](https://www.github.com), [GitLab ↗](https://www.gitlab.com) or via [Zerops CLI](/references/cli)
+3. Optionally [customizes the build environment](#customize-python-build-environment)
+4. Uploads the application artefact to the internal Zerops storage
+5. Preserves specified files for future builds (based on `build.cache` configuration)
+6. Optionally [customizes the runtime environment](/python/how-to/customize-runtime)
+7. [Deploys your application](/python/how-to/deploy-process)
+The build container is automatically deleted after the build has finished or failed.
+## Cancel running build
+When you know that the running build is not correct and you want to cancel it, you can do it in Zerops GUI. Go to the service detail, select **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Cancel build** button.
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+## Customize Python build environment
+The default Python build environment contains:
+- {data.alpine.default}
+- selected version of Python defined in `zerops.yaml` [build.base](/python/how-to/build-pipeline#base) parameter
+- [zCLI](/references/cli), Zerops command line tool
+- `pip` and `git`
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/python/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](/python/how-to/build-pipeline#preparecommands) commands to your `zerops.yaml`.
+:::info
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::
+## Python build hardware resources
+Build of your Python application is run in a separate build container with following resource configuration:
+| HW resource | Minimum | Maximum |
+| ------------- | ------- | ------- |
+| **CPU cores** | 6 | 20 |
+| **RAM** | 8 GB | 8 GB |
+| **Disk** | 1 GB | 100 GB |
+| **Disk** | 1 GB | 100 GB |
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+## Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops will terminate the build pipeline and delete the build container.
+## Troubleshooting build-related problems
+### Failure of a build prepare command
+If any [prepare command](/python/how-to/build-pipeline#preparecommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/python/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom build environment is ready for the build phase.
+### Invalidate the build cache
+If you encounter unexpected build behavior or dependency issues, the problem might be related to [cached build data](/features/build-cache). While Zerops maintains the build cache to speed up deployments, sometimes you may need to start fresh.
+To invalidate the build cache:
+1. Go to your service detail in Zerops GUI
+2. Choose **Pipelines & CI/CD Settings** from the left menu
+3. Click on the **Invalidate build cache** button
+This will force Zerops to run the next build clean, including all prepare commands, which can help resolve cache-related issues. After invalidation, your next build will also create a fresh cache.
+
+----------------------------------------
+
+# Python > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart Python service in Zerops GUI
+To stop the Python service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped Python service choose the **Start** item from the same menu.
+To restart the Python service choose the **Restart** item from the same menu.
+## Stop and start Python using zCLI
+zCLI is the Zerops command-line tool. To stop and start the Python service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Python > How To > Create
+
+Zerops provides a Python runtime service with extensive build support. Python runtime is highly scalable and customisable to suit both development and production.
+## Create Python service using Zerops GUI
+First, set up a project in Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new Python service:
+### Choose Python version
+Following Python versions are currently supported:
+:::info
+You can [change](/python/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app","cache", "gui" etc. Duplicate services with the same name in the same project are forbidden.
+#### Limitations:
+- maximum 25 characters
+- must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created. It can't be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as password, tokens, salts, certificates etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting the secret environment variables is optional. You can set them later in Zerops GUI.
+Read more about [different types of env variables](/python/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Set auto scaling configuration
+Zerops scales the Python services automatically both vertically and horizontally. Vertical scaling means increasing or decreasing the hardware resources (CPU, RAM and disk) of a Python container. Horizontal scaling adds or removes whole containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Python service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Python service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Python performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/python/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+:::info
+You can change the vertical auto scaling parameters later.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Python service. When your Python service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ Parameter
+ Value
+
+ minimum containers
+ 1
+
+ maximum containers
+ 6
+
+Python service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](/python/how-to/scaling) about Python auto scaling.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Create Python service using zCLI
+zCLI is the Zerops command-line tool. To create a new Python service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/python/how-to/create#create-a-project-description-file)
+3. [Create a project with a Python and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### Basic example:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in python@{version} format
+ type: python@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one Python version 3.12 service with default [auto scaling](/python/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/python/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Python and PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in python@{version} format
+ type: python@latest
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create secret env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+ - # second service hostname
+ hostname: db
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain a Python service and a [PostgreSQL](/postgresql/overview) service.
+Python service with "app" hostname, the internal port(s) the service listens on will be defined later in the zerops.yaml. Python service will run on version 3.12 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+ Limitations
+
+ name
+ The name of the new project. Duplicates are allowed.
+
+ description
+ Optional. Description of the new project.
+ Maximum 255 characters.
+
+ tags
+ Optional. One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects.
+
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains Python and PostgreSQL services but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ The hostname of the new service will be set to the `hostname` value.
+
+ Limitations:
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [Python service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+
+ All verticalAutoscaling attributes are optional. Not specified attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add Python service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in python@{version} format
+ type: python@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Python service version 3.12 with default [auto scaling](/python/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Python > How To > Customize Runtime
+
+
+The default Python runtime environment contains:
+- {data.alpine.default}
+- Selected version of Python when the runtime service was created.
+- [zCLI](/references/cli)
+- Git and PIP
+:::note
+To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yaml/specification#os--1) attribute.
+Additional packages and tools can be installed using [run.prepareCommands](/zerops-yaml/specification#preparecommands--1).
+:::
+## Runtime Flow
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. Create a prepare runtime container
+2. Optionally: [copy selected folders or files from your build container](/python/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. Run the run.prepareCommands in the defined order
+### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/python/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+The prepare runtime container is automatically deleted after the prepare runtime phase has finished or failed.
+### Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the build.addToRunPrepare and run.prepareCommands attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+
+----------------------------------------
+
+# Python > How To > Delete
+
+## Delete Python service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete Python using zCLI
+zCLI is the Zerops command-line tool. To delete the Python service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Python > How To > Deploy Process
+
+
+## Application artefact
+When the [build phase](/python/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](/python/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/python/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/python/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/python/how-to/build-pipeline#initcommands)
+4. Starts your application using the [start command](/python/how-to/build-pipeline#start)
+5. Optionally waits until the [readiness check](/python/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/python/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customize the runtime environment](/python/how-to/customize-runtime).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The Python process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready to handle requests right after it is started via the [start command](/python/how-to/build-pipeline#start), configure a [readiness check](/python/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your Python service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/python/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Python > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+
+ Type
+ Environment
+ Defined in
+
+ basic
+ build
+ zerops.yaml
+
+ basic
+ runtime
+ zerops.yaml
+
+ secret
+ runtime
+ Zerops GUI
+
+Use the [secret env variables](/python/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](/python/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/python/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](/python/how-to/create) a new Python service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made to environment variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The Python process running in the container receives the list env variables only when it starts. Update of the env variables while the Python process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+## Referencing other env variables
+These restrictions apply to all [types of env variables](/python/how-to/env-variables#types-of-env-variables-in-zerops).
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your Python runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the Python service. The Python process running in the container receives the list env variables only when it starts. Update of the env variables while the Python process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a Python service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your Python app
+Zerops passes all environment variables from all project services when your Python app is deployed and started.
+To access the local environment variable i.e. the variable set to this Python service in your app, use:
+```sh
+os.environ['YOUR_VARIABLE_KEY_HERE']
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+
+----------------------------------------
+
+# Python > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Python > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](/python/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](/python/how-to/build-pipeline#preparecommands-1) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the _first runtime container_ in Zerops CLI use
+```sh
+zcli service log
+```
+For an _aggregate log_ from all service's runtime containers omit the `@1`
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## Python logging configuration
+Zerops logs all messages sent
+- to the standard error (`stderr`)
+- to the standard output (`stdout`)
+- via the Python `print` or `logger.Info` methods
+### Severity level
+By default the `print` or `logger.XXX` methods create a message with the `Informational (6)` severity.
+Add a severity number in the `` format as a prefix to set a custom severity as shown below:
+```python
+import logging
+logger = logging.getLogger(__name__)
+logger.Info('A message with the informational severity ...')
+logger.Info('Emergency (0) severity > system is unusable.')
+logger.Info('Alert (1) severity > action must be taken immediately.')
+logger.Info('Critical (2) severity > critical conditions.')
+logger.Info('Error (3) severity > error conditions.')
+logger.Info('Warning (4) severity > warning conditions.')
+logger.Info('Notice (5) severity > normal, but significant, condition.')
+logger.Info('Informational (6) severity > informational message.')
+logger.Info('Debug (7) severity > debug-level message.')
+```
+:::info
+`logger.Info`, `logger.Warning`, `logger.Debug`
+, `logger.Error` and `logger.Critical` are just aliases to
+the `logger.Info` method. They don't set the appropriate severity
+number. Use the `<N>` prefix instead. :::
+
+----------------------------------------
+
+# Python > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the Python service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Python service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Python service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Python performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/python/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Python service. When your Python service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Python service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each Python service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the Python service.
+### Not enough resources to scale up
+If one of the Python containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the Python service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor Python resources
+Zerops provides information about how much hardware resources the Python service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Python > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your Python service directly when creating a new shared storage service. Just select your Python service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the Python service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create Python service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new Python service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/python/how-to/shared-storage#create-a-project-description-file)
+3. [Create a project with a Python service and a shared storage](/python/how-to/shared-storage#create-a-project-with-a-python-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](/python/how-to/create#create-a-project-description-file) how to define the Python service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Python and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in python@{version} format
+ type: python@latest
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the Python service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with a Python service and a shared storage
+Follow the article [How to create a project based on the description.yaml](/python/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Python > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](/python/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](/python/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](/python/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Python > How To > Upgrade
+
+You can upgrade or downgrade your Python service to a different major Python version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/python/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Python version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Python version for your runtime.
+If you want to build your application with a different major Python version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
+
+----------------------------------------
+
+# Python > Overview
+
+[Python ↗](https://www.python.org/) is a programming language that lets you work quickly and integrate systems more effectively..
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-python-hello-world), a **_recipe_**, containing the most simple Python web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of Python running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-python-hello-world/blob/main/import-project/description.yaml)):
+```yaml
+project:
+ name: my-first-project
+services:
+ - hostname: helloworld
+ type: python@latest
+ minContainers: 1
+ maxContainers: 3
+ buildFromGit: https://github.com/zeropsio/recipe-python-hello-world@main
+ enableSubdomainAccess: true
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://helloworld-24-8080.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+Hello, World!
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+## How to start
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Python > Tutorial > Quickstart
+
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-python-hello-world), a **_recipe_**, containing the most simple Python web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of Python running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-python-hello-world/blob/main/import-project/description.yaml)):
+```yaml
+project:
+ name: my-first-project
+services:
+ - hostname: helloworld
+ type: python@latest
+ minContainers: 1
+ maxContainers: 3
+ buildFromGit: https://github.com/zeropsio/recipe-python-hello-world@main
+ enableSubdomainAccess: true
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://helloworld-24-8080.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+Hello, World!
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Python > Tutorial > Runtime Sql
+
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-onboarding-python), a **_recipe_**, containing a PostgreSQL service with a simple Python application. The repo will be used as a source from which the app will be built.
+:::tip
+Follow the steps below and when everything is working as expected, fork the repo, try making various changes or be bold and connect your own.
+:::
+:::note
+In the detail of each step, you can find a link with more information about the topic.
+:::
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+ 2. Create a project.
+
+ Learn more about projects in
+ Zerops. See how to import a whole project into Zerops.
+
+ 3. In the left menu, click on Import services, copy & paste the
+ contents of the `import-services.yaml` config file from the recipe
+ repository of your choice. Then click on Import service.
+
+ Learn more about services in Zerops and how to import a service to an existing project.
+
+ The yaml file includes a `buildFromGit` directive, which ensures
+ a one-time build from Git repository source. See how to connect a Github or Gitlab repository to be able to
+ trigger automatic builds & deploys.
+
+ 4. Several pipelines are created, one for project creation and the rest for the activation of the services. Wait for all to finish.
+
+ Learn more about how the pipelines can be triggered and about build and deploy processes of a Python application in Zerops.
+Learn more about how to access build log of your Python service in Zerops.
+
+ 5. In the service detail, open the Public access & internal ports section, and Enable Zerops Subdomain.
+
+ Learn more about how to access your
+ Python service in Zerops.
+
+ 6. Once the pipeline has finished, click on the activated subdomain URL. You should see a simple page with
+`Entry added successfully with random data: f47ac10b-58cc-0372-8567-0e02b2c3d479. Total count: 1`
+
+ Congratulations! You have created your first application in Zerops, and we hope to see your own projects soon.
+For now, check out other features, such as environment variables, runtime log and scaling.
+
+ 7. One of the services is `adminer`, a database management tool.
+ See how to access it.
+
+ Learn more about how to use psql command-line tool instead or how to import and export data from your database.
+
+8. Feel free to make any changes to your project, fork the repo or connect your
+own. Also see other
+ Python
+ and
+ PostgreSQL
+ recipes on our Github page.
+
+:::tip
+Have you got any additional question? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Python > Tutorial > Step By Step
+
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-python-hello-world), a **_recipe_**, containing the most simple Python web application. The repo will be used as a source from which the app will be built.
+:::tip
+Follow the steps below and when everything is working as expected, fork the repo, try making various changes or be bold and connect your own.
+:::
+:::note
+In the detail of each step, you can find a link with more information about the topic.
+:::
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+ 2. Create a project.
+
+ Learn more about projects in
+ Zerops. See how to import a whole project into Zerops.
+
+ 3. In the left menu, click on Import services, copy & paste the
+ contents of this yaml file and click on Import service.
+
+ Learn more about services in
+ Zerops and how to import a service to an existing project.
+
+ The yaml file includes a `buildFromGit` directive, which ensures
+ a one-time build from Git repository source. See how to connect a Github or Gitlab repository to be able to
+ trigger automatic builds & deploys.
+
+ 4. Two pipelines are created, one for project creation and one for the service activation. Wait for both to finish.
+
+ Learn more about how the pipelines can be triggered and about build and deploy processes of a Python application in Zerops.
+Learn more about how to access build log of your Python service in Zerops.
+
+ 5. In the service detail, open the Public access & internal ports section, and Enable Zerops Subdomain.
+
+ Learn more about how to access your
+ Python service in Zerops.
+
+ 6. Once the pipeline has finished, click on the activated subdomain URL:
+ You should see a simple page with `Hello World!` printed.
+
+ Congratulations! You have created your first application in Zerops, and we hope to see your own projects soon.
+For now, check out other features, such as environment variables, runtime log and scaling.
+
+7. Feel free to make any changes to your project, fork the repo or connect your own. Also see other Python recipes on our Github page.
+
+:::tip
+Have you got any additional question? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Qdrant > Overview
+
+[Qdrant](https://qdrant.tech/) on Zerops provides a fully managed vector database solution designed for AI applications. Focus on building vector search features while we handle infrastructure maintenance, high availability, and data protection.
+## Supported Versions
+Currently supported Qdrant versions:
+Import configuration version:
+## Deployment Modes
+#### Non-HA Mode
+- Single node setup ideal for development and non-production projects
+- Simple deployment and management
+#### HA Cluster
+- Automatically configured with 3 nodes
+- Recommended for production environments
+- Built-in data replication across nodes
+- By default (`automaticClusterReplication=true`), automatically creates replicas of all shards across all three nodes
+ - Can be disabled by setting `automaticClusterReplication` to `false`
+- Automatic cluster recovery and node replacement in case of failures
+## Data Backup
+Backups are performed in `snapshot` format. For HA Cluster, backups are created on the primary container (leader) and saved to the local disk before being compressed and streamed to backup storage. The local file is then deleted.
+For general information about backup frequency and storage limits, see our [Backup documentation](/features/backup).
+## Network Architecture & Access
+Qdrant can be accessed only from services within the same project, public access is not available.
+### API Keys
+API key authentication is required for both HTTP and gRPC API calls. Include the key in your request headers. The keys can be found in generated environment variables of the service:
+- **API Key:** Full access API key for administrative operations (creating collections, indexing)
+- **Read-only API Key:** Restricted API key for search operations
+#### HTTP API
+- **Port:** `6333`
+- **Connection String:** `http://${hostname}:${port}`
+#### gRPC API
+- **Port:** `6334`
+- **gRPC Connection String:** `tcp://${hostname}:${grpcPort}`
+## Support
+For advanced configurations or custom requirements:
+- Join our [Discord community](https://discord.gg/zeropsio)
+- Contact support via [email](mailto:support@zerops.io)
+
+----------------------------------------
+
+# Rust > Getting Started
+
+This quick start allows you to get hands-on experience of Zerops, whether you only want to see it in action or want to start small and scale up the project size later. The purpose of this guide is to get an existing Rust application up and running easily.
+If you are already familiar with Zerops and you are interested in more detailed guides for your own application, feel free to head straight to the [How to](/rust/how-to/create) section.
+## Guides
+We have created a repository, a _recipe_, containing the most simple Rust web application, so you don't need to write any code yet. Choose from the options below which suits you best:
+### Other recipes
+:::tip
+Did none of these Guides fit your needs? Join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+
+----------------------------------------
+
+# Rust > How To > Access
+
+## Private internal access
+Projects in Zerops represent a group of one or more services.
+Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its [internal port](/rust/how-to/build-pipeline#ports).
+To connect to your application with `app` hostname running on [internal port](/rust/how-to/build-pipeline#ports) `8080`, simply use `http://app:8080`
+:::info
+Do not use `https://` when communicating with Rust from other runtime services in the same project. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Use Rust environment variables
+Zerops creates default environment variables for each Rust service to help you with connection within the same project. To avoid the need to copy the access parameters manually, use [generated environment variables](/rust/how-to/env-variables#generated-env-variables) of the Rust service.
+#### Prefix the environment variable key
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Example:
+To access the `API_TOKEN` env variable of the `app` service, use `app_API_TOKEN` as the env variable key.
+Read more about [env variables](/rust/how-to/env-variables).
+## Private access via VPN
+### Start VPN connection
+You can securely connect to your Rust application from your local workspace via Zerops VPN. Zerops VPN client is included into zCLI, the Zerops command-line tool. To start a VPN connection to the selected Zerops project, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Start the Zerops VPN](/references/vpn#start-vpn)
+### Access Rust application through VPN
+Once the VPN session is established, you have the secured connection to the project's private network in Zerops. You can access all project services locally by using their hostname. The only difference is that no [environment variables](/rust/how-to/env-variables) are available when connected through VPN. To connect to your Rust application in Zerops set the hostname and [internal port](/rust/how-to/build-pipeline#ports) e.g. http://app:8080
+:::info
+Do not use `https://` when communicating with Rust over the VPN. The security is assured by the VPN. The internal communication is done over a private network and is isolated from other projects.
+:::
+### Connect via SSH
+Use the `ssh` command to connect to your service via SSH.
+### Stop VPN connection
+[Stop the Zerops VPN](/references/vpn#stop-vpn) in zCLI.
+## Public access through zerops.io subdomain
+By default, your Rust service is not publicly accessible. To test your application, enable the [public access through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain).
+## Public access through your domain
+By default, your Rust service is not publicly accessible. When your application is ready for production or if you want to test it on the production domain, [configure the public access through your domain](/features/access#public-access-through-your-domain).
+## Public access from another Zerops project
+All services of the same project share a dedicated private network. To connect to a service within the same project, just use the service hostname and its [internal port](/rust/how-to/build-pipeline#ports). Different projects are not connected inside Zerops. To connect to a runtime service from another Zerops project, you need to use public access either [through zerops.io subdomain](/features/access#public-access-through-zerops-subdomain) or [through your domain](/features/access#public-access-through-your-domain).
+
+----------------------------------------
+
+# Rust > How To > Build Pipeline
+
+Zerops provides a customizable build and runtime environment for your Rust application.
+## Add zerops.yaml to your repository
+Start by adding `zerops.yaml` file to the **root of your repository** and modify it to fit your application:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: rust@latest
+ # OPTIONAL. Set the operating system for the build environment.
+ # os: ubuntu
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # REQUIRED. Build your application
+ buildCommands:
+ - cargo b --release
+ # REQUIRED. Select which files / folders to deploy after
+ # the build has successfully finished
+ deployFiles:
+ - target/release/~app
+ # OPTIONAL. Which files / folders you want to cache for the next build.
+ # Next builds will be faster when the cache is used.
+ # cache: file.txt
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: rust@latest
+ # OPTIONAL. Sets the internal port(s) your app listens on:
+ ports:
+ # port number
+ - port: 8080
+ # OPTIONAL. Customize the runtime Rust environment by installing additional
+ # dependencies to the base Rust runtime environment.
+ # prepareCommands:
+ # - apt-get something
+ # - curl something else
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Rust application is started.
+ # initCommands:
+ # - rm -rf ./cache
+ # REQUIRED. Your Rust application start command
+ start: ./app
+```
+The top-level element is always `zerops`.
+### Setup
+The first element `setup` contains the **hostname** of your service. A runtime service with the same hostname must exist in Zerops.
+Zerops supports the definition of multiple runtime services in a single `zerops.yaml`. This is useful when you use a monorepo. Just add multiple setup elements in your `zerops.yaml`:
+```yaml
+zerops:
+ # definition for app service
+ - setup: app
+ build: ...
+ run: ...
+ # definition for api service
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration contains at least two sections: **build** and **run**. Both sections are required to build and deploy your Rust application in Zerops. If you'd like to use a readiness check, add an optional **deploy** section.
+## Build pipeline configuration
+### base
+_REQUIRED._ Sets the base technology for the build environment.
+Following options are available for Rust builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: rust@latest
+ ...
+```
+ The base build environment contains {data.alpine.default}, the selected
+ major version of Rust, Zerops command line tool, `npm` , `yarn`, `git` and `npx` tools.
+:::info
+You can change the base environment when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+If you need to install more technologies to the build environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base:
+ - rust@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [build base environments](/zerops-yaml/base-list#runtime-services).
+To customize your build environment use the [prepareCommands](/rust/how-to/build-pipeline#preparecommands) attribute.
+:::note
+Modifying the base technology will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### os
+_OPTIONAL._ Sets the operating system for the build environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customized.
+:::
+:::note
+Modifying the OS will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for more details about cache invalidation.
+:::
+### prepareCommands
+_OPTIONAL._ Customizes the build environment by installing additional dependencies or tools to the base build environment.
+The base build environment contains:
+- {data.alpine.default}
+- selected version of Rust defined in the [base](/rust/how-to/build-pipeline#base) attribute
+- [Zerops command line tool](/references/cli)
+- `npm`, `yarn`, `git` and `npx` tools
+To install additional packages or tools add one or more prepare commands:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: rust@latest
+ # OPTIONAL. Customize the build environment by installing additional packages
+ # or tools to the base build environment.
+ prepareCommands:
+ - cargo b --release
+ ...
+```
+When the first build is triggered, Zerops will
+1. create a build container
+2. download your application code from your repository
+3. run the prepare commands in the defined order
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::note
+These commands are skipped when using cached environment. Modifying `prepareCommands` will invalidate your build cache. See our [Build Cache Documentation](/features/build-cache) for details about cache invalidation.
+:::
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/rust/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all prepare commands are finished, your custom build environment is ready for the build phase.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### buildCommands
+_REQUIRED._ Defines build commands.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Set the base technology for the build environment:
+ base: rust@latest
+ # REQUIRED. Build your application
+ buildCommands:
+ - cargo b --release
+ ...
+```
+At least one command is required. Zerops triggers each command in the defined order in a dedicated build container.
+Before the build commands are triggered the build container contains:
+1. base environment defined by the [base](/rust/how-to/build-pipeline#base) attribute
+2. optional customisation of the base environment defined in the [prepareCommands](/rust/how-to/build-pipeline#preparecommands) attribute
+3. your application code
+#### Run build commands as a single shell instance
+Use following syntax to run all commands in the same environment context. For example, if one command changes the current directory, the next command continues in that directory. When one command creates an environment variable, the next command can access it.
+```yaml
+buildCommands:
+ - |
+ cargo b --release
+```
+#### Run build commands as a separate shell instances
+When the following syntax is used, each command is triggered in a separate environment context. For example, each shell instance starts in the home directory again. When one command creates an environment variable, it won't be available for the next command.
+```yaml
+buildCommands:
+ - cargo b --release
+```
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/rust/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the --verbose option.
+```yaml
+buildCommands:
+ - cargo b --release
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the deploy phase.
+### deployFiles
+_REQUIRED._ Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files or folders, use `.deployignore` file.
+```yaml
+# REQUIRED. Select which files / folders to deploy after
+# the build has successfully finished
+deployFiles:
+ - target/release/~app
+```
+Determines files or folders produced by your build, which should be deployed to your runtime service containers.
+The path starts from the **root directory** of your project (the location of `zerops.yaml`). You must enclose the name in quotes if the folder or the file name contains a space.
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Examples
+Deploys a folder, and a file from the project root directory:
+```yaml
+deployFiles:
+ - target/release/~app
+```
+Deploys the whole content of the build container:
+```yaml
+deployFiles: .
+```
+Deploys a folder, and a file in a defined path:
+```yaml
+deployFiles:
+ - ./path/to/file.txt
+ - ./path/to/dir/
+```
+#### How to use a wildcard in the path
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+Deploys all folders that are located in any path that begins with `/path/to/`
+```yaml
+deployFiles: ./path/to/~/
+```
+Deploys all folders that are located in any path that begins with `/path/` and ends with `/to/`
+```yaml
+deployFiles: ./path/~/to/
+```
+:::note Example
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+:::
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+_OPTIONAL._ Defines which files or folders will be cached for the next build.
+```yaml
+# OPTIONAL. Which files / folders you want to cache for the next build.
+# Next builds will be faster when the cache is used.
+cache: file.txt
+```
+The cache attribute helps optimize build times by preserving specified files between builds.
+The cache attribute supports the [~ wildcard character](#how-to-use-a-wildcard-in-the-path).
+Learn more about the [build cache system](/features/build-cache) in Zerops.
+### envVariables
+_OPTIONAL._ Defines the environment variables for the build environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ base: rust@latest
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ RUST_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/rust/how-to/env-variables) in Zerops.
+## Runtime configuration
+### base
+_OPTIONAL._ Sets the base technology for the runtime environment.
+If you don't specify the `run.base` attribute, Zerops keeps the current Rust version for your runtime.
+Following options are available for Rust builds:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: rust@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base: rust@latest
+ ...
+```
+ The base runtime environment contains {data.alpine.default}, the
+ selected major version of Rust, Zerops command line tool, npm, yarn, git and
+ npx tools.
+:::info
+You can change the base environment when you need to. Just simply modify the zerops.yaml in your repository.
+:::
+If you need to install more technologies to the runtime environment, set multiple values as a yaml array. For example:
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ # REQUIRED. Sets the base technology for the build environment:
+ base: rust@latest
+ ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Sets the base technology for the runtime environment:
+ base:
+ - rust@latest
+ prepareCommands:
+ - zsc add go@latest
+ ...
+```
+See the full list of supported [run base environments](/zerops-yaml/base-list).
+To customize your build environment use the `prepareCommands` attribute.
+### os
+_OPTIONAL._ Sets the operating system for the runtime environment.
+Following options are available:
+- `alpine`
+- `ubuntu`
+Default value is `alpine`.
+We are currently using following os version:
+- {data.alpine.default}
+- {data.ubuntu.default}
+:::caution
+The os version is fixed and cannot be customised.
+:::
+### ports
+_OPTIONAL._ Specifies one or more internal ports on which your application will listen.
+Projects in Zerops represent a group of one or more services. Services can be of different types (runtime services, databases, message brokers, object storage, etc.). All services of the same project share a **dedicated private network**. To connect to a service within the same project, just use the service hostname and its internal port.
+For example, to connect to a Rust service with hostname = "app" and port = 8080 from another service of the same project, simply use `app:8080`. Read more about [how to access a Rust service](/rust/how-to/access).
+Each port has following attributes:
+
+ Parameter
+ Description
+
+ port
+ Defines the port number. You can set any port number between 10 and 65435. Ports outside this interval are reserved for internal Zerops systems.
+
+ protocol
+ Optional. Defines the protocol. Allowed values are TCP or UDP. Default value is TCP.
+
+ httpSupport
+ Optional. httpSupport = true is the default setting for TCP protocol. Set httpSupport = false if a web server isn't running on the port. Zerops uses this information for the configuration of public access. httpSupport = true is available only in combination with the TCP protocol.
+
+### prepareCommands
+_OPTIONAL._ Customises the Rust runtime environment by installing additional dependencies or tools to the runtime base environment.
+ The base Rust environment contains {data.alpine.default}, the selected
+ major version of Rust, Zerops command line tool and `npm` , `yarn`, `git` and `npx` tools. To install additional packages or tools add one or
+ more prepare commands:
+```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 Rust runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+When the first deploy with a defined prepare attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/rust/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the `prepareCommands` commands in the defined order
+#### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/rust/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+#### Cache of your custom runtime environment
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the [build.addToRunPrepare](#copy-folders-or-files-from-your-build-container) and `run.prepareCommands` attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+
+When the prepare cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+#### Single or separated shell instances
+You can configure your prepare commands to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### Copy folders or files from your build container
+ The prepare runtime container contains {data.alpine.default}, the
+ selected major version of Rust, Zerops command line tool and `npm`, `yarn`, `git` and `npx` tools.
+The prepare runtime container does not contain your application code nor the built application. If you need to copy some folders or files from the build container to the runtime container (e.g. a configuration file) use the `addToRunPrepare` attribute in the [build section](#build-pipeline-configuration).
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ ...
+ addToRunPrepare: ./runtime-config.yaml
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Customise the runtime environment by installing additional packages
+ # or tools to the base Rust runtime environment.
+ prepareCommands:
+ - apt-get something
+ - curl something else
+ ...
+```
+In the example above Zerops will copy the `runtime-config.yaml` file from your build container **after the build has finished** into the new **prepare runtime** container. The copied files and folders will be available in the `xxx` folder in the new prepare runtime container before the prepare commands are triggered.
+### initCommands
+_OPTIONAL._ Defines one or more commands to be run each time a new runtime container is started or a container is restarted.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Run one or more commands each time a new runtime container
+ # is started or restarted. These commands are triggered before
+ # your Rust application is started.
+ initCommands:
+ - rm -rf ./cache
+```
+These commands are triggered in the runtime container before your Rust application is started via the [start command](/rust/how-to/build-pipeline#start).
+Use init commands to clean or initialise your application cache or similar operations.
+:::caution
+The init commands will delay the start of your application each time a new runtime container is started (including the [horizontal scaling](/rust/how-to/scaling#horizontal-auto-scaling) or when a runtime container is restarted).
+Do not use the init commands for customising your runtime environment. Use the [run:prepareCommands](/rust/how-to/build-pipeline#preparecommands-1) attribute instead.
+:::
+#### Command exit code
+If any of the `initCommands` fails, it returns an exit code other than 0, but deploy is **not** canceled. After all init commands are finished, regardless of the status code, the application is started. Read the [runtime log](/rust/how-to/logs#runtime-log) to troubleshoot the error.
+#### Single or separated shell instances
+You can configure your `initCommands` to be run in a single shell instance or multiple shell instances. The format is identical to [build commands](#buildcommands).
+### envVariables
+_OPTIONAL._ Defines the environment variables for the runtime environment.
+Enter one or more env variables in following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ RUST_ENV: production
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+Read more about [environment variables](/rust/how-to/env-variables) in Zerops.
+### start
+_REQUIRED._ Defines the start command for your Rust application.
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Rust application start command
+ start: ./app
+```
+### health check
+_OPTIONAL._ Defines a health check.
+`healthCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the health check to request a local URL using a HTTP GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Rust application start command
+ start: ./app
+ # OPTIONAL. Define a health check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+Read more about how the [health check works] in Zerops.
+#### exec
+Configures the health check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Rust application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to run your application ====
+ run:
+ # REQUIRED. Your Rust application start command
+ start: ./app
+ # OPTIONAL. Define a health check with a shell command.
+ healthCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [health check works] in Zerops.
+### crontab
+_OPTIONAL._ Defines cron jobs.
+Setup cron jobs in the following format:
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to run your application ====
+ run:
+ crontab:
+ # REQUIRED. Sets the command to execute:
+ - command: ""
+ # REQUIRED. Sets the interval time to execute:
+ timing: "0 * * * *"
+```
+Read more about setting up [cron](/references/cron) in Zerops.
+## Deploy configuration
+### readiness check
+_OPTIONAL._ Defines a readiness check. Read more about how the [readiness check works](/rust/how-to/deploy-process#readiness-checks) in Zerops.
+`readinessCheck` requires either one `httpGet` object or one `exec` object.
+#### httpGet
+Configures the readiness check to request a local URL using a http GET method.
+Following attributes are available:
+| Parameter | Description |
+| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **port** | Defines the port of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **path** | Defines the URL path of the HTTP GET request.
+The readiness check will trigger a GET request on `http://127.0.0.1:{port}/{path}` |
+| **host** | **Optional.** The readiness check is triggered from inside of your runtime container so it always uses the localhost (`127.0.0.1`). If you need to add a `host` to the request header, specify it in the `host` attribute. |
+| **scheme** | **Optional.** The readiness check is triggered from inside of your runtime container so no https is required.
+If your application requires a https request, set `scheme: https` |
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ # ==== how to run your application ====
+ run: ...
+```
+Read more about how the [readiness check works](/rust/how-to/deploy-process#readiness-checks) in Zerops.
+#### exec
+Configures the readiness check to run a local command.
+Following attributes are available:
+
+
+
+ Parameter
+ Description
+
+
+
+
+ command
+
+ Defines a local command to be run.
+ The command has access to the same environment variables as your Rust application.
+ A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
+
+
+
+
+**Example:**
+```yaml
+zerops:
+ # hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build: ...
+ # ==== how to deploy your application ====
+ deploy:
+ # OPTIONAL. Define a readiness check with a HTTP GET request option.
+ # Configures the check on http://127.0.0.1:80/status
+ readinessCheck:
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+Read more about how the [readiness check works](/rust/how-to/deploy-process#readiness-checks) in Zerops.
+
+----------------------------------------
+
+# Rust > How To > Build Process
+
+
+## Description of the build process
+Zerops starts a temporary build container and performs following actions:
+1. Installs the build environment:
+ - Sets up base system and Go runtime
+ - Restores cached files if available (based on `build.cache` configuration)
+ - Validates cache against current `build.os`, `build.base`, and `build.prepareCommands`
+2. Downloads your application source code from [GitHub ↗](https://www.github.com), [GitLab ↗](https://www.gitlab.com) or via [Zerops CLI](/references/cli)
+3. Optionally [customizes the build environment](#customize-rust-build-environment)
+4. Runs the build commands
+5. Uploads the application artefact to the internal Zerops storage
+6. Preserves specified files for future builds (based on `build.cache` configuration)
+7. Optionally [customizes the runtime environment](/rust/how-to/customize-runtime)
+8. [Deploys your application](/rust/how-to/deploy-process)
+The build container is automatically deleted after the build has finished or failed.
+## Cancel running build
+When you know that the running build is not correct and you want to cancel it, you can do it in Zerops GUI. Go to the service detail, select **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Cancel build** button.
+The build cancellation is available before the build pipeline is finished. When the build is finished, the deployment cannot be cancelled.
+## Customize Rust build environment
+The default Rust build environment contains:
+- {data.alpine.default}
+- selected version of Rust defined in `zerops.yaml` [build.base](/rust/how-to/build-pipeline#base) parameter
+- [zCLI](/references/cli), Zerops command line tool
+- `npm`, `yarn`, `git` and `npx` tools
+If you prefer the Ubuntu OS instead of Alpine, set the [build.os](/rust/how-to/build-pipeline#os) attribute to `ubuntu`. To install additional packages or tools add one or more [build.prepareCommands](/rust/how-to/build-pipeline#preparecommands) commands to your `zerops.yaml`.
+:::info
+The application code is available in the `/var/www` folder in your build container before the prepare commands are triggered. This allows you to use any file from your application code in your prepare commands (e.g. a configuration file).
+:::
+## Rust build hardware resources
+Build of your Rust application is run in a separate build container with following resource configuration:
+| HW resource | Minimum | Maximum |
+| ------------- | ------- | ------- |
+| **CPU cores** | 6 | 20 |
+| **RAM** | 8 GB | 8 GB |
+| **Disk** | 1 GB | 100 GB |
+| **Disk** | 1 GB | 100 GB |
+The build container is always started with the minimum hardware resources and scales vertically up to the maximum resources.
+:::info
+Hardware resources of the build containers are not charged. The build costs are covered by the standard Zerops [project fee](https://zerops.io/#pricing).
+:::
+## Build time limit
+The time limit for the whole build pipeline is **1 hour**. After 1 hour, Zerops will terminate the build pipeline and delete the build container.
+## Troubleshooting build-related problems
+### Failure of a build prepare command
+If any [prepare command](/rust/how-to/build-pipeline#preparecommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/rust/how-to/logs#build-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom build environment is ready for the build phase.
+### Invalidate the build cache
+If you encounter unexpected build behavior or dependency issues, the problem might be related to [cached build data](/features/build-cache). While Zerops maintains the build cache to speed up deployments, sometimes you may need to start fresh.
+To invalidate the build cache:
+1. Go to your service detail in Zerops GUI
+2. Choose **Pipelines & CI/CD Settings** from the left menu
+3. Click on the **Invalidate build cache** button
+This will force Zerops to run the next build clean, including all prepare commands, which can help resolve cache-related issues. After invalidation, your next build will also create a fresh cache.
+### Failure of a build command
+If any [build command](/rust/how-to/build-pipeline#buildcommands) fails, it returns an exit code other than 0 and the build is canceled. Read the [build log](/rust/how-to/logs#build-log) to troubleshoot the error. If the error log doesn't contain any specific error message, try to run your build with the `--verbose` option.
+```yaml
+buildCommands:
+ - cargo build --release -v
+```
+If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `buildCommands` are finished, the application build is completed and ready for the [deploy](/rust/how-to/deploy-process) phase.
+
+----------------------------------------
+
+# Rust > How To > Controls
+
+Zerops allows you to stop any service. Stopped services only consume disk.
+## Stop, start and restart Rust service in Zerops GUI
+To stop the Rust service in Zerops GUI go to the project dashboard and select the **Stop** menu item in the top right corner.
+To start the stopped Rust service choose the **Start** item from the same menu.
+To restart the Rust service choose the **Restart** item from the same menu.
+## Stop and start Rust using zCLI
+zCLI is the Zerops command-line tool. To stop and start the Rust service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service stop` command
+```sh
+Usage:
+ zcli service stop [serviceIdOrName] [flags]
+Flags:
+ -h, --help the enable Zerops subdomain command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service stop`, you will be given a list of your projects and services to choose from.
+:::
+3. Run the `zcli service start` command
+```sh
+Usage:
+ zcli service start [{serviceName | serviceId}] [flags]
+Flags:
+ -h, --help the service start command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+:::info
+zCLI commands are interactive, when you press enter after `zcli service start`, you will be given a list of your projects and services to choose from.
+:::
+
+----------------------------------------
+
+# Rust > How To > Create
+
+Zerops provides a Rust runtime service with extensive build support. Rust runtime is highly scalable and customisable to suit both development and production.
+## Create Rust service using Zerops GUI
+First, set up a project in Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new Rust service:
+### Choose Rust version
+Following Rust versions are currently supported:
+:::info
+You can [change](/rust/how-to/upgrade) the major version at any time later.
+:::
+### Set a hostname
+Enter a unique service identifier like "app","cache", "gui" etc. Duplicate services with the same name in the same project are forbidden.
+#### Limitations:
+- maximum 25 characters
+- must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::caution
+The hostname is fixed after the service is created. It can't be changed later.
+:::
+### Set secret environment variables
+Add environment variables with sensitive data, such as password, tokens, salts, certificates etc. These will be securely saved inside Zerops and added to your runtime service upon start.
+Setting the secret environment variables is optional. You can set them later in Zerops GUI.
+Read more about [different types of env variables](/rust/how-to/env-variables#types-of-env-variables-in-zerops) in Zerops.
+### Set auto scaling configuration
+Zerops scales the Rust services automatically both vertically and horizontally. Vertical scaling means increasing or decreasing the hardware resources (CPU, RAM and disk) of a Rust container. Horizontal scaling adds or removes whole containers.
+
+#### CPU Mode
+**Shared**
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+**Dedicated**
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
+#### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Rust service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Rust service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Rust performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](/rust/how-to/scaling#fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+:::info
+You can change the vertical auto scaling parameters later.
+:::
+#### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Rust service. When your Rust service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ Parameter
+ Value
+
+ minimum containers
+ 1
+
+ maximum containers
+ 6
+
+Rust service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+[Learn more](/rust/how-to/scaling) about Rust auto scaling.
+#### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Create Rust service using zCLI
+zCLI is the Zerops command-line tool. To create a new Rust service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/rust/how-to/create#create-a-project-description-file)
+3. [Create a project with a Rust and PostgreSQL service](#full-example)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### Basic example:
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in rust@{version} format
+ type: rust@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes your future project infrastructure. The project will contain one Rust version 18 service with default [auto scaling](/rust/how-to/scaling) configuration. Hostname will be set to "app", the internal port(s) the service listens on will be defined later in the [zerops.yaml](/rust/how-to/build-pipeline#ports). Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+#### Full example:
+Create a directory my-project. Create an description.yaml file inside the my-project directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Rust and PostgreSQL database
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in rust@{version} format
+ type: rust@latest
+ # optional: vertical auto scaling customization
+ verticalAutoscaling:
+ cpuMode: DEDICATED
+ minCpu: 2
+ maxCpu: 5
+ minRam: 2
+ maxRam: 24
+ minDisk: 6
+ maxDisk: 50
+ startCpuCoreCount: 3
+ minFreeRamGB: 0.5
+ minFreeRamPercent: 20
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # optional: create secret env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+ - # second service hostname
+ hostname: db
+ # service type and version number in postgresql@{version} format
+ type: postgresql@12
+ # mode of operation "HA"/"non_HA"
+ mode: NON_HA
+```
+The yaml file describes your future project infrastructure. The project will contain a Rust service and a [PostgreSQL](/postgresql/overview) service.
+Rust service with "app" hostname, the internal port(s) the service listens on will be defined later in the [zerops.yaml](/rust/how-to/build-pipeline#ports). Rust service will run on version 18 with a custom vertical and horizontal scaling. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The hostname of the PostgreSQL service will be set to "db". The [single container](/postgresql/how-to/create#single-container) mode will be chosen and the default [auto scaling configuration](/postgresql/how-to/create#set-auto-scaling-configuration) will be set.
+#### Description of description.yaml parameters
+The `project:` section is required. Only one project can be defined.
+
+ Parameter
+ Description
+ Limitations
+
+ name
+ The name of the new project. Duplicates are allowed.
+
+ description
+ Optional. Description of the new project.
+ Maximum 255 characters.
+
+ tags
+ Optional. One or more string tags. Tags do not have a functional meaning, they only provide better orientation in projects.
+
+At least one service in `services:` section is required. You can create a project with multiple services. The example above contains Rust and PostgreSQL services but you can create a `description.yaml` with your own combination of [services](/features/infrastructure).
+
+ Parameter
+ Description
+
+ hostname
+
+ The unique service identifier.
+
+ duplicate services with the same name in the same project are forbidden
+ maximum 25 characters
+ must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+
+ type
+
+ Specifies the service type and version.
+
+ See what [Rust service types](/references/import-yaml/type-list#runtime-services) are currently supported.
+
+ verticalAutoscaling
+
+ Optional. Defines custom vertical auto scaling parameters.
+ All verticalAutoscaling attributes are optional. Not specified
+ attributes will be set to their default values.
+
+ - cpuMode
+
+ Optional. Accepts `SHARED`, `DEDICATED` values. Default is `SHARED`
+
+ - minCpu/maxCpu
+
+ Optional. Set the minCpu or maxCpu in CPU cores (integer).
+
+ - minRam/maxRam
+
+ Optional. Set the minRam or maxRam in GB (float).
+
+ - minDisk/maxDisk
+
+ Optional. Set the minDisk or maxDisk in GB (float).
+
+ minContainers
+
+ Optional. Default = 1. Defines the minimum number of containers
+ for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ maxContainers
+
+ Defines the maximum number of containers for horizontal autoscaling.
+
+ Limitations:
+
+ Current maximum value = 6.
+
+ envSecrets
+
+ Optional. Defines one or more secret env variables as a key value
+ map. See env variable restrictions.
+
+### Create a project based on the description.yaml
+When you have your `description.yaml` ready, use the `zcli project project-import` command to create a new project and the service infrastructure.
+```sh
+Usage:
+ zcli project project-import importYamlPath [flags]
+Flags:
+ -h, --help the project import command.
+ --orgId string If you have access to more than one organization, you must specify the org ID for which the
+ project is to be created.
+ --workingDie string Sets a custom working directory. Default working directory is the current directory. (default "./")
+```
+Zerops will create a project and one or more services based on the `description.yaml` content.
+Maximum size of the `description.yaml` file is 100 kB.
+You don't specify the project name in the `zcli project project-import` command, because the project name is defined in the `description.yaml`.
+If you have access to more than one client, you must specify the client ID for which the project is to be created. The `clientID` is located in the Zerops GUI under the client name on the project dashboard page.
+
+### Add Rust service to an existing project
+#### Example:
+Create a directory `my-project` if it doesn't exist. Create an `import.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+# array of project services
+services:
+ - # service name
+ hostname: app
+ # service type and version number in rust@{version} format
+ type: rust@latest
+ # defines the minimum number of containers for horizontal autoscaling
+ minContainers: 1
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 6
+ # optional: create env variables
+ envSecrets:
+ S3_ACCESS_KEY_ID: 'P8cX1vVVb'
+ S3_ACCESS_SECRET: 'ogFthuiLYki8XoL73opSCQ'
+```
+The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one Rust service version 18 with default [auto scaling](/rust/how-to/scaling) configuration will be added to your project. Hostname of the new service will be set to `app`. Following secret env variables will be configured:
+```env
+S3_ACCESS_KEY_ID="P8cX1vVVb"
+S3_ACCESS_SECRET="ogFthuiLYki8XoL73opSCQ"
+```
+The content of the `services:` section of `import.yaml` is identical to the project description file. The `import.yaml` never contains the `project:` section because the project already exists.
+When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
+```sh
+Usage:
+ zcli project service-import importYamlPath [flags]
+Flags:
+ -h, --help the project service import command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
+Maximum size of the import.yaml file is 100 kB.
+
+----------------------------------------
+
+# Rust > How To > Customize Runtime
+
+
+The default Rust runtime environment contains:
+- {data.alpine.default}
+- Selected version of Rust when the runtime service was created.
+- [zCLI](/references/cli)
+- Git
+:::note
+To use Ubuntu instead of the default Alpine, set the [run.os](/zerops-yaml/specification#os--1) attribute.
+Additional packages and tools can be installed using [run.prepareCommands](/zerops-yaml/specification#preparecommands--1).
+:::
+### Runtime Flow
+When the first deploy with a defined `prepareCommands` attribute is triggered, Zerops will
+1. create a prepare runtime container
+2. optionally: [copy selected folders or files from your build container](/rust/how-to/build-pipeline#copy-folders-or-files-from-your-build-container)
+3. run the run.prepareCommands commands in the defined order
+### Command exit code
+If any command fails, it returns an exit code other than 0 and the deploy is canceled. Read the [prepare runtime log](/rust/how-to/logs#prepare-runtime-log) to troubleshoot the error. If the command ends successfully, it returns the exit code 0 and Zerops triggers the following command. When all `prepareCommands` commands are finished, your custom runtime environment is ready for the deploy phase.
+The prepare runtime container is automatically deleted after the prepare runtime phase has finished or failed.
+### Custom runtime environment cache
+Some packages or tools can take a long time to install. Therefore, Zerops caches your custom runtime environment after the installation of your custom packages or tools is completed. When the second or following deploy is triggered, Zerops will use the custom runtime cache from the previous deploy if following conditions are met:
+1. Content of the build.addToRunPrepare and run.prepareCommands attributes didn't change from the previous deploy
+2. The custom runtime cache wasn't invalidated in the Zerops GUI.
+To invalidate the Zerops runtime cache go to your service detail in Zerops GUI, choose **Service dashboard & runtime containers** from the left menu and click on the **Open pipeline detail** button. Then click on the **Clear runtime prepare cache** button.
+When the custom runtime cache is used, Zerops doesn't create a prepare runtime container and executes the deployment of your application directly.
+
+----------------------------------------
+
+# Rust > How To > Delete
+
+## Delete Rust service in Zerops GUI
+Go to the project dashboard and select the **delete service** menu item in the top right corner.
+## Delete Rust using zCLI
+zCLI is the Zerops command-line tool. To delete the Rust service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Run the `zcli service delete` command
+```sh
+Usage:
+ zcli service delete [serviceIdOrName] [flags]
+Flags:
+ --confirm If set, zCLI will not ask for confirmation of destructive operations.
+ -h, --help the service delete command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+```
+zCLI commands are interactive, when you press enter after `zcli service delete`, you will be given a list of your projects and its services to choose from.
+
+----------------------------------------
+
+# Rust > How To > Deploy Process
+
+
+## Application artefact
+When the [build phase](/rust/how-to/build-process) is finished, the application artefact is stored in the internal Zerops storage and the build container is deleted.
+If you triggered the deploy pipeline [manually](/rust/how-to/trigger-pipeline#manual-deploy-using-zerops-cli) using Zerops CLI, the application artefact is also uploaded to the internal Zerops storage.
+Zerops uses the stored artefact to deploy the identical version of your application each time a new container is started:
+- when a new application version is deployed
+- when the application [scales horizontally](/rust/how-to/create#horizontal-auto-scaling)
+- when a runtime container fails and a new container is started automatically
+## First deploy
+When your application is deployed for the first time, Zerops will start one or more runtime containers based on the service [auto scaling settings](/rust/how-to/scaling).
+Zerops performs following actions for each new container:
+1. Installs the runtime environment
+2. Downloads the application artefact from the internal storage
+3. Optionally runs the [init commands](/rust/how-to/build-pipeline#initcommands)
+4. Starts your application using the [start command](/rust/how-to/build-pipeline#start)
+5. Optionally waits until the [readiness check](/rust/how-to/build-pipeline#readiness-check) succeeds
+6. The container is now active and receives incoming requests.
+Services with multiple containers are deployed in parallel.
+:::info
+If your application needs to be initialized in each runtime container, add [init commands](/rust/how-to/build-pipeline#initcommands) to `zerops.yaml`.
+:::
+:::caution
+Do not use the `initCommands` for customising your runtime environment. See [how to customize the runtime environment](/rust/how-to/customize-runtime).
+:::
+## Further deploys
+When a previous version of your application is already running, Zerops will start new containers. The count of new containers will be the same as the count of existing containers.
+Zerops performs the identical actions for each new container as the first deployment.
+When all new containers are started your service contains both new and old versions for a short period of time.
+The old containers are then removed from the project balancer so they don't receive new requests. The Rust process inside each of the old containers is terminated and all old containers are gradually deleted.
+## Readiness checks
+If your application isn't ready to handle requests right after it is started via the [start command](/rust/how-to/build-pipeline#start), configure a [readiness check](/rust/how-to/build-pipeline#readiness-check) in your `zerops.yaml`.
+If the readiness check is defined, Zerops will:
+1. Start your application
+2. Perform a readiness check
+3. If the readiness check fails, wait 5 seconds and repeat step 2.
+4. If the readiness check succeeds, set the container as active.
+Application in the runtime container with a pending readiness check won't receive any incoming requests. Only active containers receive incoming requests to your Rust service.
+If the readiness check is still failing after 5 minutes, the specific runtime container is marked as failed and Zerops will delete it, create a new runtime container and perform the deploy.
+The `httpGet` readiness check is successful when the URL returns HTTP status code `2xx`. The timeout is 5 seconds. When the URL returns a `3xx` HTTP status, the readiness check HTTP client will follow the redirect.
+The `exec.command` readiness check is successful when the command returns status code 0. The timeout is 5 seconds.
+Read the [runtime log](/rust/how-to/logs#runtime-log) to troubleshoot failed readiness checks.
+## Application versions
+Zerops keeps 10 last versions of your application in the internal storage.
+The list of application versions is available in Zerops GUI. Go to the service detail and choose **Service dashboard & runtime containers** from the left menu. The active version is highlighted, show all archived version by clicking on the button below.
+
+The pipeline detail is accessible from the additional menu. The pipeline detail contains
+- The pipeline config (`zerops.yaml`) that was used for the selected version
+- The build log (if available)
+- The prepare runtime log (if available)
+You can download the build artefact of the selected version or delete an inactive version manually.
+## Restore an archived version
+You can restore an archived version by choosing the **Activate** item from the additional menu.
+Zerops will deploy the selected version and the active version will be archived.
+The environment variables will be restored to the latest moment when the selected version was active.
+
+----------------------------------------
+
+# Rust > How To > Env Variables
+
+Environment variables help you run your application in different environments. They allow you to isolate all specific environment aspects from your application code and keep your app encapsulated. You can create several projects in Zerops that represent different environments (development, stage, production) or even each developer can have a project with its own environment.
+In Zerops you do not have to create a `.env` file manually. Zerops handles the environment variables for you.
+## Types of env variables in Zerops
+There are 3 different sets of env variables in Zerops:
+
+ Type
+ Environment
+ Defined in
+
+ basic
+ build
+ zerops.yaml
+
+ basic
+ runtime
+ zerops.yaml
+
+ secret
+ runtime
+ Zerops GUI
+
+Use the [secret env variables](/rust/how-to/create#set-secret-environment-variables) for all sensitive data you don't want to store in your application code. Secret env variables are also useful if you need for testing where you need to change the value of some env variables frequently. Secret variables are managed in Zerops GUI and you don't have to redeploy your application.
+The basic build and runtime env variables are listed in your [zerops.yaml](/zerops-yaml/specification) and deployed together with your application code. When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your zerops.yaml and redeploy your application to Zerops.
+You can [reference](/rust/how-to/env-variables#reference-a-local-variable-in-another-variable-value) another variable of the same service or even a variable of [another service](/rust/how-to/env-variables#reference-a-variable-of-another-project-service) within the same project.
+## Set secret env variables in Zerops GUI
+Use secret variables to store passwords, tokens and other sensitive information that shouldn't be part of your repository and listed in zerops.yaml.
+
+You can set env variables when you [create](/rust/how-to/create) a new Rust service or you can set them later.
+To configure env variables for an existing service, go to the service detail and choose **Environment variables** in the left menu. Scroll to the **Secret variables** section and click on the **Add secret variable** button and set variable key and value.
+You can edit or delete env variables that you've created by clicking on the menu on the right side of each row.
+The changes you've made to environment variables will be automatically applied to all containers of your project's services.
+:::caution
+You need to **restart** the runtime service after you update environment variables. The Rust process running in the container receives the list env variables only when it starts. Update of the env variables while the Rust process is running does not affect your application.
+:::
+## Set basic build env variables in zerops.yaml
+To set basic env variables for the build environment, add the `envVariables` attribute to the build section in your `zerops.yaml`
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ build:
+ …
+ # OPTIONAL. Defines the env variables for the build environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Set basic runtime env variables in zerops.yaml
+To set basic env variables for the runtime environment, add the `envVariables` attribute to the runtime section in your `zerops.yaml`.
+```yaml
+zerops:
+ # define hostname of your service
+ - setup: app
+ # ==== how to build your application ====
+ run:
+ …
+ # OPTIONAL. Defines the env variables for the runtime environment:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+When you need to update a value of an existing env variable or change the set of build or runtime env variables, update your `zerops.yaml` and redeploy your application to Zerops.
+## Env variable restrictions
+**key**
+- must satisfy the following regular expression: `[a-zA-Z_]+[a-zA-Z0-9_]*`
+- all variable keys in the same service must be unique regardless of case
+- keys are case sensitive
+**value**
+- must contain only ASCII characters
+- the _End of Line_ character is forbidden
+These restrictions apply to all [types of env variables](/rust/how-to/env-variables#types-of-env-variables-in-zerops).
+## Referencing other env variables
+You can reference another variable of the same service using `${key}` in your variable value. You can even reference a variable from a different service using `${hostname_key}`. The referenced variable doesn't need to exist when you are entering your variable.
+### Reference a local variable in another variable value
+| Variable key | Variable value | Computed variable value |
+| ------------ | ------------------- | ----------------------- |
+| id | 12345 | 12345 |
+| hostname | app | app |
+| name | `${id}-${hostname}` | 12345-app |
+| name | `${id}-${hostname}` | 12345-app |
+### Reference a variable of another project service
+Let's say your project contains two PostgreSQL services `dbtest` and `dbprod`. Both services have a `connectionString` variable. Then you can create a `dbConnectionString` env variable in your Rust runtime and set `${dbtest_connectionString}` as the variable value. Zerops will fill in the value of the `connectionString` variable of the `dbtest` service.
+When you change the `dbConnectionString` value to `${dbprod_connectionString}`, Zerops will fill in the value of the `connectionString` variable of the `dbprod` service.
+:::caution
+When you change the value of the `connectionString` variable in the service `dbtest` you need to **restart** the Rust service. The Rust process running in the container receives the list env variables only when it starts. Update of the env variables while the Rust process is running does not affect your application.
+:::
+## Generated env variables
+Zerops creates several helper variables when a Rust service is created, e.g. `hostname`, `PATH`. Some helper variables are read-only (`hostname`), others are editable (`PATH`). Generated variables cannot be deleted.
+Generated env variables are listed on the **Environment variables** page. Scroll to the **Generated variables** section.
+
+## How to read env variables from your Rust app
+Zerops passes all environment variables from all project services when your Rust app is deployed and started.
+To access the local environment variable i.e. the variable set to this Rust service in your app, use:
+```sh
+env::var("YOUR_VARIABLE_KEY_HERE")
+```
+## How to read env variables of another service
+All services of the same project can reference environment variables from other services. To use an environment variable from one service in another service in the same project, you must prefix the environment variable key with the service hostname and underscore.
+#### Examples:
+To access the `connectionString` env variable of the `mariadb1` service, use `mariadb1_connectionString` as the env variable key.
+To access the `password` env variable of the `mariadb2` service, use `mariadb2_password` as the env variable key.
+## How to read runtime env variables in the build environment
+You can use runtime env variables in the build environment using the `RUNTIME_` prefix. For example if you have a runtime variable with the `connectionString` key, use the `RUNTIME_connectionString` to read the variable in the build environment. This rule applies both for basic and secret runtime variables.
+## Basic and secret env variable with the same key
+If you create a secret env variable and a basic runtime env variable with the same key, Zerops saves the basic runtime env variable from your zerops.yaml and ignores the secret env variable.
+If you create a basic build env variable and a runtime env variable with the same key, Zerops saves both because the build and runtime environments have separate sets of env variables.
+
+----------------------------------------
+
+# Rust > How To > Filebrowser
+
+## Zerops GUI
+In Zerops GUI, go to the service detail page and choose **Service containers & resources overview** and scroll down to the list of containers.
+
+Then click on the file browser icon and the file browser opens:
+
+If your service is in the [HA mode], you can switch between containers in the top left corner.
+## zCLI & SSH
+You can connect to the container via SSH with the Zerops CLI and browse its files.
+How to [connect to your service via SSH](/references/ssh).
+
+----------------------------------------
+
+# Rust > How To > Logs
+
+Zerops provides 3 different logs:
+- [build log](#build-log)
+- [prepare runtime log](#prepare-runtime-log)
+- [runtime log](#runtime-log)
+## How to access logs
+### Build log
+#### Zerops GUI
+To access a build log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Build log**. The build log button is available only if the [build pipeline](/rust/how-to/trigger-pipeline) was triggered for the selected deploy.
+#### zCLI
+To access a build log in Zerops CLI use
+```sh
+zcli service log --showBuildLogs
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+### Prepare runtime log
+#### Zerops GUI
+To access a prepare runtime log in Zerops GUI, go to the service detail and choose **Service dashboard & runtime containers** in the left menu. Then open the pipeline detail of an application version and click on **Prepare runtime log**. The prepare runtime log button is available only if the [prepare runtime pipeline](/rust/how-to/build-pipeline#preparecommands-1) was triggered for the selected deploy.
+#### zCLI
+_Prepare runtime log is currently not supported in zCLI._
+### Runtime log
+#### Zerops GUI
+To access a runtime log in Zerops GUI, go to the service detail and choose **Runtime log** in the left menu.
+Each runtime container has its own log. If your service has multiple containers, select the container in the log header.
+You can filter log records by minimum severity or by time.
+#### zCLI
+To access the log of the _first runtime container_ in Zerops CLI use
+```sh
+zcli service log
+```
+For an _aggregate log_ from all service's runtime containers omit the `@1`
+```sh
+zcli service log
+```
+Read more about the [zcli service log](/references/cli/access-logs) command.
+## Rust logging configuration
+Zerops logs all messages sent
+- to the standard error (`stderr`)
+- to the standard output (`stdout`)
+- via the Rust `console.log` method
+### Severity level
+By default the `console.log` creates a message with the `Informational (6)` severity.
+Add a severity number in the `` format as a prefix to set a custom severity as shown below:
+```rust
+console.log("A message with the informational severity ...");
+console.log('Emergency (0) severity > system is unusable.');
+console.log('Alert (1) severity > action must be taken immediately.');
+console.log('Critical (2) severity > critical conditions.');
+console.log('Error (3) severity > error conditions.');
+console.log('Warning (4) severity > warning conditions.');
+console.log('Notice (5) severity > normal, but significant, condition.');
+console.log('Informational (6) severity > informational message.');
+console.log('Debug (7) severity > debug-level message.');
+```
+:::info
+`console.info`, `console.warn`, `console.debug`
+, and `console.error` are just aliases to the `
+ console.log
+` method. They don't set the appropriate severity number. Use the `
+ <N>
+` prefix instead. :::
+
+----------------------------------------
+
+# Rust > How To > Scaling
+
+Zerops performs an automated scaling of hardware resources required to run your runtime application based on its usage. If the current use of your application does not require as much performance or disk space the auto scaling reduces the resources and thus reduces the costs. If your application is under heavy load or needs to store more data, then auto scaling increases the resources to make sure it runs smoothly.
+## Vertical and horizontal auto scaling
+Each application you deploy starts with the minimum hardware resources: **CPU** cores, **RAM** and **Disk**. Zerops monitors the usage of these 3 resources and if the usage exceeds a set threshold, more CPU cores, RAM or Disk is allocated to the service. This is called **vertical scaling**.
+
+**Horizontal scaling** adds or removes whole containers.
+Zerops has a preference for vertical scaling because it's faster and more precise. If the vertical auto scaling hits the defined maximum a new container is started automatically. When your application doesn't need so much power and all containers are vertically scaled down, Zerops will gradually remove whole containers.
+
+## Configure auto scaling
+To change the auto scaling settings go to the Rust service detail and choose **Automatic scaling configuration** in the left menu.
+
+### CPU mode
+#### Shared
+Your application gets a full physical CPU core, but it is shared with up to 10 other applications. In this mode the power your application gets is depended on other applications running on the same CPU core. At best case scenario your application gets 10/10 of CPU core power and 1/10 at worst case scenario.
+#### Dedicated
+The CPU core is dedicated to your application.
+:::info
+See the [pricing](https://zerops.io/#pricing) for the difference between CPU modes.
+:::
+The CPU mode doesn't change automatically.
+### Vertical auto scaling
+Vertical auto scaling has following default configuration:
+Rust service always starts with the minimal resources.
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Rust service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Rust performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::tip
+Learn more about how to [fine tune](fine-tune-the-auto-scaling) the auto scaling to fit your application needs.
+:::
+### Horizontal auto scaling
+When a container needs more CPU or RAM but already consumes maximal resources defined for the vertical auto scaling, Zerops will add a new container to your Rust service. When your Rust service doesn't need so much power and all containers are vertically scaled down in such a way their CPU allocation is near the minimal resources, Zerops will gradually remove whole containers.
+Horizontal auto scaling has following default configuration:
+
+ minimum containers
+
+ 1
+
+ maximum containers
+
+ 6
+
+Rust service always starts with the minimum number of containers.
+You can increase the minimum or decrease the maximum number of containers. The horizontal scaling parameters can be changed later.
+### Single container vs. High Availability
+When creating a new runtime service, you can choose the minimum and maximum number of containers. If you set the maximum limit to one, the service will be run in a **single container** and no horizontal scaling will occur.
+:::caution
+If the single container fails, Zerops will start a new container and deploy your application automatically. The application won't be available for a short period. This mode is recommended for non-critical applications or dev environments.
+:::
+By increasing the maximum number of containers for your service, you enable horizontal auto scaling. Zerops will then add containers depending on your application’s load. Application running on two or more containers is in **High Availability** mode, which we highly recommend for production. When the load drops, containers will be gradually removed to the defined minimum.
+Each container of the same service is strictly installed on a **different server**. This prevents the temporary outage in case any of Zerops servers fail. If the connection to a container is broken, Zerops immediately redirects incoming traffic to other containers. A new container will be started automatically and the broken container will be deleted.
+:::caution
+Check if your application is ready to be run in multiple containers.
+:::
+## Fine-tune the auto scaling
+### Advanced CPU settings
+If you've experienced problems with not enough power when your application starts, increase the default Start CPU core count. Alternatively switch the [CPU mode](#cpu-mode) to dedicated to allocate the stable CPU power to your application.
+
+If your application doesn't need so much power after it is started, Zerops will scale down the allocated CPU cores to the defined minimum.
+You can disable the CPU vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the RAM and Disk scaling. Zerops scales each hardware resource independently.
+### Advanced RAM settings
+By default Zerops keeps a minimum free RAM in each container. This setting will ensure that most applications will run smoothly. Zerops monitors the minimum free RAM every 10 seconds.
+But if your application need a more memory faster or if you have experienced problems with insufficient memory or even restarts due to Out Of Memory (OOM) errors, we recommend
+1. Increasing the minimum RAM for the auto scaling
+2. or increasing the minimum free RAM in GB
+3. or setting the minimum free RAM in % of the RAM assigned to the container
+
+You can set the minimum free RAM both in GB and in percent, Zerops will apply the larger value based on the current RAM assigned to the container.
+You can disable the RAM vertical auto scaling by setting the minimum and maximum to the same value. This setting doesn't affect the CPU core and Disk scaling. Zerops scales each hardware resource independently.
+## Technical details
+### Automatic scale up
+Zerops monitors CPU, RAM and Disk usage in all running containers each 10 seconds.
+The **scale up threshold** is derived from following **minimum free resources**:
+- 0.1 CPU core
+- 0.125 GB RAM (You can [fine tune](#fine-tune-the-auto-scaling) this setting)
+- 0.5 GB disk
+If the minimum free CPU, RAM or disk usage of a container is lower than the defined scale up threshold, Zerops scales the container up.
+The scale up of RAM or disk is immediate. The scale up of CPU is configured to be a little less aggressive. Two consecutive measurements of free CPU with values under the scale up threshold are required to trigger the scale up. This rule prevents excessive fluctuations of scaling up and down due to sudden changes in CPU usage.
+The **minimum step** for the vertical scaling is
+- 1 CPU core
+- 0.125 GB RAM
+- 0.5 GB disk
+When the application is under a heavy load and needs to scale up faster, the scaling step will increase automatically.
+Maximal resources are defined for each Rust service. Zerops will never scale above the entered values. If your application is in [highly available mode], maximal resources are identical for all containers of the Rust service.
+### Not enough resources to scale up
+If one of the Rust containers needs more resources but there are not enough of them on the underlying machine, a new container with the required hardware resources will be started on another machine. When the new container is ready, it will be added to the service balancer. The old container will be removed from the balancer and deleted.
+### Automatic scale down
+When the application no longer needs as much power or disk space, each container is gradually scaled down to the defined minimum. The automatic scale down is configured to be more cautious and defensive to prevent the application from scaling up and down rapidly.
+Consecutive measurements during:
+- 1 minute for CPU
+- 2 minutes for RAM
+- 5 minutes for disk
+with free resources safely above the minimum threshold are required to scale down the appropriate resource.
+The minimum step for the scale down is identical to the minimum step for scale up. When several scale down events are triggered in a short period of time, the scaling step increases automatically.
+### Horizontal autoscaling
+Zerops prefers vertical scaling over horizontal scaling because vertical scaling is faster and allows finer adjustment to the required performance. Horizontal scaling can be disabled by setting the same number for the minimum and maximum container count. Zerops will then scale the Rust service only vertically.
+Your application is created with the defined minimum number of containers. Zerops will add a new container when any of the service's containers reaches the maximum limit for vertical scaling for CPU cores or RAM. Zerops doesn't start a new container when the maximum disk space is reached. No more containers are added when the defined maximum container limit is reached.
+The new container is started with a minimum disk size and with an average CPU cores and RAM of the existing containers.
+By customising the vertical auto scaling limits, you can cause the horizontal scaling to start earlier. For example if you lower the vertical auto scaling maximum to 1 CPU core, Zerops will start a new container if some of the running containers are using the whole CPU core for more than 20 seconds.
+If the application no longer needs as much power, Zerops will gradually remove containers to the defined minimum count. The container is removed after its CPU cores are scaled down to the defined minimum and the free CPU is safely above the minimum threshold for vertical scaling. Zerops only **removes containers** with a minimum **15 minute lifetime**.
+## Monitor Rust resources
+Zerops provides information about how much hardware resources the Rust service is currently using. Go to the service detail in Zerops GUI and select **Service dashboard & runtime containers** in the left menu. Zerops also provides the history of resource usage.
+
+----------------------------------------
+
+# Rust > How To > Shared Storage
+
+Zerops provides [shared storage service](/shared-storage/overview) that can be connected to runtime services. Shared storage enables your runtime service to share files between all containers of the same service or even among containers of different runtime services.
+## Connect a shared storage in Zerops GUI
+Connect your Rust service directly when creating a new shared storage service. Just select your Rust service in the **Share with Services** block on the **Add new shared storage service** page.
+To connect the existing shared storage to the Rust service, go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Select a runtime service and the shared storage will be connected to the selected runtime.
+Zerops will create a new folder `/mnt/[shared storage name]`` in the runtime root folder. E.g. `/mnt/teststorage`for a`teststorage` shared storage. The content of this folder is shared among all containers of the runtime service you've selected. If you select multiple runtimes, the content of the folder will be shared among all containers of selected services.
+## Disconnect a shared storage in Zerops GUI
+Go to the shared storage service detail and select **Shared storage connections**. A list of all your current runtime services will be shown. Switch off the toggle to disconnect the shared storage from the selected runtime.
+:::note
+Your runtime service will be automatically restarted when a shared storage is disconnected.
+:::
+## Create Rust service with a shared storage using zCLI
+zCLI is the Zerops command-line tool. To create a new Rust service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. [Create a project description file](/rust/how-to/shared-storage#create-a-project-description-file)
+3. [Create a project with a Rust service and a shared storage](/rust/how-to/shared-storage#create-a-project-with-a-rust-service-and-a-shared-storage)
+### Create a project description file
+Zerops uses a yaml format to describe the project infrastructure.
+#### description.yaml format
+[Read the basics](/rust/how-to/create#create-a-project-description-file) how to define the Rust service using the description.yaml.
+#### Example with a shared storage
+Create a directory `my-project`. Create an `description.yaml` file inside the `my-project` directory with following content:
+```yaml
+# basic project data
+project:
+ # project name
+ name: my-project
+ # optional: project description
+ description: A project with a Rust and a shared storage
+ # optional: project tags
+ tags:
+ - DEMO
+ - ZEROPS
+# array of project services
+services:
+ - # service name
+ hostname: teststorage
+ # shared storage service has no version
+ type: shared-storage
+ # mode: HA / NON_HA
+ mode: NON_HA
+ - # service name
+ hostname: app
+ # service type and version number in rust@{version} format
+ type: rust@latest
+ # defines the minimum number of containers for horizontal autoscaling. Max value = 6.
+ minContainers: 2
+ # defines the maximum number of containers for horizontal autoscaling. Max value = 6.
+ maxContainers: 4
+ # Mount the shared storage to the Rust service
+ mount:
+ - teststorage
+```
+The mount attribute accepts an array of shared storage names you want to mount to your runtime service.
+### Create a project with a Rust service and a shared storage
+Follow the article [How to create a project based on the description.yaml](/rust/how-to/create#create-a-project-based-on-the-descriptionyaml).
+
+----------------------------------------
+
+# Rust > How To > Trigger Pipeline
+
+
+## Automatic builds and deploys from GitHub or GitLab
+Integrate Zerops to your GitHub or GitLab repository and configure the automatic builds and deploys.
+Follow these steps:
+1. Add [zerops.yaml](/rust/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository.
+2. Connect your GitHub repository or connect your GitLab repository
+Then each time you create a new tag or push to a specific branch, depending on the configuration, GitHub or GitLab will initiate a new build & deploy pipeline.
+
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+### Skip the automatic pipeline once
+To ensure that a pipeline is not triggered by your next push, add `[ci skip]` or `[skip ci]` to the commit message. It is case insensitive.
+:::note
+You will still see a successful delivery of a webhook in your Github/Gitlab repository as a webhook is actually triggered, but with no action.
+:::
+## Manual builds and deploys using Zerops CLI
+
+To start a new build & deploy pipeline manually, use the Zerops CLI.
+Follow these steps:
+1. Add `zerops.yaml` to your repository.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli push` command.
+The `zcli push` command uploads your application code, builds and deploys your application in Zerops.
+The command triggers the [build pipeline](/rust/how-to/trigger-pipeline) defined in `zerops.yaml`. `zerops.yaml` must be in the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+zCLI uploads all files and subdirectories of the working directory to Zerops and starts the build pipeline. If the `.gitignore` file is found, it is interpreted and the defined files and folders will be ignored.
+If you just want to deploy your application to Zerops, use the [zcli deploy](#manual-deploy-using-zerops-cli) command instead.
+#### Push command parameters
+```sh
+Usage:
+ zcli push [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder If set, zCLI the .git folder is also uploaded. By default, the .git folder is ignored.
+ -h, --help the service push command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+zCLI commands are interactive, when you press enter after `zcli push`, you will be given a list of your projects to choose from.
+:::info
+You can change the build and deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your repository.
+:::
+## Manual deploy using Zerops CLI
+To start only a deploy pipeline, use the Zerops CLI.
+Follow these steps:
+1. Add [zerops.yaml](/rust/how-to/build-pipeline#add-zeropsyaml-to-your-repository) to your repository. Omit the build section.
+2. [Install & setup zCLI](/references/cli) the Zerops command line tool.
+3. Run `zcli service deploy` command.
+The `zcli service deploy` command uploads your application and deploys it in Zerops. Use this tool if you have your own build process. If you want to build your application in Zerops, use an [automatic](#automatic-builds-and-deploys-from-github-or-gitlab) or [manual](#manual-builds-and-deploys-using-zerops-cli) build process.
+#### Deploy command parameters
+```sh
+Usage:
+ zcli service deploy pathToFileOrDir [flags]
+Flags:
+ --archiveFilePath string If set, zCLI creates a tar.gz archive with the application code in the required path relative
+ to the working directory. By default, no archive is created.
+ --deployGitFolder Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+ -h, --help the service deploy command.
+ --projectId string If you have access to more than one project, you must specify the project ID for which the
+ command is to be executed.
+ --serviceId string If you have access to more than one service, you must specify the service ID for which the
+ command is to be executed.
+ --versionName string Adds a custom version name. Automatically filled if the VERSIONNAME environment variable exists.
+ --workingDir string Sets a custom working directory. Default working directory is the current directory. (default "./")
+ --zeropsYamlPath string Sets a custom path to the zerops.yaml file relative to the working directory. By default zCLI
+ looks for zerops.yaml in the working directory.
+```
+`pathToFileOrDir` defines a path to one or more directories and/or files relative to the working directory. The working directory is by default the current directory and can be changed using the
+`--workingDir` flag.
+`zerops.yaml` must be placed in the working directory.
+:::info
+You can change the deploy pipeline when you need to. Just simply modify the `zerops.yaml` in your working directory.
+:::
+
+----------------------------------------
+
+# Rust > How To > Upgrade
+
+You can upgrade or downgrade your Rust service to a different major Rust version by setting the `run.base` parameter in your `zerops.yaml`. When you [trigger a new pipeline](/rust/how-to/trigger-pipeline), Zerops will start new runtime container(s) with the required Rust version. If you don't specify the `run.base` attribute in your `zerops.yaml`, Zerops keeps the current Rust version for your runtime.
+If you want to build your application with a different major Rust version, change the `build.base` parameter in your `zerops.yaml`. The `build.base` is the required attribute.
+
+----------------------------------------
+
+# Rust > Overview
+
+[Rust ↗](https://www.rust-lang.org/) - a language empowering everyone to build reliable and efficient software.
+As said, there is no need for coding yet, we have created a [Github repository ↗](https://github.com/zeropsio/recipe-rust-hello-world), a **_recipe_**, containing the most simple Rust web application. The repo will be used as a source from which the app will be built.
+ This is the most bare-bones example of Rust running on Zerops — as few libraries as possible,
+ just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.
+
+1. Log in/sign up to [Zerops GUI ↗](https://app.zerops.io)
+2. In the **Projects** box click on **Import a project** and paste in the following YAML config ([source ↗](https://github.com/zeropsio/recipe-rust-hello-world/blob/main/import-project/description.yaml)):
+```yaml
+project:
+ name: my-first-project
+services:
+ - hostname: helloworld
+ type: rust@latest
+ minContainers: 1
+ maxContainers: 3
+ buildFromGit: https://github.com/zeropsio/recipe-rust-hello-world@main
+ enableSubdomainAccess: true
+```
+3. Click on **Import project** and wait until all pipelines have finished.
+**That's it, your application is now up and running! :star: Let's check it works:**
+1. A _subdomain_ should have been enabled and visible in the project's **IP addressed & Public Routing Overview** box. Its format should look similar to this `https://helloworld-24-8080.prg1.zerops.app`.
+2. Click or the `subdomain` URL to open it in a browser and you should see
+```
+Hello, World!
+```
+:::tip
+Do you have any questions? Check the step-by-step tutorial, browse the documentation and join our **[Discord](https://discord.com/invite/WDvCZ54)** community to get help from our team and other members.
+:::
+## How to start
+## Feature Highlights
+{" "}
+## When in doubt, reach out
+Don't know how to start or got stuck during the process? You might not be the first one, visit the FAQ section to find out.
+In case you haven't found an answer (and also if you have), we and our community are looking forward to hearing from you on Discord.
+Have you build something that others might find useful? Don't hesitate to share your knowledge!
+## Popular Guides
+
+----------------------------------------
+
+# Shared Storage > How To > Backup
+
+Zerops provides built-in backup functionality for your Shared Storage service. For general information about configuring backups, viewing backup files, limits, and security, please refer to the [general backup documentation](/features/backup).
+Shared Storage backups on Zerops:
+- Are stored as tarballs containing the entire contents of the shared storage directory (`/mnt/`)
+- Can be managed through the Shared Storage service detail page under **Backups List & Configuration**
+### Storage Optimization
+For large Shared Storage volumes:
+- Be mindful of the [project backup limits](/features/backup#limits) (25 GiB total backup volume per project)
+- Consider adjusting your backup frequency for optimal storage usage
+- Regularly clean up unnecessary files from your Shared Storage to reduce backup size
+
+----------------------------------------
+
+# Shared Storage > How To > Connect
+
+This page covers how to connect an existing shared storage to runtime services and how to disconnect services when needed.
+## In Zerops GUI
+### Connect a new shared storage
+When creating a new shared storage service, you can directly select which runtime services it should be connected to. See [Create Shared Storage](/shared-storage/how-to/create) for details about the creation process.
+### Connect an existing shared storage
+For existing storage, go to the shared storage service detail page and select **Shared storage connections**. Toggle ON any runtime services you wish to connect to this storage.
+
+## Disconnect a shared storage in Zerops GUI
+To disconnect storage, access the shared storage service detail page, select **Shared storage connections**, and toggle OFF the desired runtime service.
+
+----------------------------------------
+
+# Shared Storage > How To > Create
+
+Shared Storage provides persistent file storage that can be mounted as a POSIX-compatible filesystem to your runtime services. Built on [SeaweedFS ↗](https://github.com/seaweedfs/seaweedfs), it enables reliable data persistence and sharing across services in your infrastructure.
+## Create Using Zerops GUI
+First, set up a project in Zerops GUI and add a runtime service. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new Shared Storage service:
+### Set a Hostname
+Enter a unique service identifier like "storage", "files" etc. Duplicate services with the same name in the same project are forbidden.
+#### Hostname Limitations:
+- Maximum 25 characters
+- Must contain only lowercase ASCII letters (a-z) or numbers (0-9)
+:::note
+The hostname is fixed after the service is created. It can't be changed later.
+:::
+### Connect to Services
+Select one or more project's runtime services in the Share with Services block:
+
+The new Shared Storage will be connected to the selected runtimes.
+:::note
+Runtime services can be connected and disconnected at any time even after the shared storage is created.
+:::
+### Choose Deployment Mode
+Choose between **Highly Available** (recommended for production) or **Single Container** (suitable for development) deployment.
+:::warning
+The Shared Storage deployment mode is fixed after the service is created. It can't be changed later.
+See [Technical Details](/shared-storage/technical-details#deployment-modes) for more information about deployment modes.
+:::
+### Set Auto Scaling Configuration
+Configure vertical auto scaling parameters to control resource allocation and costs.
+
+:::note
+For detailed information about auto scaling capabilities and recommendations, see [Technical Details](/shared-storage/technical-details#auto-scaling-configuration).
+:::
+## Create Using zCLI
+zCLI is the Zerops command-line tool. To create a new Shared Storage service via the command-line, follow these steps:
+1. [Install & setup zCLI](/references/cli)
+2. Create a project description file
+3. Create a project with a runtime and a Shared Storage service
+### Choose Your Runtime
+export const languages = [
+ { name: "Node.js", link: "/nodejs/how-to/shared-storage#create-nodejs-service-with-a-shared-storage-using-zcli" },
+ { name: "PHP", link: "/php/how-to/shared-storage#create-php-service-with-a-shared-storage-using-zcli" },
+ { name: "Python", link: "/python/how-to/shared-storage#create-python-service-with-a-shared-storage-using-zcli" },
+ { name: "Go", link: "/go/how-to/shared-storage#create-go-service-with-a-shared-storage-using-zcli" },
+ { name: ".NET", link: "/dotnet/how-to/shared-storage#create-dotnet-service-with-a-shared-storage-using-zcli" },
+ { name: "Rust", link: "/rust/how-to/shared-storage#create-rust-service-with-a-shared-storage-using-zcli" }
+]
+
+----------------------------------------
+
+# Shared Storage > How To > Manage
+
+Zerops Shared Storage provides several web interfaces to manage, monitor, and troubleshoot your storage. These interfaces are accessible through the [Zerops VPN](/references/vpn) and offer different capabilities for managing your data and monitoring system performance.
+## Access Web Interfaces
+### Filer UI
+* `http://.zerops:8888`
+The Filer UI provides a web-based interface for managing files and directories in your Shared Storage:
+- Browse the directory structure and create new directories
+- Upload new files (up to 64MB) and download existing files
+- Rename and delete files and directories
+### Master UI
+* `http://node-stable-1.db..zerops:9333`
+The Master UI provides system status and monitoring information:
+- View cluster topology
+- Monitor volume servers
+- Check system status and health
+- View statistics and metrics
+### Volume UI
+* `http://node-stable-.db..zerops:8080/ui/index.html`
+The Volume UI allows you to monitor individual storage volumes:
+- View volume status
+- Check disk usage
+- Monitor I/O operations
+- View volume statistics
+## Monitoring
+Several options are available to help you monitor your Shared Storage:
+### Runtime Service Logs
+* Navigate to your runtime service detail page → **Runtime Logs** section → filter using the tag `zerops-mount-`
+### Shared Storage Logs
+* Access from the Shared Storage service detail page → **Runtime Logs** tab → browse or search for relevant information
+### System and Volume Status
+* Monitor replication status, disk usage, and performance metrics through the Master UI and Volume UI
+
+----------------------------------------
+
+# Shared Storage > How To > Use
+
+Once a Shared Storage is [connected](/shared-storage/how-to/connect) to a runtime service, Zerops will create a new folder `/mnt/[shared storage name]` in the runtime service's filesystem.
+For example, `/mnt/teststorage` for a `teststorage` Shared Storage:
+
+:::note
+The content of this folder is shared among all containers of the connected runtime service.
+If you connect multiple runtimes, the content of the folder will be shared among all containers of these services.
+:::
+## Mount Points and Multiple Volumes
+- Multiple storage volumes can be mounted to a single service (e.g., `/mnt/files1`, `/mnt/files2`, etc.)
+- Shared storage mount is only available in runtime containers, not during build and prepare runtime phases
+- All filesystem operations are automatically logged to runtime logs
+For technical details about mount behavior and filesystem capabilities, see the [Technical Details](/shared-storage/technical-details#mount-integration) page.
+## Use Cases
+Shared Storage is ideal for:
+- **Persistent filesystem-based databases**: SQLite, Prometheus DB, etc.
+- **Configuration sharing**: Deploy configurations once and share across multiple services
+ - Example: Deploy Apache Airflow configurations and DAG files once and share with all worker nodes
+- **Alternative to object storage**: For applications that require filesystem semantics rather than object storage
+- **Application data**: Store and serve images, documents, and other assets
+## Performance Considerations
+When using Shared Storage, keep in mind:
+- For write-heavy workloads, consider batching operations
+- Minimize operations with many small files for better performance
+For more detailed information about performance constraints and limitations, see the [Technical Details](/shared-storage/technical-details#performance-considerations) page.
+## Troubleshooting
+### Common Issues
+- The `df` command may show incorrect or misleading information when used with shared storage mounts. Please refer to the Zerops GUI for accurate storage metrics.
+
+----------------------------------------
+
+# Shared Storage > Overview
+
+# Shared Storage
+Zerops provides a fully managed and scaled **Shared Storage** service, which can be mounted to your runtime services. It offers:
+- Persistent file sharing between containers of the same service or different services
+- Standard filesystem operations through a POSIX-compatible interface
+- Built-in high-availability configuration
+## Documentation Sections
+*Need help? Join our [Discord community](https://discord.gg/zeropsio).*
+## Popular Guides
+
+----------------------------------------
+
+# Shared Storage > Tech Details
+
+Zerops Shared Storage is built on [SeaweedFS](https://github.com/seaweedfs/seaweedfs), a distributed filesystem optimized for high-volume storage with efficient retrieval.
+## Architecture
+Shared Storage consists of three main components:
+- **Master Server**: Manages metadata and coordinates volume servers
+- **Volume Servers**: Store the actual file data
+- **Filer**: Provides a POSIX-compatible interface for file operations
+An **automatic vacuum process** helps maintain optimal storage performance by reclaiming space from deleted files. This process is triggered when the size of deleted content exceeds 15% (reduced from the default 30%).
+### Mount Integration
+When connected to a runtime service:
+- Storage is mounted at `/mnt/`
+- Mount point is owned by the `zerops` user and group (no sudo required)
+- All filesystem operations are logged to runtime logs (tagged as `zerops-mount-`)
+- Mounting will overwrite any existing content in the mount directory
+- Shared storage mount is only available in runtime containers, not during build and prepare runtime phases
+## Deployment Modes
+Zerops provides Shared Storage in two deployment modes:
+### Highly Available
+Recommended for production environments where data reliability is critical.
+- **Architecture**: 2 volume servers with the master located on one of them
+- **Data Durability**: Data and filer metadata are replicated 1:1 across nodes
+- **Fault Tolerance**:
+ - If a node fails, an automatic repair process begins
+ - A new container replaces the failed one
+ - Data is automatically replicated to the new container (duration depends on data size)
+ - During master node failure, mounted directories become temporarily unavailable until the new master initializes (~30s)
+### Single Container
+Suitable for development environments or non-critical data storage.
+- **Architecture**: Master, volume, and filer server all located on a single container
+- **Data Durability**: All data is lost if the container fails
+- **Recommended For**: Development environments or temporary data storage
+:::warning
+The deployment mode is fixed after the service is created and cannot be changed later.
+:::
+## Filesystem Capabilities
+Shared Storage supports standard POSIX filesystem operations:
+- Create, read, update, and delete files and directories
+- Set permissions (with some limitations)
+- Standard file locking operations
+- Hard and symbolic links
+- Directory listing and traversal
+For a complete list of supported features, see the [SeaweedFS FUSE documentation](https://github.com/seaweedfs/seaweedfs/wiki/FUSE-Mount#supported-features).
+## Resource Constraints
+### Storage Limits
+- Maximum storage space: 60GB (can be increased via support request)
+- Maximum file size: Unlimited within the 60GB total storage constraint
+- Maximum upload size via Filer UI: 64MB
+### Memory Usage
+- Base memory consumption: ~60MB when idle
+- Peak memory usage: ~150MB under higher filesystem loads
+- Optimized for low RAM usage (may trade off some performance)
+### Performance Considerations
+- **Latency**: Higher latency compared to local storage due to network-based distributed architecture
+- **Write Performance**: For write-heavy workloads, consider batching operations
+- **Small Files**: Minimize operations with many small files for better performance
+## Auto Scaling Configuration
+Zerops scales Shared Storage services automatically by raising or lowering the hardware resources of each database container.
+Vertical auto scaling has the following default configuration:
+For most cases, the default parameters will work without issues. If you need to limit the cost of the Shared Storage service, lower the maximal resources. Zerops will never scale above the selected maximums.
+When you are experiencing problems with insufficient Shared Storage performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
+:::note
+You can change the auto scaling parameters later.
+:::
+
+----------------------------------------
+
+# Static > Overview
+
+The Static service provides a streamlined way to serve static content through a pre-configured Nginx setup. It's designed to be simple to use while maintaining the flexibility needed for modern web applications.
+ Deploy an Analog app with static hosting in seconds. All you need is a Zerops account.
+
+## Quick Start
+Add a Static service to your project by including this in your `zerops.yaml`:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ run:
+ os: alpine
+ base: static
+```
+The Static service comes with sensible defaults that work out of the box for most SPAs and static websites. By default, without any `routing` configuration, the service will:
+1. Try to serve the exact path (`$uri`)
+2. Try with .html extension (`$uri.html`)
+3. Look for an index.html in the directory (`$uri/index.html`)
+4. Fall back to `/index.html`
+5. Return 404 if none of the above exist
+:::note Zero Configuration for SPAs
+This means for basic SPA deployments or static file hosting, you don't need to specify any redirects at all!
+:::
+## Routing Configuration
+The Static service allows you to configure URL routing and redirects through a simple YAML configuration, abstracting away the complexity of Nginx configuration.
+### Basic Structure
+Configure routing in the `run.routing` section of your `zerops.yaml`:
+```yaml title="zerops.yaml"
+run:
+ routing:
+ redirects:
+ - from: /*
+ to: /index.html
+ status: 302
+```
+### Redirect Types
+#### Relative Redirects
+Use relative redirects to route paths within your application. When both `from` and `to` are relative paths, you can omit the `status` code to create a masked redirect that shows the content of the target page while preserving the original URL:
+```yaml title="zerops.yaml"
+routing:
+ redirects:
+ # Masked redirect - URL stays the same but shows content from index.html
+ - from: /*
+ to: /index.html
+ # Standard redirect with status code
+ - from: /old-page
+ to: /new-page
+ status: 301
+ # Preserve the path when redirecting between directories
+ - from: /blog/*
+ to: /articles/
+ preservePath: true
+ status: 302
+ # Preserve both path and query parameters
+ - from: /posts/*
+ to: /blog/
+ preservePath: true
+ preserveQuery: true
+ status: 302
+```
+:::caution Important
+When using `preservePath` with wildcards, ensure the `to` path ends with a `/` to maintain proper path concatenation. For example, `/blog/*` to `/new-blog/` will correctly redirect `/blog/hello.html` to `/new-blog/hello.html`, while `/new-blog` would result in `/new-bloghello.html`.
+:::
+#### Absolute Redirects
+For redirecting between domains or to external URLs, use absolute redirects by including `http://` or `https://`. When using absolute URLs in either `from` or `to`, you must specify a `status` code:
+```yaml title="zerops.yaml"
+routing:
+ redirects:
+ # Redirect an old domain to a new one
+ - from: https://old-domain.com/*
+ to: https://new-domain.com
+ status: 301
+ preserveQuery: true # Optional: maintain query parameters
+ # Redirect with path preservation
+ - from: https://old-site.com/*
+ to: https://new-site.com/
+ status: 301
+ preservePath: true
+```
+### Advanced Routing Features
+#### Wildcard Matching
+Use `*` as a wildcard in your paths:
+- **At the end of a path**: Matches any subsequent content
+- **At the start of a domain** (after `https://`): Enables regex matching for subdomains
+Example of complex domain management:
+```yaml title="zerops.yaml"
+run:
+ routing:
+ redirects:
+ # Redirect a specific domain to an article
+ - from: https://promo-domain.com/*
+ to: https://main-site.com/special-offer
+ status: 302
+ # Redirect all subdomains to main site
+ - from: https://*.old-domain.com/*
+ to: https://main-site.com
+ status: 302
+```
+#### Matching Priority
+When multiple redirects are configured, they follow Nginx's matching priority system:
+1. Exact matches are checked first
+2. Simple path matches (without wildcards) are checked next
+3. Pattern matches (with wildcards) are checked last, in the order they appear in your configuration
+For example:
+```yaml title="zerops.yaml"
+routing:
+ redirects:
+ # Exact match for homepage - standard redirect
+ - from: /
+ to: /home
+ status: 302
+ # Simple path match - masked redirect
+ - from: /about
+ to: /about-us
+ # Pattern match with path preservation
+ - from: /blog/*
+ to: /articles/
+ preservePath: true
+ status: 302
+ # Catch-all pattern - masked redirect for SPA
+ - from: /*
+ to: /index.html
+```
+In this configuration:
+- `/` will redirect to `/home` with a 302 status
+- `/about` will show content from `/about-us` but keep the URL as `/about`
+- `/blog/post-123.html` will redirect to `/articles/post-123.html`
+- Any other path will show the content from `/index.html` while preserving the original URL (common for SPAs)
+## Prerender Integration
+The Static service includes built-in support for Prerender.io, making it easy to implement server-side rendering for search engines and social media crawlers.
+### Basic Prerender Setup
+1. Set the `PRERENDER_TOKEN` secret variable with your Prerender.io token
+2. The service automatically configures necessary rewrites based on user agents
+### Custom Prerender Host
+If you're using a custom Prerender host, add it to environment variables in `zerops.yaml`:
+```yaml
+run:
+ envVariables:
+ - PRERENDER_HOST=your.prerender.host
+```
+:::note Default
+The default host is `service.prerender.io` if not specified.
+:::
+## Advanced Configuration
+### Switching to Full Nginx
+If you need more control over your Nginx configuration:
+1. Go to your Static service overview in the UI
+2. Click the three vertical dots in the left panel
+3. Select **Need to switch to full Nginx service?**
+4. Copy the generated Nginx configuration
+5. Use this configuration as a starting point for a full Nginx service
+:::tip
+This allows you to graduate to a more customizable setup while maintaining your existing routing logic.
+:::
+## Best Practices
+1. **SPA Configuration**
+ ```yaml title="zerops.yaml"
+ routing:
+ redirects:
+ - from: /*
+ to: /index.html
+ status: 302
+ ```
+ Use this configuration for Single Page Applications to ensure all routes are handled by your application.
+2. **Domain Migration**
+ ```yaml title="zerops.yaml"
+ routing:
+ redirects:
+ - from: https://old-domain.com/*
+ to: https://new-domain.com
+ status: 301
+ ```
+ Use permanent (301) redirects when permanently moving content to maintain SEO value.
+3. **Complex Redirects**
+ Order your redirects from most specific to most general to ensure proper routing:
+ ```yaml title="zerops.yaml"
+ routing:
+ redirects:
+ - from: /specific-path/*
+ to: /specific-landing
+ status: 302
+ - from: /*
+ to: /index.html
+ status: 302
+ ```
+## Frontend Framework Integration
+The Static service seamlessly integrates with modern frontend frameworks. It can serve built static files from any framework while maintaining the option to add custom routing and Prerender.io integration if needed.
+### Example: Analog App Deployment
+Here's a simple configuration for deploying an [Analog application](https://github.com/zeropsio/recipe-analog-static):
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ base: nodejs@20
+ buildCommands:
+ - pnpm i
+ - pnpm build
+ deployFiles:
+ - dist/analog/public/~
+ run:
+ base: static
+```
+This configuration:
+1. Uses Node.js 20 for building the application
+2. Installs dependencies with pnpm
+3. Builds the application
+4. Deploys the resulting static files to the Static service
+You can enhance this basic setup by adding:
+- Custom redirects for URL management
+- Prerender.io integration for SEO
+- Additional routing rules as needed
+## Common Configurations
+### Multiple Domain Management
+```yaml title="zerops.yaml"
+run:
+ routing:
+ redirects:
+ # Product-specific domain
+ - from: https://product-promo.com/*
+ to: https://main-site.com/products
+ status: 302
+ # Campaign domain
+ - from: https://special-offer.com/*
+ to: https://main-site.com/campaign
+ status: 302
+ # Legacy domains and subdomains
+ - from: https://*.legacy-domain.com/*
+ to: https://main-site.com
+ status: 302
+```
+### Development Setup
+```yaml title="zerops.yaml"
+run:
+ routing:
+ redirects:
+ # API requests
+ - from: /api/*
+ to: https://api.your-domain.com
+ status: 302
+ # SPA fallback
+ - from: /*
+ to: /index.html
+ status: 302
+```
+
+----------------------------------------
+
+# Typesense > Overview
+
+Zerops provides a fully managed [Typesense search engine](https://typesense.org/) service that combines developer productivity with enterprise-grade reliability. The platform handles infrastructure complexity through automated deployment, scaling, and maintenance while providing developers full access to Typesense's native capabilities.
+## Supported Versions
+Currently supported Typesense version:
+Import configuration version:
+## Service Configuration
+Our Typesense implementation comes with carefully tuned defaults that diverge from the [standard Typesense configuration](https://typesense.org/docs/27.1/api/server-configuration.html#using-command-line-arguments) in the following ways:
+```yaml
+thread-pool-size: 16
+num-collections-parallel-load: 8
+```
+These defaults are optimized for most common use cases and managed by the platform. If you need to adjust these settings, please contact us through our [support channels](#support).
+### Data Persistence
+Typesense data is automatically persisted to disk at `/var/lib/typesense`.
+This ensures that data remains intact during service restarts (Typesense automatically reloads the persisted data into memory upon startup).
+This persistence mechanism works in both HA and non-HA deployment modes, though with different reliability guarantees as detailed below.
+### Deployment Modes
+:::warning
+The choice between HA and non-HA mode must be made during service creation and cannot be changed later. Make sure to carefully consider your requirements before deploying.
+:::
+#### Non-HA Mode
+- Suitable for development and testing
+- Data persistence not guaranteed during node failures
+- Lower resource requirements
+#### HA Mode
+- Implements Typesense's native [**Raft consensus**](https://typesense.org/docs/guide/high-availability.html) mechanism for data replication
+- Deploys as a **3-node cluster by default** for optimal reliability
+ - Scaling configuration of 3-5 or 3-7 nodes for higher workloads is possible upon request (contact [support](#support) to configure custom node ranges)
+- Includes **built-in data synchronization** across all nodes
+- Features **automatic leader election** to maintain cluster availability
+ - Recovery typically takes up to 1 minute during node failures or leader transitions
+ - During these periods, requests may temporarily receive `503 Not Ready or Lagging` or `500 Could not find a leader` responses
+ - These states automatically resolve once consensus is reestablished
+### API Key Management
+The master API key is automatically generated and managed by the platform. You can access it through:
+- The service access details in the Zerops GUI
+- The `apiKey` environment variable in your service configuration
+:::warning
+Currently, as a security-focused design decision, the master API key cannot be modified after generation.
+:::
+### CORS Configuration
+Your Typesense instance comes with CORS enabled by default, ensuring seamless integration with frontend applications. Browser-based clients can directly access the instance by providing the `X-Typesense-Api-Key` header, maintaining security while enabling straightforward client-side implementation.
+## Network Architecture & Access Patterns
+### Access Methods
+#### HTTPS Access
+When using HTTPS access (either through Zerops subdomain or custom domain), traffic is distributed across nodes via our integrated Nginx proxy layer. This provides a single access point that handles load balancing automatically.
+For enabling HTTPS access:
+1. Configure through the [Zerops access documentation](/features/access)
+2. Or use `enableSubdomainAccess: true` when [importing](/references/import#service-configuration) a Typesense service
+#### Direct Node Access
+Allows to access individual nodes using internal DNS:
+1. **Via [Zerops VPN](/references/vpn)**
+2. **Internal Project Access** - services within the same project can reach nodes directly
+Node addressing patterns:
+##### Standard format
+**Format:**```node{n}.db.{hostname}.zerops```
+- e.g. `node1.db.typesenseha.zerops`, `node2.db.typesenseha.zerops`
+##### Stable DNS records
+**Format:**```node-stable-{n}.db.{hostname}.zerops```
+- **maintain consistent IP mapping** until node retirement (scaling down or failure events)
+- e.g. `node-stable-1.db.typesenseha.zerops`, `node-stable-2.db.typesenseha.zerops`
+## Quick Start Example
+Here's a simple example of using Typesense with the JavaScript client:
+```javascript
+const client = new TypesenseClient({
+ nodes: [{
+ host: 'your-service.zerops.dev', // Your Zerops subdomain
+ port: '443',
+ protocol: 'https'
+ }],
+ apiKey: process.env.TYPESENSE_API_KEY,
+ connectionTimeoutSeconds: 2
+})
+// Create a collection
+await client.collections().create({
+ name: 'companies',
+ fields: [
+ { name: 'company_name', type: 'string' },
+ { name: 'num_employees', type: 'int32' },
+ { name: 'country', type: 'string', facet: true }
+ ],
+ default_sorting_field: 'num_employees'
+})
+// Example search query
+const searchResults = await client.collections('companies')
+ .documents()
+ .search({
+ q: 'tech',
+ query_by: 'company_name',
+ filter_by: 'country:=USA',
+ sort_by: 'num_employees:desc'
+ })
+```
+## Best Practices
+#### API Key Security
+- Never expose the master API key in client-side code
+- Generate scoped search-only API keys for frontend applications
+- Rotate API keys periodically through your service configuration
+#### High Availability
+- Implement retry logic in clients for handling temporary unavailability
+- Use stable DNS records for direct node access when needed
+#### Performance Optimization
+- Utilize batch operations for bulk updates
+- Configure appropriate timeout values based on your use case
+- Consider data volume when designing collection schemas
+## Support
+For advanced configurations or custom requirements:
+- Join our [Discord community](https://discord.gg/zeropsio)
+- Contact support via [email](mailto:support@zerops.io)
+
+----------------------------------------
+
+# Valkey > Overview
+
+Valkey is a powerful, open-source alternative to Redis, offering full compatibility with Redis clients while providing an independent development path focused on community-driven innovation. Deploy and manage Valkey on Zerops' fully managed infrastructure to get instant access to high-performance in-memory data storage.
+:::tip
+Valkey is our recommended Redis alternative as KeyDB's development has slowed significantly in recent times.
+:::
+## Supported Versions
+Currently supported Valkey versions:
+Import configuration version:
+## Service Configuration
+Zerops offers Valkey in two deployment configurations to meet different availability requirements.
+## Deployment Options
+### Non-HA Setup
+- Single node deployment on port `6379` (non-TLS) and `6380` (TLS)
+- No backup mechanism beyond Zerops infrastructure reliability
+- Data persists unless the hardware node fails
+- Suitable for development or non-critical workloads
+### HA (High Availability) Setup
+Our HA implementation uses a unique approach to ensure high availability while maintaining compatibility with all Redis clients:
+- 3-node configuration (1 master + 2 replicas)
+- Access ports:
+ - `6379` - read/write operations (non-TLS, routed to master)
+ - `6380` - read/write operations over TLS (routed to master)
+ - `7000` - read-only operations (non-TLS)
+ - `7001` - read-only operations over TLS
+- Implementation details:
+ - All nodes are configured identically and listen on standard ports
+ - First node in the cluster is designated as the master
+ - On replica nodes, ports `6379`/`6380` traffic is forwarded to the master
+ - Ports `7000`/`7001` are mapped locally to each node for direct replica access
+ - When a master fails, a replica is promoted and routing is updated automatically
+ - DNS entries are updated for seamless client connection
+ - This implementation provides traffic forwarding to master (not natively supported by Valkey)
+:::note
+Be aware that replica data may lag slightly behind the master due to asynchronous replication.
+:::
+## Learn More
+- [Official Valkey Documentation](https://valkey.io/docs) - Comprehensive guide to Valkey features
+## Support
+For advanced configurations or custom requirements:
+- Join our [Discord community](https://discord.gg/zeropsio)
+- Contact support via [email](mailto:support@zerops.io)
+
+----------------------------------------
+
+# Zerops Yaml > Base List
+
+This is a list of all currently supported versions of technologies that can be used for build.base and run.base sections in `zerops.yaml`.
+:::note
+Versions listed on the same line are aliases of the same underlying version.
+:::
+## Runtime services
+
+ Service Type
+ Supported OS
+ Versions
+
+ Build / Runtime
+
+ Bun
+ `ubuntu` / `alpine`
+
+ Deno
+ `ubuntu`
+
+ .NET
+ `ubuntu` / `alpine`
+
+ Elixir
+ `ubuntu` / `alpine`
+
+ Gleam
+ `ubuntu`
+
+ Go
+ `ubuntu` / `alpine`
+
+ Java
+ `ubuntu` / `alpine`
+
+ Node.js
+ `ubuntu` / `alpine`
+
+ Python
+ `ubuntu` / `alpine`
+
+ Rust
+ `ubuntu` / `alpine`
+
+
+
+ Build
+ Runtime
+
+ PHP + Apache
+ `ubuntu` / `alpine`
+
+ PHP + nginx
+ `ubuntu` / `alpine`
+
+## Static services
+
+ Service Type
+ Supported OS
+ Versions
+
+ Build
+ Runtime
+
+ nginx
+ `ubuntu`/`alpine`
+ -
+
+ static
+ `ubuntu`/`alpine`
+ -
+
+## Containers and virtual machines
+
+ Service Type
+ Supported OS
+ Versions
+
+ Build / Runtime
+
+ Alpine
+ `alpine`
+
+ Ubuntu
+ `ubuntu`
+
+
+----------------------------------------
+
+# Zerops Yaml > Cron
+
+Cron jobs are scheduled commands that execute automatically inside a service's containers based on defined timing rules.
+In Zerops, these jobs are configured in the `run` section of `zerops.yaml` file under the `crontab` key.
+## Parameters
+### command
+*string, REQUIRED*
+The shell command to execute at the scheduled time. This can be any valid command.
+### timing
+*string, REQUIRED*
+The schedule for when the task should run, specified in standard cron format using five space-separated fields:
+ - Minute (0–59)
+ - Hour (0–23)
+ - Day of the month (1–31)
+ - Month (1–12)
+ - Day of the week (0–7; both 0 and 7 represent Sunday)
+#### Examples
+ - `"0 5 * * *"` – Runs daily at 5:00 AM.
+ - `"*/10 * * * *"` – Runs every 10 minutes.
+### allContainers
+*boolean, REQUIRED*
+**Options:**
+- `true` – Command runs on all containers.
+- `false` – Command runs on only one container.
+### workingDir
+*string, REQUIRED*
+Specifies the directory where the command will be executed. If not set, it defaults to `/var/www`.
+## Example Configurations
+Here’s a basic example of how to set up a cron job in your service's `zerops.yaml`:
+```yaml
+run:
+ crontab:
+ - command: "date >> /var/log/cron.log"
+ timing: "0 * * * *"
+```
+This configuration logs the current date to `/var/log/cron.log` every hour.
+### Running on Multiple Containers
+By default, cron jobs run on a single container, even if multiple containers exist for the service. To execute a command across all containers, you can use the `allContainers` parameter:
+```yaml
+run:
+ crontab:
+ - command: "rm -rf /tmp/*"
+ timing: "0 0 * * *"
+ allContainers: true
+```
+This example removes temporary files from all containers every day at midnight.
+### Custom Working Directory
+You can also specify a custom working directory for your commands using the `workingDir` parameter:
+```yaml
+run:
+ crontab:
+ - command: "php artisan schedule:run"
+ timing: "* * * * *"
+ workingDir: /var/www/html
+```
+In this case, the command runs every minute in the `/var/www/html` directory.
+### Multiple Cronjobs
+It is possible to define multiple cron jobs as a YAML object list under the `crontab` key.
+```yaml
+run:
+ crontab:
+ - command: ...
+ ...
+ - command: ...
+ ...
+```
+
+----------------------------------------
+
+# Zerops Yaml > Specification
+
+export const languages = [
+ { name: "Node.js", link: "/nodejs/how-to/build-pipeline" },
+ { name: "PHP", link: "/php/how-to/build-pipeline" },
+ { name: "Python", link: "/python/how-to/build-pipeline" },
+ { name: "Go", link: "/go/how-to/build-pipeline" },
+ { name: ".NET", link: "/dotnet/how-to/build-pipeline" },
+ { name: "Rust", link: "/rust/how-to/build-pipeline" },
+ { name: "Java", link: "/java/how-to/build-pipeline" },
+ { name: "Nginx", link: "/nginx/how-to/build-pipeline" }
+]
+The `zerops.yaml` file is crucial for defining how Zerops should [build and deploy](/features/pipeline) your application.
+Add the `zerops.yaml` file to the **root of your repository** and customize it to suit your application's needs.
+---
+## Basic Structure
+```yaml title="zerops.yaml"
+zerops:
+ - setup:
+ build: ...
+ run: ...
+```
+- The top-level element is always `zerops`.
+- `setup` contains the **hostname** of your service (must exist in Zerops).
+- Multiple services can be defined in a single `zerops.yaml` (useful for monorepos):
+```yaml
+zerops:
+ - setup: app
+ build: ...
+ run: ...
+ - setup: api
+ build: ...
+ run: ...
+```
+Each service configuration requires `build` and `run` sections. An optional `deploy` section can be added for readiness checks.
+## Service Inheritance
+### extends
+The `extends` key allows you to inherit configuration from another service defined in the same `zerops.yaml` file. This is useful for creating environment-specific configurations while maintaining a common base.
+```yaml
+zerops:
+ - setup: base
+ build:
+ buildCommands:
+ - echo "hello"
+ deployFiles: ./
+ run:
+ start: server run
+ - setup: prod
+ extends: base
+ run:
+ crontab:
+ - command: xyz
+ allContainers: false
+ timing: "* * * * *"
+ - setup: dev
+ extends: base
+ run:
+ crontab:
+ - command: different command
+ allContainers: false
+ timing: "* * * * *"
+```
+When using `extends`:
+- The `extends` value must refer to another service's `setup` value in the same file
+- The child service inherits all configuration from the base service
+- Configuration is merged at the section level (`build`, `run`, `deploy`)
+- You can override specific sections by redefining them
+:::tip
+Create a base service with common configuration and extend it for environment-specific services to keep your `zerops.yaml` file DRY (Don't Repeat Yourself).
+:::
+## Build Configuration
+### base
+Sets the base technology for the build environment. [See available options](/zerops-yaml/base-list).
+```yaml
+build:
+ base: nodejs@latest
+```
+You can specify multiple technologies:
+```yaml
+build:
+ base:
+ - nodejs@latest
+ prepareCommands:
+ - zsc add python@3.9
+```
+### os
+Sets the operating system for the build environment. Options:
+- `alpine` (default)
+- `ubuntu`
+Current versions:
+- {data.alpine.default}
+- {data.ubuntu.default}
+```yaml
+build:
+ os: ubuntu
+```
+### prepareCommands
+Customizes the build environment by installing additional dependencies or tools.
+```yaml
+build:
+ prepareCommands:
+ - apt-get update
+ - apt-get install -y some-package
+```
+### buildCommands
+Defines the commands to build your application.
+```yaml
+build:
+ buildCommands:
+ - npm install
+ - npm run build
+```
+#### Running commands in a single shell instance:
+```yaml
+buildCommands:
+ - |
+ npm install
+ npm run build
+```
+### deployFiles
+Specifies which files or folders to deploy after a successful build.
+```yaml
+build:
+ deployFiles:
+ - dist
+ - package.json
+ - node_modules
+```
+The files/folders will be placed into `/var/www` folder in runtime, e.g. `./src/assets/fonts` would result in `/var/www/src/assets/fonts`.
+#### Using wildcards:
+Zerops supports the `~` character as a wildcard for one or more folders in the path.
+Deploys all `file.txt` files that are located in any path that begins with `/path/` and ends with `/to/`.
+```yaml
+deployFiles: ./path/~/to/file.txt
+```
+By default, `./src/assets/fonts` deploys to `/var/www/src/assets/fonts`, keeping the full path. Adding `~`, like `./src/assets/~fonts`, shortens it to `/var/www/fonts`
+#### .deployignore
+Add a `.deployignore` file to the root of your project to specify which files and folders Zerops should ignore during deploy. The syntax follows the same pattern format as `.gitignore`.
+To ignore a specific file or directory path, start the pattern with a forward slash (`/`). Without the leading slash, the pattern will match files with that name in any directory.
+:::tip
+For consistency, it's recommended to configure both your `.gitignore` and `.deployignore` files with the same patterns.
+:::
+Examples:
+```yaml title="zerops.yaml"
+zerops:
+ - setup: app
+ build:
+ deployFiles: ./
+```
+```text title=".deployignore"
+/src/file.txt
+```
+The example above ignores `file.txt` only in the root src directory.
+```text title=".deployignore"
+src/file.txt
+```
+This example above ignores `file.txt` in ANY directory named `src`, such as:
+- `/src/file.txt`
+- `/folder2/folder3/src/file.txt`
+- `/src/src/file.txt`
+:::note
+`.deployignore` file also works with `zcli service deploy` command.
+:::
+### cache
+Defines which files or folders to cache for subsequent builds.
+```yaml
+build:
+ cache: node_modules
+```
+For more information, see our detailed [guide on build cache](/features/build-cache), complete with extensive examples.
+### envVariables
+Sets environment variables for the build environment.
+```yaml
+build:
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+:::info
+The `yamlPreprocessor` option in your project & service import YAML allows you to generate random secret values, passwords, and public/private key pairs. For more information, see the [yamlPreprocessor](/references/import-yaml/pre-processor) page.
+:::
+## Runtime Configuration
+### base
+Sets the base technology for the runtime environment. If not specified, the current version is maintained.
+```yaml
+run:
+ base: nodejs@latest
+```
+### os
+Sets the operating system for the runtime environment. Options and versions are the same as for the build environment.
+### ports
+Specifies the internal ports on which your application will listen.
+```yaml
+run:
+ ports:
+ - port: 8080
+ protocol: TCP # Optional
+ httpSupport: true # Optional
+ - port: 8081
+ ...
+```
+Available parameters:
+#### port
+Defines the port number on which your application listens. Must be between *10* and *65435*, as ports outside this range are reserved for internal Zerops systems.
+#### protocol
+Specifies the network protocol to use:
+- Allowed values: `TCP` *(default)* or `UDP`
+#### httpSupport
+Indicates whether the port is running a web server:
+- Default value: `true`
+- Set to `false` if a web server isn't running on the port
+- Only available with TCP protocol
+- Used by Zerops for [public access](/features/access) configuration
+### prepareCommands
+Customizes the runtime environment by installing additional dependencies or tools.
+### addToRunPrepare
+Defines files or folders to be copied from the build container to the prepare runtime container.
+### initCommands
+Defines commands to run each time a new runtime container starts or restarts.
+```yaml
+run:
+ initCommands:
+ - rm -rf ./cache
+```
+### start
+Defines the start command for your application.
+```yaml
+run:
+ start: npm start
+```
+### startCommands
+Defines start commands
+Unlike `start`, you can define multiple commands that starts their own processes.
+```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
+```
+See [start-commands-example](https://github.com/zeropsio/start-commands-example)
+### documentRoot
+Customizes the root folder for publicly accessible web server content (available only for webserver runtimes).
+### siteConfigPath
+Sets the custom webserver configuration (available only for webserver runtimes).
+### envVariables
+Defines environment variables for the runtime environment.
+```yaml
+ run:
+ base: nodejs@20
+ envVariables:
+ DB_NAME: db
+ DB_HOST: db
+ DB_USER: db
+ DB_PASS: ${db_password}
+```
+### healthCheck
+Defines a health check for your application.
+```yaml
+run:
+ healthCheck:
+ httpGet:
+ port: 80
+ path: /status
+```
+### crontab
+ Defines scheduled commands to run as cron jobs within a service.
+ ```yaml
+ run:
+ crontab:
+ - command: "date >> /var/log/cron.log"
+ timing: "0 * * * *"
+ ```
+Setup cron jobs. See [examples](/references/cron).
+## Deploy Configuration
+### readinessCheck
+Defines a readiness check for your application. (See [readiness checks](/features/pipeline#readiness-checks))
+```yaml
+deploy:
+ readinessCheck:
+ httpGet:
+ port: 80
+ path: /status
+ host: 127.0.0.1
+ scheme: https
+ # Or use commands
+ exec:
+ command: |
+ touch grass
+ rm -rf life
+ mv /outside/user /home/user
+```
+:::note
+For more detailed information on specific configurations, refer to the runtime-specific guides linked at the beginning of this document.
+:::
+---
+
+----------------------------------------
+
diff --git a/apps/docs/static/llms.txt b/apps/docs/static/llms.txt
new file mode 100644
index 000000000..669bfabfa
--- /dev/null
+++ b/apps/docs/static/llms.txt
@@ -0,0 +1,337 @@
+# Zerops
+
+> Zerops is a developer-first Platform-as-a-Service, running on bare metal, with every part built from scratch. Zerops aims to be the perfect mix of developer experience, flexibility, scalability and affordability, making it a great fit for applications of any size, complexity and traffic.
+
+## Docs
+
+- [Full Docs](https://docs.zerops.io/llms-full.txt) Full documentation of Zerops. (without examples)
+- [Tiny Docs](https://docs.zerops.io/llms-small.txt): Tiny documentation of Zerops. (includes only description of core)
+
+## Optional
+
+- [Bun > Getting Started](https://docs.zerops.io/bun/getting-started)
+- [Bun > How To > Access](https://docs.zerops.io/bun/how-to/access)
+- [Bun > How To > Build Pipeline](https://docs.zerops.io/bun/how-to/build-pipeline)
+- [Bun > How To > Build Process](https://docs.zerops.io/bun/how-to/build-process)
+- [Bun > How To > Controls](https://docs.zerops.io/bun/how-to/controls)
+- [Bun > How To > Create](https://docs.zerops.io/bun/how-to/create)
+- [Bun > How To > Customize Runtime](https://docs.zerops.io/bun/how-to/customize-runtime)
+- [Bun > How To > Delete](https://docs.zerops.io/bun/how-to/delete)
+- [Bun > How To > Deploy Process](https://docs.zerops.io/bun/how-to/deploy-process)
+- [Bun > How To > Env Variables](https://docs.zerops.io/bun/how-to/env-variables)
+- [Bun > How To > Filebrowser](https://docs.zerops.io/bun/how-to/filebrowser)
+- [Bun > How To > Logs](https://docs.zerops.io/bun/how-to/logs)
+- [Bun > How To > Scaling](https://docs.zerops.io/bun/how-to/scaling)
+- [Bun > How To > Shared Storage](https://docs.zerops.io/bun/how-to/shared-storage)
+- [Bun > How To > Trigger Pipeline](https://docs.zerops.io/bun/how-to/trigger-pipeline)
+- [Bun > How To > Upgrade](https://docs.zerops.io/bun/how-to/upgrade)
+- [Bun > Overview](https://docs.zerops.io/bun/overview)
+- [Company > About](https://docs.zerops.io/company/about)
+- [Company > Branding](https://docs.zerops.io/company/branding)
+- [Company > Payment](https://docs.zerops.io/company/payment)
+- [Company > Pricing](https://docs.zerops.io/company/pricing)
+- [Deno > Getting Started](https://docs.zerops.io/deno/getting-started)
+- [Deno > How To > Access](https://docs.zerops.io/deno/how-to/access)
+- [Deno > How To > Build Pipeline](https://docs.zerops.io/deno/how-to/build-pipeline)
+- [Deno > How To > Build Process](https://docs.zerops.io/deno/how-to/build-process)
+- [Deno > How To > Controls](https://docs.zerops.io/deno/how-to/controls)
+- [Deno > How To > Create](https://docs.zerops.io/deno/how-to/create)
+- [Deno > How To > Customize Runtime](https://docs.zerops.io/deno/how-to/customize-runtime)
+- [Deno > How To > Delete](https://docs.zerops.io/deno/how-to/delete)
+- [Deno > How To > Deploy Process](https://docs.zerops.io/deno/how-to/deploy-process)
+- [Deno > How To > Env Variables](https://docs.zerops.io/deno/how-to/env-variables)
+- [Deno > How To > Filebrowser](https://docs.zerops.io/deno/how-to/filebrowser)
+- [Deno > How To > Logs](https://docs.zerops.io/deno/how-to/logs)
+- [Deno > How To > Scaling](https://docs.zerops.io/deno/how-to/scaling)
+- [Deno > How To > Shared Storage](https://docs.zerops.io/deno/how-to/shared-storage)
+- [Deno > How To > Trigger Pipeline](https://docs.zerops.io/deno/how-to/trigger-pipeline)
+- [Deno > How To > Upgrade](https://docs.zerops.io/deno/how-to/upgrade)
+- [Deno > Overview](https://docs.zerops.io/deno/overview)
+- [Docker > Overview](https://docs.zerops.io/docker/overview)
+- [Dotnet > Getting Started](https://docs.zerops.io/dotnet/getting-started)
+- [Dotnet > How To > Access](https://docs.zerops.io/dotnet/how-to/access)
+- [Dotnet > How To > Build Pipeline](https://docs.zerops.io/dotnet/how-to/build-pipeline)
+- [Dotnet > How To > Build Process](https://docs.zerops.io/dotnet/how-to/build-process)
+- [Dotnet > How To > Controls](https://docs.zerops.io/dotnet/how-to/controls)
+- [Dotnet > How To > Create](https://docs.zerops.io/dotnet/how-to/create)
+- [Dotnet > How To > Customize Runtime](https://docs.zerops.io/dotnet/how-to/customize-runtime)
+- [Dotnet > How To > Delete](https://docs.zerops.io/dotnet/how-to/delete)
+- [Dotnet > How To > Deploy Process](https://docs.zerops.io/dotnet/how-to/deploy-process)
+- [Dotnet > How To > Env Variables](https://docs.zerops.io/dotnet/how-to/env-variables)
+- [Dotnet > How To > Filebrowser](https://docs.zerops.io/dotnet/how-to/filebrowser)
+- [Dotnet > How To > Logs](https://docs.zerops.io/dotnet/how-to/logs)
+- [Dotnet > How To > Scaling](https://docs.zerops.io/dotnet/how-to/scaling)
+- [Dotnet > How To > Shared Storage](https://docs.zerops.io/dotnet/how-to/shared-storage)
+- [Dotnet > How To > Trigger Pipeline](https://docs.zerops.io/dotnet/how-to/trigger-pipeline)
+- [Dotnet > How To > Upgrade](https://docs.zerops.io/dotnet/how-to/upgrade)
+- [Dotnet > Overview](https://docs.zerops.io/dotnet/overview)
+- [Elasticsearch > Overview](https://docs.zerops.io/elasticsearch/overview)
+- [Elixir > Getting Started](https://docs.zerops.io/elixir/getting-started)
+- [Elixir > How To > Access](https://docs.zerops.io/elixir/how-to/access)
+- [Elixir > How To > Build Pipeline](https://docs.zerops.io/elixir/how-to/build-pipeline)
+- [Elixir > How To > Build Process](https://docs.zerops.io/elixir/how-to/build-process)
+- [Elixir > How To > Controls](https://docs.zerops.io/elixir/how-to/controls)
+- [Elixir > How To > Create](https://docs.zerops.io/elixir/how-to/create)
+- [Elixir > How To > Customize Runtime](https://docs.zerops.io/elixir/how-to/customize-runtime)
+- [Elixir > How To > Delete](https://docs.zerops.io/elixir/how-to/delete)
+- [Elixir > How To > Deploy Process](https://docs.zerops.io/elixir/how-to/deploy-process)
+- [Elixir > How To > Env Variables](https://docs.zerops.io/elixir/how-to/env-variables)
+- [Elixir > How To > Filebrowser](https://docs.zerops.io/elixir/how-to/filebrowser)
+- [Elixir > How To > Logs](https://docs.zerops.io/elixir/how-to/logs)
+- [Elixir > How To > Scaling](https://docs.zerops.io/elixir/how-to/scaling)
+- [Elixir > How To > Shared Storage](https://docs.zerops.io/elixir/how-to/shared-storage)
+- [Elixir > How To > Trigger Pipeline](https://docs.zerops.io/elixir/how-to/trigger-pipeline)
+- [Elixir > How To > Upgrade](https://docs.zerops.io/elixir/how-to/upgrade)
+- [Elixir > Overview](https://docs.zerops.io/elixir/overview)
+- [Features > Access](https://docs.zerops.io/features/access)
+- [Features > Backup](https://docs.zerops.io/features/backup)
+- [Features > Build Cache](https://docs.zerops.io/features/build-cache)
+- [Features > Cdn](https://docs.zerops.io/features/cdn)
+- [Features > Container Vs Vm](https://docs.zerops.io/features/container-vs-vm)
+- [Features > Dns](https://docs.zerops.io/features/dns)
+- [Features > Env Variables](https://docs.zerops.io/features/env-variables)
+- [Features > Infrastructure](https://docs.zerops.io/features/infrastructure)
+- [Features > Pipeline](https://docs.zerops.io/features/pipeline)
+- [Features > Scaling Ha](https://docs.zerops.io/features/scaling-ha)
+- [Frameworks > Laravel](https://docs.zerops.io/frameworks/laravel)
+- [Frameworks > Laravel > Cron](https://docs.zerops.io/frameworks/laravel/cron)
+- [Frameworks > Laravel > Env Variables](https://docs.zerops.io/frameworks/laravel/env-variables)
+- [Frameworks > Laravel > Faq](https://docs.zerops.io/frameworks/laravel/faq)
+- [Frameworks > Laravel > Introduction](https://docs.zerops.io/frameworks/laravel/introduction)
+- [Frameworks > Laravel > Logs](https://docs.zerops.io/frameworks/laravel/logs)
+- [Frameworks > Laravel > Migrations](https://docs.zerops.io/frameworks/laravel/migrations)
+- [Frameworks > Laravel > Recipes > Filament Devel](https://docs.zerops.io/frameworks/laravel/recipes/filament-devel)
+- [Frameworks > Laravel > Recipes > Filament Local](https://docs.zerops.io/frameworks/laravel/recipes/filament-local)
+- [Frameworks > Laravel > Recipes > Filament Prod](https://docs.zerops.io/frameworks/laravel/recipes/filament-prod)
+- [Frameworks > Laravel > Recipes > Jetstream Devel](https://docs.zerops.io/frameworks/laravel/recipes/jetstream-devel)
+- [Frameworks > Laravel > Recipes > Jetstream Local](https://docs.zerops.io/frameworks/laravel/recipes/jetstream-local)
+- [Frameworks > Laravel > Recipes > Jetstream Prod](https://docs.zerops.io/frameworks/laravel/recipes/jetstream-prod)
+- [Frameworks > Laravel > Recipes > Minimal Devel](https://docs.zerops.io/frameworks/laravel/recipes/minimal-devel)
+- [Frameworks > Laravel > Recipes > Minimal Local](https://docs.zerops.io/frameworks/laravel/recipes/minimal-local)
+- [Frameworks > Laravel > Recipes > Minimal Prod](https://docs.zerops.io/frameworks/laravel/recipes/minimal-prod)
+- [Frameworks > Laravel > Recipes > Twill Devel](https://docs.zerops.io/frameworks/laravel/recipes/twill-devel)
+- [Frameworks > Laravel > Recipes > Twill Local](https://docs.zerops.io/frameworks/laravel/recipes/twill-local)
+- [Frameworks > Laravel > Recipes > Twill Prod](https://docs.zerops.io/frameworks/laravel/recipes/twill-prod)
+- [Frameworks > Laravel > Redis](https://docs.zerops.io/frameworks/laravel/redis)
+- [Frameworks > Laravel > Smtp](https://docs.zerops.io/frameworks/laravel/smtp)
+- [Getting Started](https://docs.zerops.io/getting-started)
+- [Gleam > Getting Started](https://docs.zerops.io/gleam/getting-started)
+- [Gleam > How To > Access](https://docs.zerops.io/gleam/how-to/access)
+- [Gleam > How To > Build Pipeline](https://docs.zerops.io/gleam/how-to/build-pipeline)
+- [Gleam > How To > Build Process](https://docs.zerops.io/gleam/how-to/build-process)
+- [Gleam > How To > Controls](https://docs.zerops.io/gleam/how-to/controls)
+- [Gleam > How To > Create](https://docs.zerops.io/gleam/how-to/create)
+- [Gleam > How To > Customize Runtime](https://docs.zerops.io/gleam/how-to/customize-runtime)
+- [Gleam > How To > Delete](https://docs.zerops.io/gleam/how-to/delete)
+- [Gleam > How To > Deploy Process](https://docs.zerops.io/gleam/how-to/deploy-process)
+- [Gleam > How To > Env Variables](https://docs.zerops.io/gleam/how-to/env-variables)
+- [Gleam > How To > Filebrowser](https://docs.zerops.io/gleam/how-to/filebrowser)
+- [Gleam > How To > Logs](https://docs.zerops.io/gleam/how-to/logs)
+- [Gleam > How To > Scaling](https://docs.zerops.io/gleam/how-to/scaling)
+- [Gleam > How To > Shared Storage](https://docs.zerops.io/gleam/how-to/shared-storage)
+- [Gleam > How To > Trigger Pipeline](https://docs.zerops.io/gleam/how-to/trigger-pipeline)
+- [Gleam > How To > Upgrade](https://docs.zerops.io/gleam/how-to/upgrade)
+- [Gleam > Overview](https://docs.zerops.io/gleam/overview)
+- [Go > Getting Started](https://docs.zerops.io/go/getting-started)
+- [Go > How To > Access](https://docs.zerops.io/go/how-to/access)
+- [Go > How To > Build Pipeline](https://docs.zerops.io/go/how-to/build-pipeline)
+- [Go > How To > Build Process](https://docs.zerops.io/go/how-to/build-process)
+- [Go > How To > Controls](https://docs.zerops.io/go/how-to/controls)
+- [Go > How To > Create](https://docs.zerops.io/go/how-to/create)
+- [Go > How To > Customize Runtime](https://docs.zerops.io/go/how-to/customize-runtime)
+- [Go > How To > Delete](https://docs.zerops.io/go/how-to/delete)
+- [Go > How To > Deploy Process](https://docs.zerops.io/go/how-to/deploy-process)
+- [Go > How To > Env Variables](https://docs.zerops.io/go/how-to/env-variables)
+- [Go > How To > Filebrowser](https://docs.zerops.io/go/how-to/filebrowser)
+- [Go > How To > Logs](https://docs.zerops.io/go/how-to/logs)
+- [Go > How To > Scaling](https://docs.zerops.io/go/how-to/scaling)
+- [Go > How To > Shared Storage](https://docs.zerops.io/go/how-to/shared-storage)
+- [Go > How To > Trigger Pipeline](https://docs.zerops.io/go/how-to/trigger-pipeline)
+- [Go > How To > Upgrade](https://docs.zerops.io/go/how-to/upgrade)
+- [Go > Overview](https://docs.zerops.io/go/overview)
+- [Go > Tutorial > Quickstart](https://docs.zerops.io/go/tutorial/quickstart)
+- [Go > Tutorial > Runtime Sql](https://docs.zerops.io/go/tutorial/runtime-sql)
+- [Go > Tutorial > Step By Step](https://docs.zerops.io/go/tutorial/step-by-step)
+- [Help > Contacts](https://docs.zerops.io/help/contacts)
+- [Help > Faq](https://docs.zerops.io/help/faq)
+- [Homepage](https://docs.zerops.io/homepage)
+- [Java > Getting Started](https://docs.zerops.io/java/getting-started)
+- [Java > How To > Access](https://docs.zerops.io/java/how-to/access)
+- [Java > How To > Build Pipeline](https://docs.zerops.io/java/how-to/build-pipeline)
+- [Java > How To > Build Process](https://docs.zerops.io/java/how-to/build-process)
+- [Java > How To > Controls](https://docs.zerops.io/java/how-to/controls)
+- [Java > How To > Create](https://docs.zerops.io/java/how-to/create)
+- [Java > How To > Customize Runtime](https://docs.zerops.io/java/how-to/customize-runtime)
+- [Java > How To > Delete](https://docs.zerops.io/java/how-to/delete)
+- [Java > How To > Deploy Process](https://docs.zerops.io/java/how-to/deploy-process)
+- [Java > How To > Env Variables](https://docs.zerops.io/java/how-to/env-variables)
+- [Java > How To > Filebrowser](https://docs.zerops.io/java/how-to/filebrowser)
+- [Java > How To > Logs](https://docs.zerops.io/java/how-to/logs)
+- [Java > How To > Scaling](https://docs.zerops.io/java/how-to/scaling)
+- [Java > How To > Shared Storage](https://docs.zerops.io/java/how-to/shared-storage)
+- [Java > How To > Trigger Pipeline](https://docs.zerops.io/java/how-to/trigger-pipeline)
+- [Java > How To > Upgrade](https://docs.zerops.io/java/how-to/upgrade)
+- [Java > Overview](https://docs.zerops.io/java/overview)
+- [Keydb > Getting Started](https://docs.zerops.io/keydb/getting-started)
+- [Keydb > How To > Connect](https://docs.zerops.io/keydb/how-to/connect)
+- [Keydb > How To > Control](https://docs.zerops.io/keydb/how-to/control)
+- [Keydb > How To > Create](https://docs.zerops.io/keydb/how-to/create)
+- [Keydb > How To > Delete](https://docs.zerops.io/keydb/how-to/delete)
+- [Keydb > How To > Manage](https://docs.zerops.io/keydb/how-to/manage)
+- [Keydb > How To > Scale](https://docs.zerops.io/keydb/how-to/scale)
+- [Keydb > Overview](https://docs.zerops.io/keydb/overview)
+- [Mariadb > Getting Started](https://docs.zerops.io/mariadb/getting-started)
+- [Mariadb > How To > Backup](https://docs.zerops.io/mariadb/how-to/backup)
+- [Mariadb > How To > Connect](https://docs.zerops.io/mariadb/how-to/connect)
+- [Mariadb > How To > Control](https://docs.zerops.io/mariadb/how-to/control)
+- [Mariadb > How To > Create](https://docs.zerops.io/mariadb/how-to/create)
+- [Mariadb > How To > Delete](https://docs.zerops.io/mariadb/how-to/delete)
+- [Mariadb > How To > Export Import Data](https://docs.zerops.io/mariadb/how-to/export-import-data)
+- [Mariadb > How To > Manage](https://docs.zerops.io/mariadb/how-to/manage)
+- [Mariadb > How To > Scale](https://docs.zerops.io/mariadb/how-to/scale)
+- [Mariadb > Overview](https://docs.zerops.io/mariadb/overview)
+- [Mariadb > Tech Details > Cluster](https://docs.zerops.io/mariadb/tech-details/cluster)
+- [Mariadb > Tech Details > Limitations](https://docs.zerops.io/mariadb/tech-details/limitations)
+- [Mariadb > Tutorial > Quickstart](https://docs.zerops.io/mariadb/tutorial/quickstart)
+- [Mariadb > Tutorial > Step By Step](https://docs.zerops.io/mariadb/tutorial/step-by-step)
+- [Meilisearch > Overview](https://docs.zerops.io/meilisearch/overview)
+- [Nats > Overview](https://docs.zerops.io/nats/overview)
+- [Nginx > Faq](https://docs.zerops.io/nginx/faq)
+- [Nginx > Getting Started](https://docs.zerops.io/nginx/getting-started)
+- [Nginx > How To > Access](https://docs.zerops.io/nginx/how-to/access)
+- [Nginx > How To > Build Pipeline](https://docs.zerops.io/nginx/how-to/build-pipeline)
+- [Nginx > How To > Controls](https://docs.zerops.io/nginx/how-to/controls)
+- [Nginx > How To > Create](https://docs.zerops.io/nginx/how-to/create)
+- [Nginx > How To > Customize Runtime](https://docs.zerops.io/nginx/how-to/customize-runtime)
+- [Nginx > How To > Customize Web Server](https://docs.zerops.io/nginx/how-to/customize-web-server)
+- [Nginx > How To > Delete](https://docs.zerops.io/nginx/how-to/delete)
+- [Nginx > How To > Deploy Process](https://docs.zerops.io/nginx/how-to/deploy-process)
+- [Nginx > How To > Env Variables](https://docs.zerops.io/nginx/how-to/env-variables)
+- [Nginx > How To > Filebrowser](https://docs.zerops.io/nginx/how-to/filebrowser)
+- [Nginx > How To > Logs](https://docs.zerops.io/nginx/how-to/logs)
+- [Nginx > How To > Scaling](https://docs.zerops.io/nginx/how-to/scaling)
+- [Nginx > How To > Shared Storage](https://docs.zerops.io/nginx/how-to/shared-storage)
+- [Nginx > How To > Trigger Pipeline](https://docs.zerops.io/nginx/how-to/trigger-pipeline)
+- [Nginx > How To > Upgrade](https://docs.zerops.io/nginx/how-to/upgrade)
+- [Nginx > Overview](https://docs.zerops.io/nginx/overview)
+- [Nginx > Tutorial > Quickstart](https://docs.zerops.io/nginx/tutorial/quickstart)
+- [Nginx > Tutorial > Runtime Sql](https://docs.zerops.io/nginx/tutorial/runtime-sql)
+- [Nginx > Tutorial > Step By Step](https://docs.zerops.io/nginx/tutorial/step-by-step)
+- [Nodejs > Getting Started](https://docs.zerops.io/nodejs/getting-started)
+- [Nodejs > How To > Access](https://docs.zerops.io/nodejs/how-to/access)
+- [Nodejs > How To > Build Pipeline](https://docs.zerops.io/nodejs/how-to/build-pipeline)
+- [Nodejs > How To > Build Process](https://docs.zerops.io/nodejs/how-to/build-process)
+- [Nodejs > How To > Controls](https://docs.zerops.io/nodejs/how-to/controls)
+- [Nodejs > How To > Create](https://docs.zerops.io/nodejs/how-to/create)
+- [Nodejs > How To > Customize Runtime](https://docs.zerops.io/nodejs/how-to/customize-runtime)
+- [Nodejs > How To > Delete](https://docs.zerops.io/nodejs/how-to/delete)
+- [Nodejs > How To > Deploy Process](https://docs.zerops.io/nodejs/how-to/deploy-process)
+- [Nodejs > How To > Env Variables](https://docs.zerops.io/nodejs/how-to/env-variables)
+- [Nodejs > How To > Filebrowser](https://docs.zerops.io/nodejs/how-to/filebrowser)
+- [Nodejs > How To > Logs](https://docs.zerops.io/nodejs/how-to/logs)
+- [Nodejs > How To > Scaling](https://docs.zerops.io/nodejs/how-to/scaling)
+- [Nodejs > How To > Shared Storage](https://docs.zerops.io/nodejs/how-to/shared-storage)
+- [Nodejs > How To > Trigger Pipeline](https://docs.zerops.io/nodejs/how-to/trigger-pipeline)
+- [Nodejs > How To > Upgrade](https://docs.zerops.io/nodejs/how-to/upgrade)
+- [Nodejs > Overview](https://docs.zerops.io/nodejs/overview)
+- [Object Storage > How To > Access](https://docs.zerops.io/object-storage/how-to/access)
+- [Object Storage > How To > Create](https://docs.zerops.io/object-storage/how-to/create)
+- [Object Storage > How To > Curl File](https://docs.zerops.io/object-storage/how-to/curl-file)
+- [Object Storage > How To > Delete](https://docs.zerops.io/object-storage/how-to/delete)
+- [Object Storage > How To > Update Bucket](https://docs.zerops.io/object-storage/how-to/update-bucket)
+- [Object Storage > Overview](https://docs.zerops.io/object-storage/overview)
+- [Php > Getting Started](https://docs.zerops.io/php/getting-started)
+- [Php > How To > Access](https://docs.zerops.io/php/how-to/access)
+- [Php > How To > Build Pipeline](https://docs.zerops.io/php/how-to/build-pipeline)
+- [Php > How To > Build Process](https://docs.zerops.io/php/how-to/build-process)
+- [Php > How To > Controls](https://docs.zerops.io/php/how-to/controls)
+- [Php > How To > Create](https://docs.zerops.io/php/how-to/create)
+- [Php > How To > Customize Runtime](https://docs.zerops.io/php/how-to/customize-runtime)
+- [Php > How To > Customize Web Server](https://docs.zerops.io/php/how-to/customize-web-server)
+- [Php > How To > Delete](https://docs.zerops.io/php/how-to/delete)
+- [Php > How To > Deploy Process](https://docs.zerops.io/php/how-to/deploy-process)
+- [Php > How To > Env Variables](https://docs.zerops.io/php/how-to/env-variables)
+- [Php > How To > Filebrowser](https://docs.zerops.io/php/how-to/filebrowser)
+- [Php > How To > Logs](https://docs.zerops.io/php/how-to/logs)
+- [Php > How To > Scaling](https://docs.zerops.io/php/how-to/scaling)
+- [Php > How To > Shared Storage](https://docs.zerops.io/php/how-to/shared-storage)
+- [Php > How To > Trigger Pipeline](https://docs.zerops.io/php/how-to/trigger-pipeline)
+- [Php > How To > Upgrade](https://docs.zerops.io/php/how-to/upgrade)
+- [Php > Overview](https://docs.zerops.io/php/overview)
+- [Postgresql > Faq](https://docs.zerops.io/postgresql/faq)
+- [Postgresql > Getting Started](https://docs.zerops.io/postgresql/getting-started)
+- [Postgresql > How To > Connect](https://docs.zerops.io/postgresql/how-to/connect)
+- [Postgresql > How To > Control](https://docs.zerops.io/postgresql/how-to/control)
+- [Postgresql > How To > Create](https://docs.zerops.io/postgresql/how-to/create)
+- [Postgresql > How To > Delete](https://docs.zerops.io/postgresql/how-to/delete)
+- [Postgresql > How To > Export Import Data](https://docs.zerops.io/postgresql/how-to/export-import-data)
+- [Postgresql > How To > Manage](https://docs.zerops.io/postgresql/how-to/manage)
+- [Postgresql > How To > Scale](https://docs.zerops.io/postgresql/how-to/scale)
+- [Postgresql > Overview](https://docs.zerops.io/postgresql/overview)
+- [Python > Getting Started](https://docs.zerops.io/python/getting-started)
+- [Python > How To > Access](https://docs.zerops.io/python/how-to/access)
+- [Python > How To > Build Pipeline](https://docs.zerops.io/python/how-to/build-pipeline)
+- [Python > How To > Build Process](https://docs.zerops.io/python/how-to/build-process)
+- [Python > How To > Controls](https://docs.zerops.io/python/how-to/controls)
+- [Python > How To > Create](https://docs.zerops.io/python/how-to/create)
+- [Python > How To > Customize Runtime](https://docs.zerops.io/python/how-to/customize-runtime)
+- [Python > How To > Delete](https://docs.zerops.io/python/how-to/delete)
+- [Python > How To > Deploy Process](https://docs.zerops.io/python/how-to/deploy-process)
+- [Python > How To > Env Variables](https://docs.zerops.io/python/how-to/env-variables)
+- [Python > How To > Filebrowser](https://docs.zerops.io/python/how-to/filebrowser)
+- [Python > How To > Logs](https://docs.zerops.io/python/how-to/logs)
+- [Python > How To > Scaling](https://docs.zerops.io/python/how-to/scaling)
+- [Python > How To > Shared Storage](https://docs.zerops.io/python/how-to/shared-storage)
+- [Python > How To > Trigger Pipeline](https://docs.zerops.io/python/how-to/trigger-pipeline)
+- [Python > How To > Upgrade](https://docs.zerops.io/python/how-to/upgrade)
+- [Python > Overview](https://docs.zerops.io/python/overview)
+- [Python > Tutorial > Quickstart](https://docs.zerops.io/python/tutorial/quickstart)
+- [Python > Tutorial > Runtime Sql](https://docs.zerops.io/python/tutorial/runtime-sql)
+- [Python > Tutorial > Step By Step](https://docs.zerops.io/python/tutorial/step-by-step)
+- [Qdrant > Overview](https://docs.zerops.io/qdrant/overview)
+- [References > Api](https://docs.zerops.io/references/api)
+- [References > Cli](https://docs.zerops.io/references/cli)
+- [References > Cli > Commands](https://docs.zerops.io/references/cli/commands)
+- [References > Cli > Configuration](https://docs.zerops.io/references/cli/configuration)
+- [References > Debug Mode](https://docs.zerops.io/references/debug-mode)
+- [References > Firewall](https://docs.zerops.io/references/firewall)
+- [References > Github Integration](https://docs.zerops.io/references/github-integration)
+- [References > Gitlab Integration](https://docs.zerops.io/references/gitlab-integration)
+- [References > Import Yaml > Pre Processor](https://docs.zerops.io/references/import-yaml/pre-processor)
+- [References > Import Yaml > Type List](https://docs.zerops.io/references/import-yaml/type-list)
+- [References > Import](https://docs.zerops.io/references/import)
+- [References > Smtp](https://docs.zerops.io/references/smtp)
+- [References > Ssh](https://docs.zerops.io/references/ssh)
+- [References > Vpn](https://docs.zerops.io/references/vpn)
+- [References > Vpn > Troubleshooting](https://docs.zerops.io/references/vpn/troubleshooting)
+- [References > Zsc](https://docs.zerops.io/references/zsc)
+- [Rust > Getting Started](https://docs.zerops.io/rust/getting-started)
+- [Rust > How To > Access](https://docs.zerops.io/rust/how-to/access)
+- [Rust > How To > Build Pipeline](https://docs.zerops.io/rust/how-to/build-pipeline)
+- [Rust > How To > Build Process](https://docs.zerops.io/rust/how-to/build-process)
+- [Rust > How To > Controls](https://docs.zerops.io/rust/how-to/controls)
+- [Rust > How To > Create](https://docs.zerops.io/rust/how-to/create)
+- [Rust > How To > Customize Runtime](https://docs.zerops.io/rust/how-to/customize-runtime)
+- [Rust > How To > Delete](https://docs.zerops.io/rust/how-to/delete)
+- [Rust > How To > Deploy Process](https://docs.zerops.io/rust/how-to/deploy-process)
+- [Rust > How To > Env Variables](https://docs.zerops.io/rust/how-to/env-variables)
+- [Rust > How To > Filebrowser](https://docs.zerops.io/rust/how-to/filebrowser)
+- [Rust > How To > Logs](https://docs.zerops.io/rust/how-to/logs)
+- [Rust > How To > Scaling](https://docs.zerops.io/rust/how-to/scaling)
+- [Rust > How To > Shared Storage](https://docs.zerops.io/rust/how-to/shared-storage)
+- [Rust > How To > Trigger Pipeline](https://docs.zerops.io/rust/how-to/trigger-pipeline)
+- [Rust > How To > Upgrade](https://docs.zerops.io/rust/how-to/upgrade)
+- [Rust > Overview](https://docs.zerops.io/rust/overview)
+- [Shared Storage > How To > Backup](https://docs.zerops.io/shared-storage/how-to/backup)
+- [Shared Storage > How To > Connect](https://docs.zerops.io/shared-storage/how-to/connect)
+- [Shared Storage > How To > Create](https://docs.zerops.io/shared-storage/how-to/create)
+- [Shared Storage > How To > Manage](https://docs.zerops.io/shared-storage/how-to/manage)
+- [Shared Storage > How To > Use](https://docs.zerops.io/shared-storage/how-to/use)
+- [Shared Storage > Overview](https://docs.zerops.io/shared-storage/overview)
+- [Shared Storage > Tech Details](https://docs.zerops.io/shared-storage/tech-details)
+- [Static > Overview](https://docs.zerops.io/static/overview)
+- [Typesense > Overview](https://docs.zerops.io/typesense/overview)
+- [Valkey > Overview](https://docs.zerops.io/valkey/overview)
+- [Zerops Yaml > Base List](https://docs.zerops.io/zerops-yaml/base-list)
+- [Zerops Yaml > Cron](https://docs.zerops.io/zerops-yaml/cron)
+- [Zerops Yaml > Specification](https://docs.zerops.io/zerops-yaml/specification)
\ No newline at end of file
diff --git a/package.json b/package.json
index 23a49cb7e..0c3413760 100644
--- a/package.json
+++ b/package.json
@@ -8,10 +8,11 @@
]
},
"scripts": {
+ "prebuild": "tsx zerops-llm-script.ts",
"build": "turbo run build --env-mode=loose",
- "build:docs": "turbo run build --filter=docs",
- "start": "turbo run start:monorepo",
- "dev": "turbo run dev:monorepo",
+ "build:docs": "turbo run build --filter=docs --env-mode=loose",
+ "start": "turbo run start:monorepo --env-mode=loose",
+ "dev": "turbo run dev:monorepo --env-mode=loose",
"format": "prettier . --write",
"lint": "turbo run lint",
"lint:content": "turbo run lint:content"
@@ -19,14 +20,20 @@
"dependencies": {
"autoprefixer": "10.4.14",
"eslint": "^8.36.0",
+ "eslint-plugin-prettier": "5.2.3",
"postcss": "8.4.31",
"prettier": "3.3.3",
"tailwindcss": "3.3.3",
"tsconfig": "*",
- "turbo": "latest"
+ "turbo": "latest",
+ "typescript": "^5.8.2"
},
"engines": {
"node": ">=18.17.0"
},
- "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
+ "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610",
+ "devDependencies": {
+ "@types/glob": "^8.1.0",
+ "tsx": "^4.19.3"
+ }
}
diff --git a/packages/docs-ui/package.json b/packages/docs-ui/package.json
index 433e3289b..0ac4c8cf7 100644
--- a/packages/docs-ui/package.json
+++ b/packages/docs-ui/package.json
@@ -39,7 +39,7 @@
"clsx": "^2.0.0",
"cpy-cli": "^5.0.0",
"eslint-config-docs": "*",
- "next": "14.2.15",
+ "next": "14.2.25",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rimraf": "^5.0.1",
diff --git a/yarn.lock b/yarn.lock
index ac89392a5..5671a06cc 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1215,9 +1215,9 @@
regenerator-runtime "^0.14.0"
"@babel/runtime@^7.23.2":
- version "7.26.7"
- resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.26.7.tgz#f4e7fe527cd710f8dc0618610b61b4b060c3c341"
- integrity sha512-AOPI3D+a8dXnja+iwsUqGRjr1BbZIe771sXdapOtYI531gSqpi92vXivKcq2asu/DFpdl1ceFAKZyRzK2PCVcQ==
+ version "7.26.9"
+ resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.26.9.tgz#aa4c6facc65b9cb3f87d75125ffd47781b475433"
+ integrity sha512-aA63XwOkcl4xxQa3HjPMqOP6LiK0ZDv3mUPYEFXkpHbaFjtGggE1A61FjFzJnB+p7/oy2gA8E+rcBNl/zC1tMg==
dependencies:
regenerator-runtime "^0.14.0"
@@ -1410,6 +1410,14 @@
"@typescript-eslint/utils" "^5.62.0"
tslib "^2.6.0"
+"@docusaurus/eslint-plugin@latest":
+ version "3.7.0"
+ resolved "https://registry.yarnpkg.com/@docusaurus/eslint-plugin/-/eslint-plugin-3.7.0.tgz#bb5a13ba7fffb25cd122bf8d955b00fd4017c994"
+ integrity sha512-Bnmx16acy1cFTkv5onm8kRngU6xETEIqkuka+bH4+gCADnKJewHQ/3CRGjsRaii1M/103NSzGlf8ffQ1k9S04w==
+ dependencies:
+ "@typescript-eslint/utils" "^5.62.0"
+ tslib "^2.6.0"
+
"@docusaurus/logger@3.4.0":
version "3.4.0"
resolved "https://registry.yarnpkg.com/@docusaurus/logger/-/logger-3.4.0.tgz#8b0ac05c7f3dac2009066e2f964dee8209a77403"
@@ -1777,11 +1785,136 @@
dependencies:
tslib "^2.4.0"
+"@esbuild/aix-ppc64@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.25.2.tgz#b87036f644f572efb2b3c75746c97d1d2d87ace8"
+ integrity sha512-wCIboOL2yXZym2cgm6mlA742s9QeJ8DjGVaL39dLN4rRwrOgOyYSnOaFPhKZGLb2ngj4EyfAFjsNJwPXZvseag==
+
+"@esbuild/android-arm64@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.25.2.tgz#5ca7dc20a18f18960ad8d5e6ef5cf7b0a256e196"
+ integrity sha512-5ZAX5xOmTligeBaeNEPnPaeEuah53Id2tX4c2CVP3JaROTH+j4fnfHCkr1PjXMd78hMst+TlkfKcW/DlTq0i4w==
+
+"@esbuild/android-arm@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.25.2.tgz#3c49f607b7082cde70c6ce0c011c362c57a194ee"
+ integrity sha512-NQhH7jFstVY5x8CKbcfa166GoV0EFkaPkCKBQkdPJFvo5u+nGXLEH/ooniLb3QI8Fk58YAx7nsPLozUWfCBOJA==
+
+"@esbuild/android-x64@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.25.2.tgz#8a00147780016aff59e04f1036e7cb1b683859e2"
+ integrity sha512-Ffcx+nnma8Sge4jzddPHCZVRvIfQ0kMsUsCMcJRHkGJ1cDmhe4SsrYIjLUKn1xpHZybmOqCWwB0zQvsjdEHtkg==
+
+"@esbuild/darwin-arm64@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.25.2.tgz#486efe7599a8d90a27780f2bb0318d9a85c6c423"
+ integrity sha512-MpM6LUVTXAzOvN4KbjzU/q5smzryuoNjlriAIx+06RpecwCkL9JpenNzpKd2YMzLJFOdPqBpuub6eVRP5IgiSA==
+
+"@esbuild/darwin-x64@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.25.2.tgz#95ee222aacf668c7a4f3d7ee87b3240a51baf374"
+ integrity sha512-5eRPrTX7wFyuWe8FqEFPG2cU0+butQQVNcT4sVipqjLYQjjh8a8+vUTfgBKM88ObB85ahsnTwF7PSIt6PG+QkA==
+
+"@esbuild/freebsd-arm64@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.2.tgz#67efceda8554b6fc6a43476feba068fb37fa2ef6"
+ integrity sha512-mLwm4vXKiQ2UTSX4+ImyiPdiHjiZhIaE9QvC7sw0tZ6HoNMjYAqQpGyui5VRIi5sGd+uWq940gdCbY3VLvsO1w==
+
+"@esbuild/freebsd-x64@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.25.2.tgz#88a9d7ecdd3adadbfe5227c2122d24816959b809"
+ integrity sha512-6qyyn6TjayJSwGpm8J9QYYGQcRgc90nmfdUb0O7pp1s4lTY+9D0H9O02v5JqGApUyiHOtkz6+1hZNvNtEhbwRQ==
+
+"@esbuild/linux-arm64@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.25.2.tgz#87be1099b2bbe61282333b084737d46bc8308058"
+ integrity sha512-gq/sjLsOyMT19I8obBISvhoYiZIAaGF8JpeXu1u8yPv8BE5HlWYobmlsfijFIZ9hIVGYkbdFhEqC0NvM4kNO0g==
+
+"@esbuild/linux-arm@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.25.2.tgz#72a285b0fe64496e191fcad222185d7bf9f816f6"
+ integrity sha512-UHBRgJcmjJv5oeQF8EpTRZs/1knq6loLxTsjc3nxO9eXAPDLcWW55flrMVc97qFPbmZP31ta1AZVUKQzKTzb0g==
+
+"@esbuild/linux-ia32@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.25.2.tgz#337a87a4c4dd48a832baed5cbb022be20809d737"
+ integrity sha512-bBYCv9obgW2cBP+2ZWfjYTU+f5cxRoGGQ5SeDbYdFCAZpYWrfjjfYwvUpP8MlKbP0nwZ5gyOU/0aUzZ5HWPuvQ==
+
"@esbuild/linux-loong64@0.14.54":
version "0.14.54"
resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.14.54.tgz#de2a4be678bd4d0d1ffbb86e6de779cde5999028"
integrity sha512-bZBrLAIX1kpWelV0XemxBZllyRmM6vgFQQG2GdNb+r3Fkp0FOh1NJSvekXDs7jq70k4euu1cryLMfU+mTXlEpw==
+"@esbuild/linux-loong64@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.25.2.tgz#1b81aa77103d6b8a8cfa7c094ed3d25c7579ba2a"
+ integrity sha512-SHNGiKtvnU2dBlM5D8CXRFdd+6etgZ9dXfaPCeJtz+37PIUlixvlIhI23L5khKXs3DIzAn9V8v+qb1TRKrgT5w==
+
+"@esbuild/linux-mips64el@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.25.2.tgz#afbe380b6992e7459bf7c2c3b9556633b2e47f30"
+ integrity sha512-hDDRlzE6rPeoj+5fsADqdUZl1OzqDYow4TB4Y/3PlKBD0ph1e6uPHzIQcv2Z65u2K0kpeByIyAjCmjn1hJgG0Q==
+
+"@esbuild/linux-ppc64@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.25.2.tgz#6bf8695cab8a2b135cca1aa555226dc932d52067"
+ integrity sha512-tsHu2RRSWzipmUi9UBDEzc0nLc4HtpZEI5Ba+Omms5456x5WaNuiG3u7xh5AO6sipnJ9r4cRWQB2tUjPyIkc6g==
+
+"@esbuild/linux-riscv64@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.25.2.tgz#43c2d67a1a39199fb06ba978aebb44992d7becc3"
+ integrity sha512-k4LtpgV7NJQOml/10uPU0s4SAXGnowi5qBSjaLWMojNCUICNu7TshqHLAEbkBdAszL5TabfvQ48kK84hyFzjnw==
+
+"@esbuild/linux-s390x@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.25.2.tgz#419e25737ec815c6dce2cd20d026e347cbb7a602"
+ integrity sha512-GRa4IshOdvKY7M/rDpRR3gkiTNp34M0eLTaC1a08gNrh4u488aPhuZOCpkF6+2wl3zAN7L7XIpOFBhnaE3/Q8Q==
+
+"@esbuild/linux-x64@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.25.2.tgz#22451f6edbba84abe754a8cbd8528ff6e28d9bcb"
+ integrity sha512-QInHERlqpTTZ4FRB0fROQWXcYRD64lAoiegezDunLpalZMjcUcld3YzZmVJ2H/Cp0wJRZ8Xtjtj0cEHhYc/uUg==
+
+"@esbuild/netbsd-arm64@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.2.tgz#744affd3b8d8236b08c5210d828b0698a62c58ac"
+ integrity sha512-talAIBoY5M8vHc6EeI2WW9d/CkiO9MQJ0IOWX8hrLhxGbro/vBXJvaQXefW2cP0z0nQVTdQ/eNyGFV1GSKrxfw==
+
+"@esbuild/netbsd-x64@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.25.2.tgz#dbbe7521fd6d7352f34328d676af923fc0f8a78f"
+ integrity sha512-voZT9Z+tpOxrvfKFyfDYPc4DO4rk06qamv1a/fkuzHpiVBMOhpjK+vBmWM8J1eiB3OLSMFYNaOaBNLXGChf5tg==
+
+"@esbuild/openbsd-arm64@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.2.tgz#f9caf987e3e0570500832b487ce3039ca648ce9f"
+ integrity sha512-dcXYOC6NXOqcykeDlwId9kB6OkPUxOEqU+rkrYVqJbK2hagWOMrsTGsMr8+rW02M+d5Op5NNlgMmjzecaRf7Tg==
+
+"@esbuild/openbsd-x64@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.25.2.tgz#d2bb6a0f8ffea7b394bb43dfccbb07cabd89f768"
+ integrity sha512-t/TkWwahkH0Tsgoq1Ju7QfgGhArkGLkF1uYz8nQS/PPFlXbP5YgRpqQR3ARRiC2iXoLTWFxc6DJMSK10dVXluw==
+
+"@esbuild/sunos-x64@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.25.2.tgz#49b437ed63fe333b92137b7a0c65a65852031afb"
+ integrity sha512-cfZH1co2+imVdWCjd+D1gf9NjkchVhhdpgb1q5y6Hcv9TP6Zi9ZG/beI3ig8TvwT9lH9dlxLq5MQBBgwuj4xvA==
+
+"@esbuild/win32-arm64@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.25.2.tgz#081424168463c7d6c7fb78f631aede0c104373cf"
+ integrity sha512-7Loyjh+D/Nx/sOTzV8vfbB3GJuHdOQyrOryFdZvPHLf42Tk9ivBU5Aedi7iyX+x6rbn2Mh68T4qq1SDqJBQO5Q==
+
+"@esbuild/win32-ia32@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.25.2.tgz#3f9e87143ddd003133d21384944a6c6cadf9693f"
+ integrity sha512-WRJgsz9un0nqZJ4MfhabxaD9Ft8KioqU3JMinOTvobbX6MOSUigSBlogP8QB3uxpJDsFS6yN+3FDBdqE5lg9kg==
+
+"@esbuild/win32-x64@0.25.2":
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.25.2.tgz#839f72c2decd378f86b8f525e1979a97b920c67d"
+ integrity sha512-kM3HKb16VIXZyIeVrM1ygYmZBKybX8N4p754bw390wGO3Tf2j4L2/WYL+4suWujpgf6GBYs3jv7TyUivdd05JA==
+
"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0":
version "4.4.0"
resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59"
@@ -2259,10 +2392,10 @@
react-day-picker "^8.8.0"
tailwind-merge "^2.2.1"
-"@next/env@14.2.15":
- version "14.2.15"
- resolved "https://registry.yarnpkg.com/@next/env/-/env-14.2.15.tgz#06d984e37e670d93ddd6790af1844aeb935f332f"
- integrity sha512-S1qaj25Wru2dUpcIZMjxeMVSwkt8BK4dmWHHiBuRstcIyOsMapqT4A4jSB6onvqeygkSSmOkyny9VVx8JIGamQ==
+"@next/env@14.2.25":
+ version "14.2.25"
+ resolved "https://registry.yarnpkg.com/@next/env/-/env-14.2.25.tgz#936d10b967e103e49a4bcea1e97292d5605278dd"
+ integrity sha512-JnzQ2cExDeG7FxJwqAksZ3aqVJrHjFwZQAEJ9gQZSoEhIow7SNoKZzju/AwQ+PLIR4NY8V0rhcVozx/2izDO0w==
"@next/env@15.1.2":
version "15.1.2"
@@ -2276,85 +2409,85 @@
dependencies:
glob "10.3.10"
-"@next/swc-darwin-arm64@14.2.15":
- version "14.2.15"
- resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.15.tgz#6386d585f39a1c490c60b72b1f76612ba4434347"
- integrity sha512-Rvh7KU9hOUBnZ9TJ28n2Oa7dD9cvDBKua9IKx7cfQQ0GoYUwg9ig31O2oMwH3wm+pE3IkAQ67ZobPfEgurPZIA==
+"@next/swc-darwin-arm64@14.2.25":
+ version "14.2.25"
+ resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.25.tgz#7bcccfda0c0ff045c45fbe34c491b7368e373e3d"
+ integrity sha512-09clWInF1YRd6le00vt750s3m7SEYNehz9C4PUcSu3bAdCTpjIV4aTYQZ25Ehrr83VR1rZeqtKUPWSI7GfuKZQ==
"@next/swc-darwin-arm64@15.1.2":
version "15.1.2"
resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.1.2.tgz#822265999fc76f828f4c671a5ef861b8e2c5213e"
integrity sha512-b9TN7q+j5/7+rGLhFAVZiKJGIASuo8tWvInGfAd8wsULjB1uNGRCj1z1WZwwPWzVQbIKWFYqc+9L7W09qwt52w==
-"@next/swc-darwin-x64@14.2.15":
- version "14.2.15"
- resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.15.tgz#b7baeedc6a28f7545ad2bc55adbab25f7b45cb89"
- integrity sha512-5TGyjFcf8ampZP3e+FyCax5zFVHi+Oe7sZyaKOngsqyaNEpOgkKB3sqmymkZfowy3ufGA/tUgDPPxpQx931lHg==
+"@next/swc-darwin-x64@14.2.25":
+ version "14.2.25"
+ resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.25.tgz#b489e209d7b405260b73f69a38186ed150fb7a08"
+ integrity sha512-V+iYM/QR+aYeJl3/FWWU/7Ix4b07ovsQ5IbkwgUK29pTHmq+5UxeDr7/dphvtXEq5pLB/PucfcBNh9KZ8vWbug==
"@next/swc-darwin-x64@15.1.2":
version "15.1.2"
resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-15.1.2.tgz#78d277bce3d35c6e8d9ad423b6f5b0031aa9a1e2"
integrity sha512-caR62jNDUCU+qobStO6YJ05p9E+LR0EoXh1EEmyU69cYydsAy7drMcOlUlRtQihM6K6QfvNwJuLhsHcCzNpqtA==
-"@next/swc-linux-arm64-gnu@14.2.15":
- version "14.2.15"
- resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.15.tgz#fa13c59d3222f70fb4cb3544ac750db2c6e34d02"
- integrity sha512-3Bwv4oc08ONiQ3FiOLKT72Q+ndEMyLNsc/D3qnLMbtUYTQAmkx9E/JRu0DBpHxNddBmNT5hxz1mYBphJ3mfrrw==
+"@next/swc-linux-arm64-gnu@14.2.25":
+ version "14.2.25"
+ resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.25.tgz#ba064fabfdce0190d9859493d8232fffa84ef2e2"
+ integrity sha512-LFnV2899PJZAIEHQ4IMmZIgL0FBieh5keMnriMY1cK7ompR+JUd24xeTtKkcaw8QmxmEdhoE5Mu9dPSuDBgtTg==
"@next/swc-linux-arm64-gnu@15.1.2":
version "15.1.2"
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.1.2.tgz#4d48c8c37da869b0fdbb51f3f3f71df7a3b6b1bb"
integrity sha512-fHHXBusURjBmN6VBUtu6/5s7cCeEkuGAb/ZZiGHBLVBXMBy4D5QpM8P33Or8JD1nlOjm/ZT9sEE5HouQ0F+hUA==
-"@next/swc-linux-arm64-musl@14.2.15":
- version "14.2.15"
- resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.15.tgz#30e45b71831d9a6d6d18d7ac7d611a8d646a17f9"
- integrity sha512-k5xf/tg1FBv/M4CMd8S+JL3uV9BnnRmoe7F+GWC3DxkTCD9aewFRH1s5rJ1zkzDa+Do4zyN8qD0N8c84Hu96FQ==
+"@next/swc-linux-arm64-musl@14.2.25":
+ version "14.2.25"
+ resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.25.tgz#bf0018267e4e0fbfa1524750321f8cae855144a3"
+ integrity sha512-QC5y5PPTmtqFExcKWKYgUNkHeHE/z3lUsu83di488nyP0ZzQ3Yse2G6TCxz6nNsQwgAx1BehAJTZez+UQxzLfw==
"@next/swc-linux-arm64-musl@15.1.2":
version "15.1.2"
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.1.2.tgz#0efbaffc2bc3fad4a6458c91b1655b0c3d509577"
integrity sha512-9CF1Pnivij7+M3G74lxr+e9h6o2YNIe7QtExWq1KUK4hsOLTBv6FJikEwCaC3NeYTflzrm69E5UfwEAbV2U9/g==
-"@next/swc-linux-x64-gnu@14.2.15":
- version "14.2.15"
- resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.15.tgz#5065db17fc86f935ad117483f21f812dc1b39254"
- integrity sha512-kE6q38hbrRbKEkkVn62reLXhThLRh6/TvgSP56GkFNhU22TbIrQDEMrO7j0IcQHcew2wfykq8lZyHFabz0oBrA==
+"@next/swc-linux-x64-gnu@14.2.25":
+ version "14.2.25"
+ resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.25.tgz#64f5a6016a7148297ee80542e0fd788418a32472"
+ integrity sha512-y6/ML4b9eQ2D/56wqatTJN5/JR8/xdObU2Fb1RBidnrr450HLCKr6IJZbPqbv7NXmje61UyxjF5kvSajvjye5w==
"@next/swc-linux-x64-gnu@15.1.2":
version "15.1.2"
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.1.2.tgz#fcdb19e2a7602f85f103190539d0cf42eca7f217"
integrity sha512-tINV7WmcTUf4oM/eN3Yuu/f8jQ5C6AkueZPKeALs/qfdfX57eNv4Ij7rt0SA6iZ8+fMobVfcFVv664Op0caCCg==
-"@next/swc-linux-x64-musl@14.2.15":
- version "14.2.15"
- resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.15.tgz#3c4a4568d8be7373a820f7576cf33388b5dab47e"
- integrity sha512-PZ5YE9ouy/IdO7QVJeIcyLn/Rc4ml9M2G4y3kCM9MNf1YKvFY4heg3pVa/jQbMro+tP6yc4G2o9LjAz1zxD7tQ==
+"@next/swc-linux-x64-musl@14.2.25":
+ version "14.2.25"
+ resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.25.tgz#58dc636d7c55828478159546f7b95ab1e902301c"
+ integrity sha512-sPX0TSXHGUOZFvv96GoBXpB3w4emMqKeMgemrSxI7A6l55VBJp/RKYLwZIB9JxSqYPApqiREaIIap+wWq0RU8w==
"@next/swc-linux-x64-musl@15.1.2":
version "15.1.2"
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.1.2.tgz#06b09f1712498dd5c61fac10c56a09535469b4c4"
integrity sha512-jf2IseC4WRsGkzeUw/cK3wci9pxR53GlLAt30+y+B+2qAQxMw6WAC3QrANIKxkcoPU3JFh/10uFfmoMDF9JXKg==
-"@next/swc-win32-arm64-msvc@14.2.15":
- version "14.2.15"
- resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.15.tgz#fb812cc4ca0042868e32a6a021da91943bb08b98"
- integrity sha512-2raR16703kBvYEQD9HNLyb0/394yfqzmIeyp2nDzcPV4yPjqNUG3ohX6jX00WryXz6s1FXpVhsCo3i+g4RUX+g==
+"@next/swc-win32-arm64-msvc@14.2.25":
+ version "14.2.25"
+ resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.25.tgz#93562d447c799bded1e89c1a62d5195a2a8c6c0d"
+ integrity sha512-ReO9S5hkA1DU2cFCsGoOEp7WJkhFzNbU/3VUF6XxNGUCQChyug6hZdYL/istQgfT/GWE6PNIg9cm784OI4ddxQ==
"@next/swc-win32-arm64-msvc@15.1.2":
version "15.1.2"
resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.1.2.tgz#63159223241ff45e8df76b24fc979bbb933c74df"
integrity sha512-wvg7MlfnaociP7k8lxLX4s2iBJm4BrNiNFhVUY+Yur5yhAJHfkS8qPPeDEUH8rQiY0PX3u/P7Q/wcg6Mv6GSAA==
-"@next/swc-win32-ia32-msvc@14.2.15":
- version "14.2.15"
- resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.15.tgz#ec26e6169354f8ced240c1427be7fd485c5df898"
- integrity sha512-fyTE8cklgkyR1p03kJa5zXEaZ9El+kDNM5A+66+8evQS5e/6v0Gk28LqA0Jet8gKSOyP+OTm/tJHzMlGdQerdQ==
+"@next/swc-win32-ia32-msvc@14.2.25":
+ version "14.2.25"
+ resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.25.tgz#ad85a33466be1f41d083211ea21adc0d2c6e6554"
+ integrity sha512-DZ/gc0o9neuCDyD5IumyTGHVun2dCox5TfPQI/BJTYwpSNYM3CZDI4i6TOdjeq1JMo+Ug4kPSMuZdwsycwFbAw==
-"@next/swc-win32-x64-msvc@14.2.15":
- version "14.2.15"
- resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.15.tgz#18d68697002b282006771f8d92d79ade9efd35c4"
- integrity sha512-SzqGbsLsP9OwKNUG9nekShTwhj6JSB9ZLMWQ8g1gG6hdE5gQLncbnbymrwy2yVmH9nikSLYRYxYMFu78Ggp7/g==
+"@next/swc-win32-x64-msvc@14.2.25":
+ version "14.2.25"
+ resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.25.tgz#3969c66609e683ec63a6a9f320a855f7be686a08"
+ integrity sha512-KSznmS6eFjQ9RJ1nEc66kJvtGIL1iZMYmGEXsZPh2YtnLtqrgdVvKXJY2ScjjoFnG6nGLyPFR0UiEvDwVah4Tw==
"@next/swc-win32-x64-msvc@15.1.2":
version "15.1.2"
@@ -2433,6 +2566,11 @@
resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33"
integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==
+"@pkgr/core@^0.1.0":
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.1.1.tgz#1ec17e2edbec25c8306d424ecfbf13c7de1aaa31"
+ integrity sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==
+
"@pnpm/config.env-replace@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz#ab29da53df41e8948a00f2433f085f54de8b3a4c"
@@ -4520,6 +4658,14 @@
"@types/qs" "*"
"@types/serve-static" "*"
+"@types/glob@^8.1.0":
+ version "8.1.0"
+ resolved "https://registry.yarnpkg.com/@types/glob/-/glob-8.1.0.tgz#b63e70155391b0584dce44e7ea25190bbc38f2fc"
+ integrity sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==
+ dependencies:
+ "@types/minimatch" "^5.1.2"
+ "@types/node" "*"
+
"@types/google.maps@^3.45.3":
version "3.55.10"
resolved "https://registry.yarnpkg.com/@types/google.maps/-/google.maps-3.55.10.tgz#ce4a8c375b84990a0e9eec9f151c3494cbe5bf2c"
@@ -4648,6 +4794,11 @@
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.5.tgz#1ef302e01cf7d2b5a0fa526790c9123bf1d06690"
integrity sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==
+"@types/minimatch@^5.1.2":
+ version "5.1.2"
+ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca"
+ integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==
+
"@types/ms@*":
version "0.7.34"
resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.34.tgz#10964ba0dee6ac4cd462e2795b6bebd407303433"
@@ -7581,6 +7732,37 @@ esbuild@^0.14.25:
esbuild-windows-64 "0.14.54"
esbuild-windows-arm64 "0.14.54"
+esbuild@~0.25.0:
+ version "0.25.2"
+ resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.25.2.tgz#55a1d9ebcb3aa2f95e8bba9e900c1a5061bc168b"
+ integrity sha512-16854zccKPnC+toMywC+uKNeYSv+/eXkevRAfwRD/G9Cleq66m8XFIrigkbvauLLlCfDL45Q2cWegSg53gGBnQ==
+ optionalDependencies:
+ "@esbuild/aix-ppc64" "0.25.2"
+ "@esbuild/android-arm" "0.25.2"
+ "@esbuild/android-arm64" "0.25.2"
+ "@esbuild/android-x64" "0.25.2"
+ "@esbuild/darwin-arm64" "0.25.2"
+ "@esbuild/darwin-x64" "0.25.2"
+ "@esbuild/freebsd-arm64" "0.25.2"
+ "@esbuild/freebsd-x64" "0.25.2"
+ "@esbuild/linux-arm" "0.25.2"
+ "@esbuild/linux-arm64" "0.25.2"
+ "@esbuild/linux-ia32" "0.25.2"
+ "@esbuild/linux-loong64" "0.25.2"
+ "@esbuild/linux-mips64el" "0.25.2"
+ "@esbuild/linux-ppc64" "0.25.2"
+ "@esbuild/linux-riscv64" "0.25.2"
+ "@esbuild/linux-s390x" "0.25.2"
+ "@esbuild/linux-x64" "0.25.2"
+ "@esbuild/netbsd-arm64" "0.25.2"
+ "@esbuild/netbsd-x64" "0.25.2"
+ "@esbuild/openbsd-arm64" "0.25.2"
+ "@esbuild/openbsd-x64" "0.25.2"
+ "@esbuild/sunos-x64" "0.25.2"
+ "@esbuild/win32-arm64" "0.25.2"
+ "@esbuild/win32-ia32" "0.25.2"
+ "@esbuild/win32-x64" "0.25.2"
+
escalade@^3.1.1, escalade@^3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27"
@@ -7724,6 +7906,14 @@ eslint-plugin-markdown@^3.0.0:
dependencies:
mdast-util-from-markdown "^0.8.5"
+eslint-plugin-prettier@5.2.3:
+ version "5.2.3"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.3.tgz#c4af01691a6fa9905207f0fbba0d7bea0902cce5"
+ integrity sha512-qJ+y0FfCp/mQYQ/vWQ3s7eUlFEL4PyKfAJxsnYTJ4YT73nsJBWqmEpFryxV9OeUiqmsTsYJ5Y+KDNaeP31wrRw==
+ dependencies:
+ prettier-linter-helpers "^1.0.0"
+ synckit "^0.9.1"
+
eslint-plugin-prettier@^4.2.1:
version "4.2.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz#651cbb88b1dab98bfd42f017a12fa6b2d993f94b"
@@ -8279,7 +8469,7 @@ fs.realpath@^1.0.0:
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==
-fsevents@~2.3.2:
+fsevents@~2.3.2, fsevents@~2.3.3:
version "2.3.3"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
@@ -8351,6 +8541,13 @@ get-tsconfig@^4.5.0:
dependencies:
resolve-pkg-maps "^1.0.0"
+get-tsconfig@^4.7.5:
+ version "4.10.0"
+ resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.10.0.tgz#403a682b373a823612475a4c2928c7326fc0f6bb"
+ integrity sha512-kGzZ3LWWQcGIAmg6iWvXn0ei6WDtV26wzHRMwDSzmAbcXrTEXxHy6IehI6/4eT6VRKyMP1eF1VqwrVUmE/LR7A==
+ dependencies:
+ resolve-pkg-maps "^1.0.0"
+
github-slugger@^1.5.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.5.0.tgz#17891bbc73232051474d68bd867a34625c955f7d"
@@ -11042,12 +11239,12 @@ new-date@^1.0.3:
dependencies:
"@segment/isodate" "1.0.3"
-next@14.2.15:
- version "14.2.15"
- resolved "https://registry.yarnpkg.com/next/-/next-14.2.15.tgz#348e5603e22649775d19c785c09a89c9acb5189a"
- integrity sha512-h9ctmOokpoDphRvMGnwOJAedT6zKhwqyZML9mDtspgf4Rh3Pn7UTYKqePNoDvhsWBAO5GoPNYshnAUGIazVGmw==
+next@14.2.25:
+ version "14.2.25"
+ resolved "https://registry.yarnpkg.com/next/-/next-14.2.25.tgz#0657551fde6a97f697cf9870e9ccbdaa465c6008"
+ integrity sha512-N5M7xMc4wSb4IkPvEV5X2BRRXUmhVHNyaXwEM86+voXthSZz8ZiRyQW4p9mwAoAPIm6OzuVZtn7idgEJeAJN3Q==
dependencies:
- "@next/env" "14.2.15"
+ "@next/env" "14.2.25"
"@swc/helpers" "0.5.5"
busboy "1.6.0"
caniuse-lite "^1.0.30001579"
@@ -11055,15 +11252,15 @@ next@14.2.15:
postcss "8.4.31"
styled-jsx "5.1.1"
optionalDependencies:
- "@next/swc-darwin-arm64" "14.2.15"
- "@next/swc-darwin-x64" "14.2.15"
- "@next/swc-linux-arm64-gnu" "14.2.15"
- "@next/swc-linux-arm64-musl" "14.2.15"
- "@next/swc-linux-x64-gnu" "14.2.15"
- "@next/swc-linux-x64-musl" "14.2.15"
- "@next/swc-win32-arm64-msvc" "14.2.15"
- "@next/swc-win32-ia32-msvc" "14.2.15"
- "@next/swc-win32-x64-msvc" "14.2.15"
+ "@next/swc-darwin-arm64" "14.2.25"
+ "@next/swc-darwin-x64" "14.2.25"
+ "@next/swc-linux-arm64-gnu" "14.2.25"
+ "@next/swc-linux-arm64-musl" "14.2.25"
+ "@next/swc-linux-x64-gnu" "14.2.25"
+ "@next/swc-linux-x64-musl" "14.2.25"
+ "@next/swc-win32-arm64-msvc" "14.2.25"
+ "@next/swc-win32-ia32-msvc" "14.2.25"
+ "@next/swc-win32-x64-msvc" "14.2.25"
next@latest:
version "15.1.2"
@@ -13629,6 +13826,14 @@ swc-loader@^0.2.3:
dependencies:
"@swc/counter" "^0.1.3"
+synckit@^0.9.1:
+ version "0.9.2"
+ resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.9.2.tgz#a3a935eca7922d48b9e7d6c61822ee6c3ae4ec62"
+ integrity sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==
+ dependencies:
+ "@pkgr/core" "^0.1.0"
+ tslib "^2.6.2"
+
tailwind-merge@^2.2.1:
version "2.3.0"
resolved "https://registry.yarnpkg.com/tailwind-merge/-/tailwind-merge-2.3.0.tgz#27d2134fd00a1f77eca22bcaafdd67055917d286"
@@ -13875,7 +14080,7 @@ tslib@^2.0.0, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.4.0, tslib@^2.4.1, tslib@^2.6
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0"
integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==
-tslib@^2.8.0:
+tslib@^2.6.2, tslib@^2.8.0:
version "2.8.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f"
integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==
@@ -13907,6 +14112,16 @@ tsutils@^3.21.0:
dependencies:
tslib "^1.8.1"
+tsx@^4.19.3:
+ version "4.19.3"
+ resolved "https://registry.yarnpkg.com/tsx/-/tsx-4.19.3.tgz#2bdbcb87089374d933596f8645615142ed727666"
+ integrity sha512-4H8vUNGNjQ4V2EOoGw005+c+dGuPSnhpPBPHBtsZdGZBk/iJb4kguGlPWaZTZ3q5nMtFOEsY0nRDlh9PJyd6SQ==
+ dependencies:
+ esbuild "~0.25.0"
+ get-tsconfig "^4.7.5"
+ optionalDependencies:
+ fsevents "~2.3.3"
+
turbo-darwin-64@2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/turbo-darwin-64/-/turbo-darwin-64-2.0.5.tgz#23c711370911d66e4589928243ec086c453709df"
@@ -14040,6 +14255,11 @@ typescript@^5.1.6, typescript@^5.3.3:
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.2.tgz#c26f023cb0054e657ce04f72583ea2d85f8d0507"
integrity sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==
+typescript@^5.8.2:
+ version "5.8.2"
+ resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.2.tgz#8170b3702f74b79db2e5a96207c15e65807999e4"
+ integrity sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==
+
typescript@~5.2.2:
version "5.2.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78"
diff --git a/zerops-llm-script.ts b/zerops-llm-script.ts
new file mode 100644
index 000000000..4724c8683
--- /dev/null
+++ b/zerops-llm-script.ts
@@ -0,0 +1,178 @@
+import * as fs from 'node:fs'
+import * as path from 'node:path'
+import * as globModule from 'glob'
+
+const frontmatterRegex = /^\n*---(\n.+)*?\n---\n/
+const mdxComponentRegex = /<[^>]+>/g
+const imageRegex = /!\[.*?\]\(.*?\)/g
+const importRegex = /^import\s+.*?from\s+['"].*?['"];?/gm
+
+const contentDir = path.resolve('apps/docs/content')
+
+const sliceExt = (file: string) => {
+ return file.split('.').slice(0, -1).join('.')
+}
+
+const extractLabel = (file: string) => {
+ const pathWithoutExt = sliceExt(file)
+ const parts = pathWithoutExt.split('/')
+ return parts.map(part =>
+ part.split('-')
+ .map(word => word.charAt(0).toUpperCase() + word.slice(1))
+ .join(' ')
+ ).join(' > ')
+}
+
+function capitalizeDelimiter(str: string): string {
+ return str
+ .split('-')
+ .map((s: string) => s.charAt(0).toUpperCase() + s.slice(1))
+ .join('-')
+}
+
+function cleanMarkdownContent(content: string): string {
+ let cleaned = content.replace(frontmatterRegex, '')
+
+ // Remove JSX-style comments
+ cleaned = cleaned.replace(/{\/\*[\s\S]*?\*\/}/g, '')
+
+ // Remove tags
+ cleaned = cleaned.replace(/ /g, '\n')
+
+ cleaned = cleaned.replace(/([\s\S]*?)<\/FAQItem>/g, (match, question, answer) => {
+ return `Question: ${question}\nAnswer: ${answer}\n`
+ })
+ cleaned = cleaned.replace(/([\s\S]*?)<\/FAQ>/g, (match, content) => {
+ return content
+ })
+
+ const sections = cleaned.split(/(\|.*\|\n\|.*\|\n(\|.*\|\n)*)/)
+ let processedContent = ''
+
+ for (let i = 0; i < sections.length; i++) {
+ const section = sections[i]
+ if (!section) continue
+
+ if (section.trim().startsWith('|')) {
+ processedContent += section
+ } else {
+ let processedSection = section
+ processedSection = processedSection.replace(mdxComponentRegex, '')
+ processedSection = processedSection.replace(imageRegex, '')
+ processedSection = processedSection.replace(importRegex, '')
+ processedContent += processedSection
+ }
+ }
+
+ const lines = processedContent.split('\n')
+ const processedLines: string[] = []
+ let lastLineWasEmpty = false
+
+ for (const line of lines) {
+ if (!line) continue
+ const trimmedLine = line.trim()
+
+ if (trimmedLine === '' && lastLineWasEmpty) {
+ continue
+ }
+
+ processedLines.push(line)
+ lastLineWasEmpty = trimmedLine === ''
+ }
+
+ return processedLines.join('\n')
+}
+
+async function generateContent(
+ files: string[],
+ contentDir: string
+): Promise {
+ let content = ''
+
+ for (let i = 0; i < files.length; i++) {
+ const file = files[i]
+ console.log(`> Writing '${file}' `)
+ const fileContent = fs.readFileSync(
+ path.resolve(contentDir, file),
+ 'utf-8'
+ )
+
+ const cleanedContent = cleanMarkdownContent(fileContent)
+ const title = extractLabel(file)
+
+ if (i === 0) {
+ content += '-'.repeat(40) + '\n\n'
+ }
+
+ content += `# ${title}\n\n${cleanedContent}\n\n`
+ content += '-'.repeat(40) + '\n\n'
+ }
+
+ return content
+}
+
+async function generateLLMDocs() {
+ const publicDir = path.resolve('apps/docs/static')
+
+ if (!fs.existsSync(publicDir)) {
+ fs.mkdirSync(publicDir, { recursive: true })
+ }
+
+ const outputListFile = path.resolve(publicDir, 'llms.txt')
+
+ const optionalFiles = globModule.sync('**/*.mdx', { cwd: contentDir })
+
+ const optionals: string[] = []
+
+ for (const file of optionalFiles) {
+ optionals.push(
+ `- [${capitalizeDelimiter(extractLabel(file)).replace(/-/, ' ')}](https://docs.zerops.io/${sliceExt(file)})`
+ )
+ }
+
+ fs.writeFileSync(
+ outputListFile,
+ [
+ '# Zerops',
+ '',
+ '> Zerops is a developer-first Platform-as-a-Service, running on bare metal, with every part built from scratch. Zerops aims to be the perfect mix of developer experience, flexibility, scalability and affordability, making it a great fit for applications of any size, complexity and traffic.',
+ '',
+ '## Docs',
+ '',
+ '- [Full Docs](https://docs.zerops.io/llms-full.txt) Full documentation of Zerops. (without examples)',
+ '- [Tiny Docs](https://docs.zerops.io/llms-small.txt): Tiny documentation of Zerops. (includes only description of core)',
+ '',
+ '## Optional',
+ '',
+ ...optionals,
+ ].join('\n'),
+ 'utf-8'
+ )
+ console.log(`< Output '${outputListFile}' `)
+
+ const outputFullFile = path.resolve(publicDir, 'llms-full.txt')
+ const files = globModule.sync('**/*.mdx', { cwd: contentDir })
+
+ const fullContent = await generateContent(
+ files,
+ contentDir
+ )
+
+ fs.writeFileSync(outputFullFile, fullContent, 'utf-8')
+ console.log(`< Output '${outputFullFile}' `)
+
+ const outputTinyFile = path.resolve(publicDir, 'llms-small.txt')
+
+ const tinyExclude = ['references', 'company', 'help']
+ const tinyFiles = files.filter((filename: string) => !tinyExclude.some(exclude => filename.includes(exclude)))
+
+ const tinyContent = await generateContent(
+ tinyFiles,
+ contentDir
+ )
+
+ fs.writeFileSync(outputTinyFile, tinyContent, 'utf-8')
+ console.log(`< Output '${outputTinyFile}' `)
+}
+
+generateLLMDocs().catch(console.error)
diff --git a/zerops.yml b/zerops.yml
index b5d867321..90103da6a 100644
--- a/zerops.yml
+++ b/zerops.yml
@@ -9,6 +9,7 @@ zerops:
MEILISEARCH_INDEX_UID: docs
buildCommands:
- yarn
+ - yarn prebuild
- yarn build
deployFiles:
- apps/docs/build/~