Configuring a Landscape
A Landscape defines how your services are deployed and connected. You can add Compute Runtimes (Reactives, Managed Containers, Cloud Native Deployments) and Managed Services, configure their resources, networking, and environment. For a deeper technical overview, see Landscapes & Workspaces.
All configuration starts from the Landscape Config Editor:
- In your Workspace, open the Landscape Config Editor from the sidebar.
- Ensure the correct CI Profile is selected (e.g.,
defaultordev). If you need to create one, see Using CI Profiles. - Click the + Add New Service button on the right side of the Landscape Deployment section and select the service type you want to add.
From here you can configure your Landscape using the visual editor or by editing the ci.yml file directly.
Saving service configurations
The landscape config UI behaves as one large form that configures your ci.yml file. You can only save the configuration in the top level of the form.
Codesphere Reactives
Codesphere Reactives are Codesphere's flagship runtime, best described as stateful serverless. They combine persistent filesystem access with automatic resource deallocation during idle periods and near-instant startup (milliseconds). For a detailed overview, see Runtimes.
To add a Reactive, select Reactive Service from the service type picker, then configure it using the sections below.
Runtime Config
- UI
- YAML
Execution Steps
Execution steps define the commands that run when your service starts. These commands execute sequentially and should start your application process.
To add execution steps:
- Click + Add Execution Step
- Enter a name for the step (e.g., "Start Server")
- Enter the command to execute (e.g.,
npm startornode server.js) - Repeat if additional steps are needed
Service Execution
The final step should typically be a long-running process (like a web server). If all commands exit, the service will be marked as unhealthy: The service is running, but its pipeline is no longer executing.
Base Image Configuration
Reactives use a shared, Codesphere-maintained Ubuntu base image by default (Codesphere Defaults). This image is pre-warmed and pooled for near-instant startup (milliseconds). You can customize the runtime environment by installing dependencies via Nix. There is also a Custom Base Image option available for advanced use cases, which acts as the basis for Managed Containers.
Mounting Paths
By default, all Reactive services mount the entire /home/user/app directory from the shared network filesystem. You can restrict a service to only mount a specific subdirectory using the Mounting Paths setting.
Use cases for mount sub paths:
- Isolate file access between services to prevent accidental overwrites
- Improve security by limiting each service's filesystem scope
- Organize multi-service architectures with dedicated directories
warning
Only files written in /home/user/app are persisted to the network file system and shared across all services. Files written elsewhere exist only on the local disk of that specific pod and will not be available to other services or replicas. These local files are also lost across Workspace restarts which may happen due to scaling or Codesphere updates.
run:
my-service:
# Only mounts /home/user/app/uploads
volumeMounts:
- name: _workspace
mountPath: /home/user/app
workspacePath: uploads
steps:
- name: Start Server
command: npm start
- steps: List of execution steps, each with a
nameandcommand. Commands run sequentially at service startup. - volumeMounts (optional): Restricts the service to a subdirectory of
/home/user/app.
Example commands:
npm start— Node.js applicationuv run uvicorn main:app --port 3000 --host 0.0.0.0— Python application./gradlew bootRun— Spring Boot application
Resources
- UI
- YAML

Each service has a resource plan that determines the vCPUs, memory, and storage allocated to it. The available plans and their pricing are configured by your cluster administrator and may vary between installations.
To configure resources:
- Select a Plan from the list (each plan shows its vCPU, memory, and storage allocation)
- Set the Availability mode:
- Always on: The service runs continuously, ideal for production workloads
- Off when unused: The service automatically stops after a period of inactivity and restarts when the domain or workspace is accessed, great for preview deployments or development environments
- Set the Default Replicas count for horizontal scaling using the
−/+controls
info
The screenshot shows a cost summary at the bottom with per-resource and total monthly cost estimates. Note that this may not be visible on all installations.
For details on how plans are defined and customized, see the Plans Configuration article.
Scaling strategies:
| Type | Description | Best For |
|---|---|---|
| Vertical Scaling | Increase vCPUs/memory by selecting a higher plan | Compute-intensive or memory-intensive workloads |
| Horizontal Scaling | Add multiple replicas of the same service | Handling increased request volume |
run:
api-server:
plan: 21 # Resource tier (determines CPU/memory)
replicas: 3 # Number of instances
steps:
- name: Start Server
command: node server.js
- plan: The resource tier ID that determines CPU and memory allocation.
- replicas (optional): Number of service instances for horizontal scaling. Defaults to 1.
tip
For development environments, smaller plans with "Off when unused" enabled provide significant cost savings. Reserve larger plans and multiple replicas for production workloads.
Ports & Routes
- UI
- YAML

