diff --git a/.ruby-version b/.ruby-version index b1b25a5..bc4abe8 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.2.2 +2.3.8 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6871cf1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM ruby:2.3.8 + +ENV RAILS_ENV=production + +RUN apt update && apt install -y nodejs cmake + +WORKDIR /app + +COPY ./Gemfile ./Gemfile.lock /app/ + +RUN gem install bundler + +COPY . /app + +RUN bundle install + + +CMD bundle exec rails s -b 0.0.0.0 diff --git a/Gemfile b/Gemfile index e36c33a..bc63db7 100644 --- a/Gemfile +++ b/Gemfile @@ -104,7 +104,7 @@ gem 'friendly_id' gem 'jquery-turbolinks' # Use datenfisch (https://github.com/Iasoon/datenfisch.git) -gem 'datenfisch', git: 'git://github.com/iasoon/datenfisch-sucks.git', +gem 'datenfisch', git: 'https://github.com/iasoon/datenfisch-sucks.git', ref: '4f39bb3686b5facfb2552fe186d568ce3d259993' # Use jQuery plugin datatables (https://github.com/DataTables/DataTables) diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 478b88c..cd73a86 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -10,6 +10,8 @@ # Configure the class responsible to send e-mails. # config.mailer = 'Devise::Mailer' + config.secret_key = '01fc1ab3cb991eb1e4cdb11ee7f99dbdd530da38eda3928627f7ab5c19632d8f47c203b988e29f9c7dc18f619d5bf7da3a682f1dd935d9174f6a2a04d0bae36f' + # ==> ORM configuration # Load and configure the ORM. Supports :active_record (default) and # :mongoid (bson_ext recommended) by default. Other ORMs may be diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..2571db0 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,32 @@ +version: '3.3' + +services: + db: + image: mariadb:10.8 + volumes: + - db_data:/var/lib/mysql + command: ['--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci'] + restart: always + environment: + MYSQL_ROOT_PASSWORD: strong-password + MYSQL_DATABASE: gamification + MYSQL_USER: gamification + MYSQL_PASSWORD: password + + web: + build: . + depends_on: + - db + ports: + - "3003:3000" + restart: always + environment: + DATABASE_URL: mysql2://gamification:password@db/gamification + RAILS_LOG_TO_STDOUT: 1 + SECRET_AUTH_USERNAME: admin + SECRET_AUTH_PASSWORD: admin-password + RAILS_SERVE_STATIC_FILES: 1 + +volumes: + db_data: {} +