Skip to content

Commit

Permalink
Setup db and es
Browse files Browse the repository at this point in the history
  • Loading branch information
zenizh committed Jan 3, 2017
1 parent 565f9f0 commit 2ae08ae
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 4 deletions.
66 changes: 65 additions & 1 deletion elasticsearch-rails/Gemfile.lock
Expand Up @@ -40,11 +40,32 @@ GEM
tzinfo (~> 1.1)
arel (7.1.4)
builder (3.2.2)
byebug (9.0.6)
coffee-rails (4.2.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.2.x)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.0.4)
debug_inspector (0.0.2)
erubis (2.7.0)
execjs (2.7.0)
ffi (1.9.14)
globalid (0.3.7)
activesupport (>= 4.1.0)
i18n (0.7.0)
jbuilder (2.6.1)
activesupport (>= 3.0.0, < 5.1)
multi_json (~> 1.2)
jquery-rails (4.2.2)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.4)
Expand All @@ -55,9 +76,12 @@ GEM
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
minitest (5.10.1)
multi_json (1.12.1)
nio4r (1.2.1)
nokogiri (1.7.0)
mini_portile2 (~> 2.1.0)
pg (0.19.0)
puma (3.6.2)
rack (2.0.1)
rack-test (0.6.3)
rack (>= 1.0)
Expand Down Expand Up @@ -85,6 +109,21 @@ GEM
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (12.0.0)
rb-fsevent (0.9.8)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
sass (3.4.23)
sass-rails (5.0.6)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
spring (2.0.0)
activesupport (>= 4.2)
spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0)
spring (>= 1.2, < 3.0)
sprockets (3.7.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
Expand All @@ -94,8 +133,19 @@ GEM
sprockets (>= 3.0.0)
thor (0.19.4)
thread_safe (0.3.5)
tilt (2.0.5)
turbolinks (5.0.1)
turbolinks-source (~> 5)
turbolinks-source (5.0.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (3.0.4)
execjs (>= 0.3.0, < 3)
web-console (3.4.0)
actionview (>= 5.0)
activemodel (>= 5.0)
debug_inspector
railties (>= 5.0)
websocket-driver (0.6.4)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
Expand All @@ -104,7 +154,21 @@ PLATFORMS
ruby

DEPENDENCIES
rails (= 5.0.0.1)
byebug
coffee-rails (~> 4.2)
jbuilder (~> 2.5)
jquery-rails
listen (~> 3.0.5)
pg (~> 0.18)
puma (~> 3.0)
rails (~> 5.0.0, >= 5.0.0.1)
sass-rails (~> 5.0)
spring
spring-watcher-listen (~> 2.0.0)
turbolinks (~> 5)
tzinfo-data
uglifier (>= 1.3.0)
web-console

BUNDLED WITH
1.13.6
6 changes: 4 additions & 2 deletions elasticsearch-rails/config/database.yml
Expand Up @@ -21,9 +21,11 @@ default: &default
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>

development:
development: &development
<<: *default
database: app_development
username: postgres
host: db

# The specified database role being used to connect to postgres.
# To create additional roles in postgres see `$ createuser --help`.
Expand Down Expand Up @@ -56,7 +58,7 @@ development:
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
<<: *development
database: app_test

# As with config/secrets.yml, you never want to store sensitive information,
Expand Down
18 changes: 18 additions & 0 deletions elasticsearch-rails/db/schema.rb
@@ -0,0 +1,18 @@
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 0) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

end
7 changes: 6 additions & 1 deletion elasticsearch-rails/docker-compose.yml
Expand Up @@ -3,9 +3,10 @@ services:
web:
build: .
command: bundle exec rails s -p 3000 -b 0.0.0.0
container_name: web
container_name: elasticsearch_web
depends_on:
- db
- elasticsearch
ports:
- 3000:3000
stdin_open: true
Expand All @@ -16,6 +17,10 @@ services:
- bundle
db:
image: postgres
elasticsearch:
image: elasticsearch
ports:
- 9200:9200
bundle:
image: busybox
volumes:
Expand Down

0 comments on commit 2ae08ae

Please sign in to comment.