Health Check
By default, the Landscape Router pings your Reactive services on port 3000 to check their health. You can configure a custom health endpoint, e.g. http://localhost:8080/health, if your application uses a different port or path for health checks. Furthermore, the request is executed from within the service container, so the application must be accessible at localhost. If it is bound to a different interface, specify the appropriate IP address or hostname instead.
info
Every service needs at least one route defined. Without a route, the Workspace Router does not pick up the service — it will not be considered healthy and will not be reachable from outside the Landscape.
Configure Ports
This section defines the ports your service exposes. Internal communication between services should use internal port URLs, while ports can be made accessible through the Workspace Router below. Routing can also be customized further via custom domains.
Reactives within a Landscape communicate using internal URLs: http://ws-server-[WorkspaceId]-[serviceName].workspaces:[port]. You can copy a service's internal URL from the Copy button on the right-hand side.
To expose a new port:
- Click + Add New Port on the right side
- Enter the Port number your application listens on
- Optionally, you can expose a Public Port URL via the action menu (three-dot icon) on the port row. This directly exposes a public URL for the port, which can be copied via the context menu. This is less secure than using path routing and typically only needed in older legacy frameworks.
Workspace Router
Routes map incoming HTTP requests to your services based on URL path prefixes. The router also supports a Strip Path option that removes the matched prefix before forwarding the request to your service.
To add a route:
- Click + Add New Route
- Enter the Path prefix (e.g.,
/,/api,/admin) - Select the Port to route traffic to
- Optionally enable Strip Path to remove the prefix before forwarding
The Routing for Other Services section at the bottom shows routes defined by other services in the same Landscape, which is helpful for spotting conflicts or getting an overview of the full routing table.
run:
backend:
healthEndpoint: http://localhost:8080/health
network:
ports:
- port: 8080
isPublic: false
paths:
- port: 8080
path: /api
steps:
- command: npm run start:backend
- healthEndpoint (optional): Custom health check URL. Defaults to
http://localhost:3000/. The request is executed from within the service container, so the application must be accessible at localhost. If it is bound to a different interface, specify the appropriate IP address or hostname instead. - network.ports: List of ports the service exposes. Set
isPublic: trueto expose a direct public URL (not recommended). - network.paths: Maps URL path prefixes to ports for the Workspace Router.
Example routing configuration:
| Path | Service | Description |
|---|---|---|
/ | frontend | Main application UI |
/api | backend | REST API endpoints |
/ws | websocket-server | WebSocket connections |
Environment Variables
- UI
- YAML

