Skip to content

Commit

Permalink
Pass variable in .env file to the container and create bin/drun helpe…
Browse files Browse the repository at this point in the history
…r script

This helper script can be used to run commands inside the container
which runs the rails server.

Example usage:
bin/drun bin/rails c          # Starts the rails console inside the container
bin/drun bin/rake db:migrate  # Runs migrations
bin/drun bash                 # Starts a bash shell inside the container
  • Loading branch information
jimmykarily committed Apr 22, 2017
1 parent 1c34995 commit e6d7adf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bin/drun
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

docker exec -it $(docker ps | grep testributor-development-katana | awk '{print $1}') $@
2 changes: 2 additions & 0 deletions development-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ services:
RAILS_ENV: development
SECRET_KEY_BASE: e9744e038fb87c6bfb52d5aa0f2f1a865fbd242a6ce162cb6e5cae9e5e90c558c32f369d3d68ea0ae5325916fb55507a164011964edc4ac2bf1a31a0573efe73
REDIS_URL: redis://redis:6379
env_file:
- .env
ports:
- "3000:3000"
postgres:
Expand Down

0 comments on commit e6d7adf

Please sign in to comment.