Skip to main content
Skip to main content
🚧 Work in Progress

Customize Nginx Static runtime environment

image

The default Nginx runtime environment contains:

  • Alpine 3.20
  • Selected version of Nginx when the runtime service was created.
  • zCLI
  • Git and Composer
Note

To use Ubuntu instead of the default Alpine, set the run.os attribute.

Additional packages and tools can be installed using run.prepareCommands.

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
  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 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.