Environment variables let you pass configuration to your services without hardcoding values. They are injected at runtime.
To add environment variables:
- Open the Environment Variables section in the service configuration
- Click + Add New Variable
- Enter the Key (variable name)
- Enter the Value, either as plain text or by selecting from the dropdown categories: User Inputs, Global Values, Secrets, Global Constants, Team ID, or Workspace ID
For more details, see Environment Variables.
run:
my-service:
env:
NODE_ENV: production
SECRET_KEY: ${{ vault.secretFoo }}
DB_PASSWORD: ${{ vault.dbPassword }}
PG_USER: ${{ workspace.env['BACKEND_PG_USER'] }}
- env: Key-value pairs injected as environment variables at runtime.
Template syntax for values:
| Template | Description |
|---|---|
${{ vault.NAME }} | References a secret from the Codesphere vault |
${{ workspace.id }} | Resolves to the Workspace ID |
${{ team.id }} | Resolves to the Team ID |
${{ workspace.env['KEY'] }} | References a global workspace environment variable |
Secrets are stored encrypted and only injected at runtime. See Secret Management for details.
Managed Containers
Managed Containers are Reactives at their core, but let you bring your own Docker image instead of using the Codesphere-maintained base image. This means you get the same platform orchestration, networking, and monitoring while running a custom container. For a detailed overview, see Runtimes.
To add a Managed Container, select Managed Container from the service type picker.
- UI
- YAML
Corresponding accessible text description
Base Image Configuration:
- Enter the full image reference (e.g.,
nginx:1.25-alpine,node:20-slim) - For private registries, ensure appropriate credentials are configured
- Set Startup Args to override the container’s default command if needed. The entrypoint remains the image’s default. If you want to override the entrypoint, you would need to use Codesphere Reactives instead and use your image as a custom base image.
- Set Mounting Paths (
volumeMounts) to control which directories or files from the workspace are mounted into the container and where.
Run As User/Group:
- Set User ID (
runAsUser) to define which user account the service runs as inside the container. - Set Group ID (
runAsGroup) to define which user group the service belongs to inside the container. - These control file access and process-level permissions and should match the ownership expectations of your application and mounted files.
The access level to the workspace filesystem depends on which User ID or Group ID you set here:
- Using the User ID
1501, the container process will have the same read/write access to the workspace files. - Using a different User ID, the container process will have read access to all files and write access to the root of the mounted volume but not to subdirectories.
- Regardless of your configured Group ID, Codesphere adds the GID
1010directly for the Workspace FS. The defined GID affects the owner group of files created by your Services. - You can set write access to a specific subdirectory for the Group ID by running
chmod g+w some-dirin the prepare stage.
Startup Performance
Managed Containers have startup times in the seconds range (vs milliseconds for Reactives) due to image pulling and initialization. Actual speed depends on image size and network performance to the registry.
All other configuration options (resources, ports, routes, environment variables) work the same as for Codesphere Reactives — see the sections above.
run:
alpine-image:
image: alpine:latest
steps:
- name: Run Alpine
command: echo "Hello from Alpine!"
plan: 21
network:
ports:
- port: 80
isPublic: false
paths:
- port: 80
path: /
nginx-server:
image: nginx-unprivileged:1.25-alpine
command: ["-g", "daemon off;"]
plan: 21
healthEndpoint: http://localhost/
network:
ports:
- port: 80
isPublic: false
paths:
- port: 80
path: /
env:
NGINX_HOST: example.com
volumeMounts:
- name: _workspace
mountPath: /etc/nginx/nginx.conf
workspacePath: custom-nginx.conf
runAsUser: 1000
runAsGroup: 1000
- image: The Docker image to use (e.g.,
nginx-unprivileged:1.25-alpine,node:20-slim,myregistry.com/repo/myimage:tag). - runAsUser / runAsGroup (optional): Set the user and group ID the container runs as.
- command (optional): Overrides the container’s default command. Specify it as an array of arguments (e.g.,
["-g", "daemon off;"]). The entrypoint remains the image’s default. This field is mutually exclusive withstepsand cannot be used in the same service. - volumeMounts (optional): You can mount files and folders from the workspace into arbitrary paths in the container.
- All other fields (
plan,network,env, etc.) work the same as for Reactives.
Cloud Native Deployments
Cloud Native Deployments provide a virtual managed Kubernetes cluster with full kubectl access, designed for advanced orchestration scenarios. For a detailed overview, see Virtual Clusters.
Expert Runtime
This runtime is aimed at users with prior Kubernetes experience. If you're new to container orchestration, consider starting with Codesphere Reactives or Managed Containers.
Set up a Cloud Native Deployment
- UI
- YAML
- Provision the cluster: Add a virtual Kubernetes cluster from the Managed Services section of the UI or API. Note that each team can only have one virtual cluster at a time.
- Access the cluster: Once provisioned, retrieve the kubeconfig from the API to connect using
kubectl. - Deploy workloads: Use
kubectlcommands in the prepare or run steps, or interact directly via the terminal.
Deploy K8s Manifests via kubectl:
prepare:
steps:
- name: Deploy Application
command: |
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
Deploy a Helm Chart:
prepare:
steps:
- name: Deploy with Helm
command: |
helm repo add corp42 https://charts.corp42.net
helm repo update
helm install my-release corp42/my-awesome-app -n app --create-namespace -f values-codesphere.yaml
Platform Integration
Deep lifecycle integration into the Codesphere ci.yml is currently a work in progress. Available features:
| Feature | Status |
|---|---|
| Virtual cluster provisioning | ✅ Available |
| kubectl access | ✅ Available |
| Helm deployments | ✅ Available |
| Monitoring integration | Manual configuration required |
| Networking integration | Manual configuration required |
For full platform features (automatic monitoring, integrated networking, off-when-unused), use Reactives or Managed Containers.
Managed Services in Landscapes
While you can create standalone Managed Services that persist indefinitely, for many use cases it is best practice to define Managed Services as part of your Landscape configuration. This ensures that your application environments are self-contained and reproducible.
For example, when you spin up a Development or Staging Landscape, Codesphere can automatically provision a dedicated PostgreSQL database for that specific environment, and tear it down when the Landscape is no longer needed.
Adding a Managed Service to a Landscape
You can define Managed Services in your ci.yml (or specific CI Profile like ci.dev.yml) using the Landscape Config Editor or by editing the YAML file directly.
- UI
- YAML

