The convox.yml file is a manifest used to describe your application and all of its infrastructure needs. This file is similar to a Docker Compose file but allows for detailed configuration options for your environments.

For a simple Rails application with a Postgres Database the convox.yml file might look like:

resources:
  postgres:
    type: postgres
services:
  web:
    build: .
    command: bundle exec rails server -b 0.0.0.0 -p 3000
    port: 3000
    resources:
      - postgres

Accessing Resources

You can access defined resources from services with environment variables. In the above example, the postgres resource provides a POSTGRES_URL variable that is accessible from the web service.

The environment variable name is the resource name converted to all-caps, with a _URL suffix.

This would contain the entire connection string you would need, ie:

POSTGRES_URL=postgres://username:password@host.com:5432/databaseName

Complete convox.yml options

For a complete set of options available in convox.yml can click on the various sections in the template below.