Skip to content

kickstarter/compose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compose

A helper to fetch dynamically allocated ports with Docker Compose.

Installation

Add the following to your Gemfile

gem 'compose', git: 'https://github.com/kickstarter/compose'

Usage

Fetch the currently allocated port for a service:

Compose.port(:redis, 6379)
# => 49811

Fetch the port and interpolate it into a template string:

Compose.port(:redis, 6379, 'redis://localhost:%s/')
# => "redis://localhost:49811/"

Use in a Rails config YAML file:

# ./config/redis.yml
---
development:
  host: localhost
  port: <%= Config.port(:redis, 6379) %>
  url: <%= Config.port(:redis, 6379, 'redis://localhost:%s/') %>

About

Helper for using Docker Compose services with Rails

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages