diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..f28653c2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM ruby:2.3.1 + +RUN apt-get update -yqq \ + && apt-get install -yqq --no-install-recommends \ + postgresql-client \ + nodejs \ + qt5-default \ + libqt5webkit5-dev \ + && apt-get -q clean \ + && rm -rf /var/lib/apt/lists + +WORKDIR /usr/src/app +COPY Gemfile* ./ +RUN bundle install +COPY . . + +CMD bundle exec unicorn -c ./config/unicorn.rb diff --git a/config/secrets.yml b/config/secrets.yml new file mode 100644 index 00000000..9ceb4d9a --- /dev/null +++ b/config/secrets.yml @@ -0,0 +1,8 @@ +development: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> + +development: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> + +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..9922414a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,36 @@ +version: "2" + +volumes: + db-data: + external: false + +services: + cache: + image: memcached:1.4-alpine + + db: + environment: + POSTGRES_USER: + POSTGRES_PASSWORD: + image: postgres:9.5 + volumes: + - db-data:/usr/local/pgsql/data + + jobs: + env_file: .env + build: . + volumes: + - .:/usr/src/app + command: bundle exec rake jobs:work + depends_on: + - db + + app: + env_file: .env + build: . + volumes: + - .:/usr/src/app + ports: + - "8080:8080" + depends_on: + - db diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4a64726b..b5d02bdb 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,6 +5,9 @@ ENV["RAILS_ENV"] = "test" +require "dotenv" +Dotenv.overload(".sample.env") + require File.expand_path("../../config/environment", __FILE__) require "rspec/rails"