- Select Type: Choose **Databases & More ** from the dropdown/modal.
- Choose Provider: Select the service you need (e.g., PostgreSQL, Redis, S3).
- Configure: Set the version, plan, and configuration parameters.
- Name: Specify a name (e.g.,
primary-db). This name will be used to reference the service within your Landscape.
- Name: Specify a name (e.g.,
- Secrets: Define the secrets required by the service (e.g., passwords). You can reference project-level secrets or generate new ones.
- Save: The service is now added to your Landscape profile. It will be provisioned the next time you deploy this Landscape.
You can define Managed Services in your ci.yml file. This is useful for "Infrastructure as Code" practices. The UI will also generate this YAML for you, but you can also write it manually if you prefer.
-
Edit Profile: Click Edit as File in the top right corner and edit the profile definition to add a new service to the
runsection. This example defines a PostgreSQL database.schemaVersion: v0.2# ... existing prepare and run stages ...run:my-postgres-db:provider:name: postgresversion: v1plan:id: 0parameters:storage: 10000cpu: 5memory: 500config:version: "17.6"userName: "${{ workspace.env.pgUser }}"databaseName: "${{ workspace.env.pgDb }}"secrets:userPassword: "${{ vault.pgPassword }}"superuserPassword: "${{ vault.pgSuperuserPassword }}"- Key (e.g.,
my-postgres-db): The name and unique identifier for this service in the Landscape.warning
Renaming a service requires the system to recreate it, which could lead to data loss. Proceed with caution here.
- provider: The type of service (matches the provider name in the catalog).
- secrets: Can reference Codesphere vault-secrets using
${{ vault.NAME }}syntax.

