From e6d7adf9f10c5a28c0064a86bf5ac5feab763de3 Mon Sep 17 00:00:00 2001 From: Dimitris Karakasilis Date: Sat, 22 Apr 2017 13:00:34 +0300 Subject: [PATCH] Pass variable in .env file to the container and create bin/drun helper 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 --- bin/drun | 3 +++ development-docker-compose.yml | 2 ++ 2 files changed, 5 insertions(+) create mode 100755 bin/drun diff --git a/bin/drun b/bin/drun new file mode 100755 index 00000000..21e4f2d1 --- /dev/null +++ b/bin/drun @@ -0,0 +1,3 @@ +#!/bin/bash + +docker exec -it $(docker ps | grep testributor-development-katana | awk '{print $1}') $@ diff --git a/development-docker-compose.yml b/development-docker-compose.yml index 4420d8f9..feb5769a 100644 --- a/development-docker-compose.yml +++ b/development-docker-compose.yml @@ -20,6 +20,8 @@ services: RAILS_ENV: development SECRET_KEY_BASE: e9744e038fb87c6bfb52d5aa0f2f1a865fbd242a6ce162cb6e5cae9e5e90c558c32f369d3d68ea0ae5325916fb55507a164011964edc4ac2bf1a31a0573efe73 REDIS_URL: redis://redis:6379 + env_file: + - .env ports: - "3000:3000" postgres: