Skip to content

Commit

Permalink
add matrix as gem. fix precompilation
Browse files Browse the repository at this point in the history
  • Loading branch information
microstudi committed Feb 5, 2024
1 parent b35ced5 commit c910d38
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 8 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Docker Build

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
services:
steps:
- uses: actions/checkout@v4
- name: Build docker
run: docker build .
- name: Test docker compose
run: docker-compose up -d
- name: Check server is up
run: curl -s http://localhost:3000
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:2.7 AS builder
FROM ruby:3.2 AS builder

RUN apt-get update && apt-get upgrade -y && apt-get install -y ca-certificates curl gnupg && \
curl -fsSL https://deb.nodesource.com/setup_21.x | bash - && \
Expand Down Expand Up @@ -64,7 +64,7 @@ RUN mv config/credentials.bak config/credentials 2>/dev/null || true
RUN rm -rf tmp/cache vendor/bundle test spec .git

# This image is for production env only
FROM ruby:2.7-slim AS final
FROM ruby:3.2-slim AS final

RUN apt-get update && \
apt-get install -y postgresql-client \
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ gem 'aws-sdk-s3', '~> 1.94', require: false
gem 'image_processing', '~> 1.12'
gem 'active_storage_validations', '~> 1.1.3'
gem "puma", ">= 5.0.0"
gem 'matrix', '~> 0.4.1'

# Assets
gem 'jquery-rails', '~> 4.4.0'
Expand Down
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ DEPENDENCIES
kaminari (~> 1.2.1)
letter_opener (~> 1.7.0)
localeapp (~> 3.3)
matrix (~> 0.4.1)
pg (~> 1.4)
pg_search (~> 2.3.5)
prawn (~> 2.4.0)
Expand Down
6 changes: 3 additions & 3 deletions app/assets/javascripts/libs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//= require jquery2
//= require jquery_ujs
//= require jquery.validate
//= require vendor/jquery.validate
//= require bootstrap
//= require highcharts
//= require highcharts-exporting
//= require vendor/highcharts
//= require vendor/highcharts-exporting
//= require select2
1 change: 1 addition & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Application < Rails::Application
config.active_record.schema_format = :sql

# Guard against DNS rebinding attacks by permitting hosts
# localhost is necessary for the docker image
config.hosts << 'localhost'
config.hosts << 'timeoverflow.local'
config.hosts << 'staging.timeoverflow.org'
Expand Down
5 changes: 2 additions & 3 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Uglifier is only used on the precompile phase, so we can require it conditionally
require "uglifier" if ENV["SECRET_KEY_BASE"] == "dummy"

Rails.application.configure do
Expand Down Expand Up @@ -57,9 +58,7 @@

# Use the lowest log level to ensure availability of diagnostic information
# when problems arise.
config.log_level = if %w(debug info warn error
fatal).include?(ENV.fetch("RAILS_LOG_LEVEL",
nil))
config.log_level = if %w(debug info warn error fatal).include?(ENV.fetch("RAILS_LOG_LEVEL", nil))
ENV["RAILS_LOG_LEVEL"]
else
:info
Expand Down

0 comments on commit c910d38

Please sign in to comment.