Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM ruby:2.1.5
RUN apt-get update -qq && apt-get install -y build-essential ruby-dev libxslt1-dev libxml2-dev libpq-dev nodejs sqlite3 postgresql-client redis-server

RUN git clone https://github.com/nomlab/camome.git

WORKDIR camome

RUN bundle install --path vendor/bundle
ADD config/secrets.yml config/secrets.yml
ADD config/application_settings.yml config/application_settings.yml
ADD config/database.yml config/database.yml
RUN git submodule init
RUN git config submodule.vendor/assets/bootstrap-table.url https://github.com/wenzhixin/bootstrap-table.git
RUN git config submodule.vendor/assets/jsSHA.url https://github.com/Caligatio/jsSHA.git
RUN git submodule update
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ source 'https://rubygems.org'
gem 'rails', '4.1.8'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
Expand Down
4 changes: 3 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ GEM
less-rails (2.6.0)
actionpack (>= 3.1)
less (~> 2.6.0)
libv8 (3.16.14.7)
libv8 (3.16.14.19)
mail (2.6.3)
mime-types (>= 1.16, < 3)
mime-types (2.4.3)
Expand Down Expand Up @@ -123,6 +123,7 @@ GEM
oauth2 (~> 1.0)
omniauth (~> 1.2)
orm_adapter (0.5.0)
pg (0.21.0)
rack (1.5.2)
rack-test (0.6.2)
rack (>= 1.0)
Expand Down Expand Up @@ -232,6 +233,7 @@ DEPENDENCIES
nokogiri
omniauth
omniauth-google-oauth2
pg
rails (= 4.1.8)
redis
rspec-rails
Expand Down
4 changes: 3 additions & 1 deletion app/models/redis_store.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
require 'uri'
module DataStore
class RedisStore < Base
def initialize
@redis = Redis.new
uri = URI.parse(ApplicationSettings.redis.url)
@redis = Redis.new(host: uri.host, port: uri.port)
end

def load(key)
Expand Down
2 changes: 1 addition & 1 deletion app/views/events/_recurrence_item.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<tr>
<% event_count = Event.where("recurrence_id IS ?", recurrence.id).size %>
<% event_count = Event.where("recurrence_id = ?", recurrence.id).size %>
<td class="recurrence-item" id="<%=recurrence.id%>"><%= recurrence.name %> (<%= event_count %>)</td>
</tr>
2 changes: 1 addition & 1 deletion app/views/inbox/_recurrence_item.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<tr>
<% event_count = Event.where("recurrence_id IS ?", recurrence.id).size %>
<% event_count = Event.where("recurrence_id = ?", recurrence.id).size %>
<td class="recurrence-item" id="<%=recurrence.id%>"><%= recurrence.name %> (<%= event_count %>)</td>
</tr>
2 changes: 2 additions & 0 deletions config/application_settings_sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ default: &default
google:
application_id: XXXXXXXXXXXXXXXXX
application_secret: XXXXXXXXXXXXXXXXX
redis:
url: redis://XXXXX:6379

development:
<<: *default
Expand Down
26 changes: 26 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '2'
services:
db:
container_name: db
image: postgres
expose:
- "5432"

web:
container_name: camome
build: .
command: bundle exec rails s -p 3000 -b '0.0.0.0'
ports:
- "3000:3000"
links:
- redis
- db

redis:
container_name: redis
image: redis
expose:
- "6379"
volumes:
- ./redis:/data
command: redis-server --appendonly yes