From 78aa7f5f96ea1dc98dd6b4d46e1f5dfb3b4d414c Mon Sep 17 00:00:00 2001 From: Alan deLevie Date: Fri, 14 Oct 2016 14:13:55 -0400 Subject: [PATCH] attempting dockerization for local dev --- Dockerfile | 11 +++++++++++ Gemfile | 1 + Gemfile.lock | 8 +++++++- docker-compose.yml | 21 +++++++++++++++++++++ script/start | 2 ++ 5 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..8ae70aed1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM ruby:2.3 + +ENV app /app +RUN mkdir $app +WORKDIR $app + +ENV BUNDLE_PATH /box + +ADD . $app + +CMD rails s -b 0.0.0.0 diff --git a/Gemfile b/Gemfile index 7d8c9587b..c86fd6532 100644 --- a/Gemfile +++ b/Gemfile @@ -27,6 +27,7 @@ gem "elasticsearch-dsl" gem "elasticsearch-model" gem "elasticsearch-rails" gem "elasticsearch-rails-ha", "~> 1.0.5" +gem "therubyracer" gem "email_reply_parser" gem "factory_girl_rails" gem "faker" diff --git a/Gemfile.lock b/Gemfile.lock index 854e2039b..129f9bf24 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -285,6 +285,7 @@ GEM actionmailer (>= 3.2) letter_opener (~> 1.0) railties (>= 3.2) + libv8 (3.16.14.15) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) @@ -433,6 +434,7 @@ GEM rb-inotify (0.9.7) ffi (>= 0.5.0) redcarpet (3.3.4) + ref (2.0.0) referer-parser (0.3.0) request_store (1.3.1) responders (2.1.1) @@ -510,6 +512,9 @@ GEM sprockets (>= 2.8, < 4.0) test_after_commit (1.0.0) activerecord (>= 3.2) + therubyracer (0.12.2) + libv8 (~> 3.16.14.0) + ref thor (0.19.1) thread_safe (0.3.5) tilt (2.0.2) @@ -625,6 +630,7 @@ DEPENDENCIES spring-commands-rspec sprockets-rails (< 3) test_after_commit + therubyracer timecop uglifier validates_email_format_of @@ -636,4 +642,4 @@ RUBY VERSION ruby 2.3.1p112 BUNDLED WITH - 1.13.0 + 1.13.2 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..3626c95c0 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +app: + build: . + command: ./script/start + volumes: + - .:/app + volumes_from: + - box + links: + - db + +box: + image: busybox + volumes: + - /box + +db: + image: postgres + ports: + - "5432" + environment: + - DATABASE_NAME=c2_development diff --git a/script/start b/script/start index 67ee2284a..6189f4a81 100755 --- a/script/start +++ b/script/start @@ -1,5 +1,7 @@ #!/bin/sh +bundle check || bundle install + set -e set -x