Projects, environments and services

A project holds environments, each environment holds services, and a service is the thing you deploy and pay for.

Projects

A project is one app and the parts it needs, such as a website, an API and a database. Creating a project also creates its production environment, which deploys from main unless you pick another branch.

Environments

An environment is one copy of the project's services. Every service in the project has a place in each environment, with its own settings, access and variables there.

EnvironmentDeploys fromSleeps
Productionthe branch the project tracksnever
Any other, such as stagingits own branchafter 15 minutes without a request

A new environment gets its own copy of every database and cache, and each copy starts empty: environments never share data. Branch environments shows how to make one, and sleep explains why the others rest.

Services

A service is one running program. It runs in one site in an environment: you choose the site when you create it, and it can't change. There are three kinds:

KindAdded fromWhat it is
Web serviceGitHub repositoryYour code, such as a website or an API, answering HTTP on its port. Ghaym builds it from your repository.
DatabasePostgreSQL or MySQLA database Ghaym runs for you inside the project.
CacheRedisA cache Ghaym runs for you inside the project.

Web services deploy from a Git repository, and databases and caches live inside the project's own network. A web service answers at an address ending in ghaym.app, and your own domain can point to it too.

Size and replicas

A service's size sets its memory, its CPU and its monthly price, and the console shows that price before you pick a size. A web service can run as several replicas. A database or a cache scales by readers instead, and its size changes only to one with the same disk. Each environment has its own size. Scaling shows both, and billing shows how the price adds up.

With the CLI

List your projects, then one project's environments, with the CLI:

Terminal
ghaym cloud projects list
ghaym cloud environments list shop

environments create makes an environment that deploys from its own branch, and services metrics shows one service's CPU, memory and requests.