info
The Managed Service definition must use a valid provider configuration for the service you're deploying (e.g., plan IDs, versions, and config parameters). You can find the allowed values by calling the
get providerendpoint in the Codesphere Public API or creating the initial scaffolding through the UI before editing theYAMLfile manually. - Key (e.g.,
-
Save: Save the profile (Ctrl + S or Cmd + S)
-
Sync Landscape: Go to the Execution Manager tab and click Sync Landscape in the top middle of the Landscape Deployment section. Confirm resource usage. This will apply the changes to the profile and trigger provisioning of the Managed Services.

-
Secrets: Enter the necessary secrets that you used earlier to define the Managed Service. In this example,
pgPasswordandpgSuperuserPassword. These will be securely stored in the Codesphere vault and injected into the service when it is provisioned.
The service will now be created and available for your application to connect to when you deploy this Landscape.
Connecting to the Service
Once a Managed Service is provisioned, your application can connect to it. See the Managed Service Provider Reference for provider-specific connection details.
Service Discovery & Environment Variables
Codesphere allows you to inject connection details into your application using Environment Variables.
- Secrets: You can pass the secrets defined in the Managed Service directly to your application's environment variables.
- Hostnames: To see concrete hostname construction examples for a specific service, check that provider's page in the provider reference.
Lifecycle Management
- Creation: The Managed Service is created when the specific Landscape Profile (e.g.,
dev) is deployed. - Updates: Changes to the
ci.ymlconfiguration (e.g., changing the plan or config) will update the service on the next deployment. - Pause: If the Landscape supports "Off when unused", the Managed Services may also be paused to save costs (depending on the service capabilities).
- Deletion: When the Landscape is deleted, the associated Managed Services are automatically destroyed, preventing orphan resources and extra costs.
service renaming
Renaming a managed service in the ci.yml file requires the system to recreate it, which could lead to data loss.
Differences from Standalone Services
| Feature | Landscape Managed Service | Standalone Managed Service |
|---|---|---|
| Definition | Defined in ci.yml | Created via UI / API manually |
| Lifecycle | Tied to Landscape (created/deleted with it) | Independent (persist until manually deleted) |
| Use Case | Dev, Test, Review Environments | Production, Long-running Shared Databases |
| Configuration | Infrastructure as Code (Git-tracked) | Manual Configuration |
Versioned ci.yml Schemas
- v0.4
- v0.3
- v0.2
- v0.1
# Example fixture for the current schema after the managed-service provider schemaVersion rename.
# `schemaVersion` pins the fixture to the current pipeline schema.
schemaVersion: v0.4
# `prepare` runs setup before tests and deploys.
prepare:
# `steps` lists sequential setup commands.
steps:
# `name` is a descriptive label only.
- name: Install dependencies
# `command` is the shell command to execute.
command: yarn install
# `test` runs verification commands after setup.
test:
# `steps` keeps the same stage shape as `prepare`.
steps:
# `name` documents the test step.
- name: Run unit tests
# `command` runs the example test suite.
command: yarn test --run
# `run` contains the named deploy targets for the workspace.
run:
# Reactive runtime with the full set of supported server fields.
reactive-app:
# `steps` defines the lifecycle commands for a reactive runtime.
steps:
# Build the app before startup.
- name: Build app
# Produce deployable build output.
command: yarn build
# Start the application process.
- name: Start app
# Launch the runtime server.
command: yarn start
# `image` optionally customizes the reactive base image.
image: ghcr.io/codesphere-cloud/example-reactive:latest
# `healthEndpoint` is probed to determine readiness.
healthEndpoint: http://127.0.0.1:3000/healthz/app
# `plan` selects the workspace plan.
plan: 20
# `replicas` requests horizontal scaling.
replicas: 2
# `isPublic` is ignored when advanced `network` settings are present.
isPublic: true
# `network` defines exposed ports and routed paths.
network:
# `ports` exposes raw runtime ports.
ports:
# `port` is the runtime port number to expose.
- port: 3000
# `isPublic` makes the port reachable from outside the workspace.
isPublic: true
- port: 9229
isPublic: false
# `paths` maps HTTP prefixes onto runtime ports.
paths:
# Route the root path to port `3000`.
- port: 3000
path: /
stripPath: false
# Route `/api` to port `3000` and strip the prefix.
- port: 3000
path: /api
stripPath: true
# `env` injects runtime environment variables.
env:
# Example string env var.
NODE_ENV: production
# Example numeric env var.
PORT: 3000
# `runAsUser` sets the runtime UID.
runAsUser: 1000
# `runAsGroup` sets the runtime GID.
runAsGroup: 1000
# `volumeMounts` attaches workspace storage into the runtime.
volumeMounts:
# `name` selects the workspace volume.
- name: _workspace
# `mountPath` is the destination inside the runtime.
mountPath: /home/user/app
# `workspacePath` selects which subdirectory to mount.
workspacePath: ""
# Container runtime with the full set of supported server fields.
container-app:
# `image` is required for container runtimes.
image: ghcr.io/codesphere-cloud/example-container:latest
# `command` overrides the image entrypoint/command.
command:
# First argv entry.
- node
# Second argv entry.
- server.js
# The rest of the fields are shared with reactive runtimes.
healthEndpoint: http://127.0.0.1:8080/healthz/app
# `plan` selects the workspace plan.
plan: 20
# `replicas` requests horizontal scaling for this runtime.
replicas: 1
# `isPublic` allows the routed service to be reachable externally.
isPublic: true
# This simple network shape publishes one routed path.
network:
# `path` is the public prefix for this service.
path: /container
# `stripPath` controls whether the prefix is preserved upstream.
stripPath: false
env:
# Example string env var.
NODE_ENV: production
# Example numeric env var.
PORT: 8080
# `runAsUser` sets the runtime UID.
runAsUser: 1000
# `runAsGroup` sets the runtime GID.
runAsGroup: 1000
# `volumeMounts` attaches workspace storage into the runtime.
volumeMounts:
# `name` selects the workspace volume.
- name: _workspace
# `mountPath` is the destination inside the runtime.
mountPath: /home/user/app
# `workspacePath` selects which subdirectory to mount.
workspacePath: ""
# Managed service runtime in v0.4:
# - `provider.version` was renamed to `provider.schemaVersion`
# This key names the managed service instance.
postgres:
# `provider` identifies the catalog entry to provision.
provider:
# `name` selects the managed service type.
name: postgres
# `schemaVersion` is the renamed provider version field in v0.4.
schemaVersion: "14"
# `plan` selects the service plan and sizing.
plan:
# `id` identifies the chosen catalog plan.
id: 1
# `parameters` contains provider-specific numeric options.
parameters:
# `storage` requests disk capacity.
storage: 1024
# `cpu` requests compute capacity.
cpu: 1
# `memory` requests RAM capacity.
memory: 512
# `config` contains non-secret provider configuration.
config:
# `database` is an example provider config key.
database: app
# `extensions` shows that lists are allowed in config payloads.
extensions:
- pgcrypto
# `secrets` contains secret provider configuration.
secrets:
# `password` is an example secret key.
password: secret
# Example fixture for the v0.2 -> v0.3 migration where workspace mounts become explicit.
# `schemaVersion` selects the v0.3 parser rules.
schemaVersion: v0.3
# `prepare` runs setup work before tests and deploys.
prepare:
# `steps` lists the stage commands in execution order.
steps:
# `name` labels the step for humans.
- name: Install dependencies
# `command` is the shell command to run.
command: yarn install
# `test` runs verification after `prepare`.
test:
# `steps` keeps the same shape across all single-running stages.
steps:
# `name` documents the purpose of the test step.
- name: Run unit tests
# `command` runs the tests.
command: yarn test --run
# `run` contains named deploy targets.
run:
# v0.3 keeps the v0.2 deploy shapes, but makes workspace mounts explicit.
reactive-app:
# `steps` marks this target as a reactive runtime.
steps:
# Build before startup.
- name: Build app
# Produce the deployable app bundle.
command: yarn build
# Start the runtime process.
- name: Start app
# Launch the application server.
command: yarn start
# `image` optionally customizes the reactive base image.
image: ghcr.io/codesphere-cloud/example-reactive:latest
# `healthEndpoint` is polled after deployment.
healthEndpoint: http://127.0.0.1:3000/healthz/app
# `plan` selects the workspace plan for this runtime.
plan: 20
# `replicas` requests multiple runtime instances.
replicas: 2
# `isPublic` is ignored here because the advanced network shape is used below.
isPublic: true
# `network` configures public ports and HTTP routes.
network:
# `ports` exposes runtime ports directly.
ports:
# `port` is the runtime port number.
- port: 3000
# `isPublic` exposes this port externally.
isPublic: true
- port: 9229
isPublic: false
# `paths` maps HTTP routes to runtime ports.
paths:
# Route `/` to port `3000`.
- port: 3000
path: /
stripPath: false
# Route `/api` to the same port and strip the prefix.
- port: 3000
path: /api
stripPath: true
# `env` provides environment variables to the runtime.
env:
# String env var example.
NODE_ENV: production
# Numeric env var example.
PORT: 3000
# `runAsUser` sets the effective UID inside the runtime.
runAsUser: 1000
# `runAsGroup` sets the effective GID inside the runtime.
runAsGroup: 1000
# In v0.3 this commonly explicit mount becomes important.
volumeMounts:
# `name` refers to the workspace volume.
- name: _workspace
# `mountPath` is the in-container destination.
mountPath: /home/user/app
# `workspacePath` of `""` mounts the workspace root.
workspacePath: ""
# This target demonstrates the container-runtime branch of the schema.
container-app:
# `image` is the required runtime image.
image: ghcr.io/codesphere-cloud/example-container:latest
# `command` overrides the image startup command.
command:
# First argv segment.
- node
# Second argv segment.
- server.js
# Common deploy-server fields are shared with reactive runtimes.
healthEndpoint: http://127.0.0.1:8080/healthz/app
# `plan` selects the workspace plan for this runtime.
plan: 20
# `replicas` requests the instance count.
replicas: 1
# `isPublic` allows the simple network route to be exposed publicly.
isPublic: true
# This simple network shape publishes a single HTTP route.
network:
# `path` is the public route prefix.
path: /container
# `stripPath: false` forwards the full incoming path.
stripPath: false
env:
# String env var example.
NODE_ENV: production
# Numeric env var example.
PORT: 8080
# `runAsUser` sets the effective UID inside the runtime.
runAsUser: 1000
# `runAsGroup` sets the effective GID inside the runtime.
runAsGroup: 1000
# `volumeMounts` makes the workspace available inside the container.
volumeMounts:
# `name` refers to the workspace volume.
- name: _workspace
# `mountPath` is the in-container destination.
mountPath: /home/user/app
# `workspacePath` of `""` mounts the workspace root.
workspacePath: ""
# Managed service runtime in v0.3 still uses `provider.version`.
# This key names the service instance.
postgres:
# `provider` identifies the managed service type and version.
provider:
# `name` selects the provider implementation.
name: postgres
# `version` is still the field name before v0.4.
version: "14"
# `plan` chooses the service plan and parameters.
plan:
# `id` identifies the selected plan.
id: 1
# `parameters` carries provider-defined numeric sizing inputs.
parameters:
# `storage` requests persistent disk capacity.
storage: 1024
# `cpu` requests compute units for the service.
cpu: 1
# `memory` requests RAM for the service.
memory: 512
# `config` carries non-secret provider inputs.
config:
# `database` is a provider-defined config field.
database: app
# `extensions` shows that provider config can include lists.
extensions:
- pgcrypto
# `secrets` carries sensitive provider inputs.
secrets:
# `password` is a provider-defined secret value.
password: secret
# Example fixture for the first versioned pipeline schema with deploy runtimes.
# `schemaVersion` selects the parser rules for this fixture.
schemaVersion: v0.2
# `prepare` runs initial setup before tests and deployment.
prepare:
# Steps are executed sequentially inside the stage.
steps:
# Step names are descriptive only.
- name: Install dependencies
# Commands contain the shell instruction to execute.
command: yarn install
# `test` runs verification work after `prepare`.
test:
# Test steps use the same stage shape as `prepare`.
steps:
# This name explains what the test step does.
- name: Run unit tests
# The command launches the test suite.
command: yarn test --run
# `run` becomes a map of named deploy runtimes in v0.2.
run:
# Reactive runtime:
# - identified by `steps`
# - may optionally set `image`
# - all common deploy-server fields are supported
# The map key names this deploy target.
reactive-app:
# `steps` marks this as a reactive runtime and defines its lifecycle commands.
steps:
# This step builds the app before it starts.
- name: Build app
# The build command prepares production assets.
command: yarn build
# This step names the runtime startup command.
- name: Start app
# The start command launches the reactive process.
command: yarn start
# Optional custom base image for reactive execution.
image: ghcr.io/codesphere-cloud/example-reactive:latest
# Optional health endpoint used by the platform.
healthEndpoint: http://127.0.0.1:3000/healthz/app
# Optional workspace plan id.
plan: 20
# Optional replica count.
replicas: 2
# `isPublic` is ignored when `network` uses the advanced shape.
isPublic: true
# Advanced network config:
# - `ports` defines public/private TCP ports
# - `paths` defines routed HTTP paths
network:
# `ports` exposes raw TCP ports on the runtime.
ports:
# `port` is the container port that the platform should expose.
- port: 3000
# `isPublic` controls whether the port is reachable externally.
isPublic: true
- port: 9229
isPublic: false
# `paths` configures HTTP routing rules on top of the ports.
paths:
# `port` selects which runtime port receives this HTTP path.
- port: 3000
# `path` is the incoming route prefix to match.
path: /
# `stripPath` controls whether the prefix is removed before proxying.
stripPath: false
- port: 3000
path: /api
stripPath: true
# Environment values may be strings or numbers.
env:
# `NODE_ENV` is a representative string environment variable.
NODE_ENV: production
# `PORT` shows that numeric env values are accepted too.
PORT: 3000
# Optional user/group to run the process as.
runAsUser: 1000
# `runAsGroup` pairs with `runAsUser` for filesystem permissions.
runAsGroup: 1000
# Optional workspace mounts.
volumeMounts:
# `name` currently supports the workspace volume only.
- name: _workspace
# `mountPath` is where the workspace appears inside the runtime.
mountPath: /home/user/app
# `workspacePath` narrows the mounted subdirectory; empty means the root.
workspacePath: ""
# Container runtime:
# - identified by `image`
# - must not define `steps`
# - may optionally set `command`
# This second deploy target demonstrates the container-runtime shape.
container-app:
# `image` is required for container runtimes.
image: ghcr.io/codesphere-cloud/example-container:latest
# `command` overrides the image default entrypoint/command.
command:
# Command arrays are passed through as ordered argv segments.
- node
- server.js
# The remaining fields share the common deploy-server schema.
healthEndpoint: http://127.0.0.1:8080/healthz/app
plan: 20
replicas: 1
isPublic: true
# Simple network config routes one path to the main port.
network:
# `path` exposes the service under a single HTTP prefix.
path: /container
# `stripPath` keeps the `/container` prefix when forwarding requests.
stripPath: false
env:
NODE_ENV: production
PORT: 8080
runAsUser: 1000
runAsGroup: 1000
volumeMounts:
- name: _workspace
mountPath: /home/user/app
workspacePath: ""
# Managed service runtime in v0.2:
# - uses `provider.version`
# This key names the managed service instance.
postgres:
# `provider` identifies which service catalog entry to provision.
provider:
# `name` selects the provider type.
name: postgres
# `version` selects the provider schema version in v0.2/v0.3.
version: "14"
# `plan` selects a service plan and its numeric parameters.
plan:
# `id` identifies the chosen plan in the marketplace catalog.
id: 1
# Provider-specific integer parameters.
parameters:
# `storage` requests persistent disk capacity.
storage: 1024
# `cpu` requests compute units for the service.
cpu: 1
# `memory` requests RAM for the service.
memory: 512
# Arbitrary provider config payload.
config:
# `database` is a provider-defined config field.
database: app
# `extensions` shows that provider config can include lists.
extensions:
- pgcrypto
# Arbitrary provider secrets payload.
secrets:
# `password` is a provider-defined secret value.
password: secret
# Example fixture for the legacy pre-versioned parser shape.
# v0.1 has no top-level schemaVersion field yet.
# All three top-level entries are plain stages, not deploy-runtime maps.
# `prepare` runs setup work before tests or app startup.
prepare:
# Steps are executed sequentially.
steps:
# Step names are optional and only descriptive.
- name: Install dependencies
# Command is the only required field on a step.
command: yarn install
# `test` runs verification commands after `prepare`.
test:
# Test steps still use the same sequential stage shape as `prepare`.
steps:
# This label only helps readers identify the step in UIs or logs.
- name: Run unit tests
# The command contains the shell instruction to execute.
command: yarn test --run
# `run` executes the main workload for this legacy schema version.
run:
# In v0.1, `run` is still just a plain stage.
# Deploy runtimes such as reactive servers, container runtimes,
# and managed services are introduced in later versions.
# The run stage can also define a health endpoint.
healthEndpoint: http://127.0.0.1:3000/healthz/app
# Runtime steps are executed in order, just like any other stage.
steps:
# The step name documents the intent of the runtime command.
- name: Start dev server
# The command starts the long-running application process.
command: yarn start