Skip to content

Instantly share code, notes, and snippets.

@ianmalott
Last active March 23, 2017 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianmalott/b47d89fbc7785c6118f203435a0233a1 to your computer and use it in GitHub Desktop.
Save ianmalott/b47d89fbc7785c6118f203435a0233a1 to your computer and use it in GitHub Desktop.
Trying out Praxis

Praxis

Praxis is a reimagination of Rack that more completely abstracts away the computer.
Run racks in the cloud or locally with full functionality.
The API is the same for both.
Configure it all in a single convox.yml file.

Trying out Praxis

Follow these steps to run a rack locally and then run an app in it.

  1. Start a local rack.

    go get github.com/convox/praxis/cmd/cx
    cx rack start
    
  2. Add a convox.yml to the root directory of your app.

    Template

    balancers:
      <balancer-name>:
        <exposed-port>/<protocol>: <protocol>://<service-name>:<service-port>
    services:
      <service-name>:
        build: <build-context>
        environment:
          - <VAR-NAME>=<value>
          - <VAR-NAME>=<value>
      <service-name>:
        image: <image-name>[:<tag>]

    Example

    balancers:
      app:
        80/http: http://rails:3000
      database:
        5432/tcp: tcp://postgres:5432
    services:
      rails:
        build: .
        environment:
          - DATABASE_URL=postgresql://postgres:password@172.16.123.1:5432/app
          - RAILS_ENV
      postgres:
        image: convox/postgres
  3. Create an app in the rack.

    cx apps create <app-name>
    
  4. Start the app.

    cx start
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment