Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update platform to compatible with M1 Mac #918

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ryuzee/slidehub-base:20220429
FROM --platform=linux/amd64 ryuzee/slidehub-base:20240330
MAINTAINER ryuzee

RUN mkdir -p /opt/application/current/
Expand Down
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ gem 'pdf-reader'
gem 'counter_culture'
# AP Server
gem 'momentjs-rails'
gem 'unicorn', '~> 5'
gem 'unicorn'
gem 'unicorn-rails'
# https://github.com/alexspeller/non-stupid-digest-assets
gem 'non-stupid-digest-assets'
Expand All @@ -78,6 +78,8 @@ gem 'apartment'

gem 'psych', '~> 3.1'

gem 'rb-fsevent', '0.11.2'

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
Expand Down
11 changes: 6 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,7 @@ GEM
psych (3.3.2)
public_suffix (4.0.7)
racc (1.6.0)
rack (2.2.3)
rack (2.2.9)
rack-contrib (2.3.0)
rack (~> 2.0)
rack-dev-mark (0.7.9)
Expand Down Expand Up @@ -1586,13 +1586,13 @@ GEM
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
rainbow (3.1.1)
raindrops (0.19.1)
raindrops (0.20.1)
rake (13.0.6)
ransack (2.5.0)
activerecord (>= 5.2.4)
activesupport (>= 5.2.4)
i18n
rb-fsevent (0.11.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rdoc (6.3.3)
Expand Down Expand Up @@ -1724,7 +1724,7 @@ GEM
uglifier (4.1.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (2.1.0)
unicorn (5.6.0)
unicorn (6.1.0)
kgio (~> 2.6)
raindrops (~> 0.7)
unicorn-rails (2.2.1)
Expand Down Expand Up @@ -1818,6 +1818,7 @@ DEPENDENCIES
rails-flog
rails_best_practices
ransack
rb-fsevent (= 0.11.2)
reek
reserved_word
rmagick
Expand All @@ -1841,7 +1842,7 @@ DEPENDENCIES
sqlite3
turbolinks
uglifier (= 4.1.0)
unicorn (~> 5)
unicorn
unicorn-rails
view_source_map
web-console
Expand Down
2 changes: 1 addition & 1 deletion config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
config.file_watcher = ActiveSupport::FileUpdateChecker

config.action_mailer.default_url_options = { host: 'localhost:3000' }

Expand Down
2 changes: 1 addition & 1 deletion config/unicorn.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# From http://qiita.com/Salinger/items/5350b23f8b4e0dcdbe23
worker_processes Integer(ENV.fetch('WEB_CONCURRENCY', nil) || 3)
timeout Integer(ENV.fetch('WEB_TIMEOUT', nil) || 15)
timeout Integer(ENV.fetch('WEB_TIMEOUT', nil) || 60)
preload_app true

listen '/tmp/unicorn.sock'
Expand Down
29 changes: 15 additions & 14 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

ActiveRecord::Schema.define(version: 2018_11_19_145146) do

create_table "active_storage_attachments", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "active_storage_attachments", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
t.string "name", null: false
t.string "record_type", null: false
t.bigint "record_id", null: false
Expand All @@ -22,7 +22,7 @@
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
end

create_table "active_storage_blobs", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "active_storage_blobs", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
t.string "key", null: false
t.string "filename", null: false
t.string "content_type"
Expand All @@ -33,14 +33,14 @@
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
end

create_table "categories", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "categories", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
t.datetime "created_at"
t.datetime "updated_at"
t.string "name_en", default: "", null: false
t.string "name_ja", default: "", null: false
end

create_table "comments", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "comments", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
t.integer "user_id", null: false
t.integer "slide_id", null: false
t.text "comment", null: false
Expand All @@ -52,20 +52,20 @@
t.index ["user_id"], name: "index_comments_on_user_id"
end

create_table "custom_files", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "custom_files", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
t.string "path", null: false
t.string "description"
t.index ["path"], name: "idx_custom_files_ukey", unique: true
end

create_table "featured_slides", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "featured_slides", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
t.integer "slide_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["slide_id"], name: "idx_featured_slides_ukey", unique: true
end

create_table "pages", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "pages", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
t.string "path", limit: 30, null: false
t.string "title", null: false
t.text "content", limit: 4294967295
Expand All @@ -74,7 +74,7 @@
t.index ["path"], name: "idx_pages_ukey", unique: true
end

create_table "sessions", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "sessions", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
t.string "session_id", null: false
t.text "data"
t.datetime "created_at", null: false
Expand All @@ -83,15 +83,15 @@
t.index ["updated_at"], name: "index_sessions_on_updated_at"
end

create_table "settings", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "settings", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
t.string "var", null: false
t.text "value", limit: 4294967295, collation: "utf8_bin"
t.datetime "created_at"
t.datetime "updated_at"
t.index ["var"], name: "idx_settings_key"
end

create_table "slides", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "slides", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
t.integer "user_id", null: false
t.string "name", null: false
t.text "description", null: false
Expand All @@ -115,7 +115,7 @@
t.index ["user_id"], name: "idx_slides_user_id_key"
end

create_table "taggings", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "taggings", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
t.integer "tag_id"
t.string "taggable_type"
t.integer "taggable_id"
Expand All @@ -127,19 +127,19 @@
t.index ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context"
end

create_table "tags", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "tags", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
t.string "name", collation: "utf8_bin"
t.integer "taggings_count", default: 0
t.index ["name"], name: "index_tags_on_name", unique: true
end

create_table "tenants", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "tenants", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "users", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "users", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
t.string "email", limit: 32, null: false
t.string "display_name", limit: 128, null: false
t.string "password", default: "", null: false
Expand All @@ -158,6 +158,7 @@
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
t.binary "avatar"
t.string "username", null: false
t.string "provider"
t.string "uid"
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
version: '2'
services:
mysql:
image: mysql:5.7.21
image: mysql:8.0.26
platform: linux/x86_64
command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci
hostname: 'mysql'
environment:
Expand Down
10 changes: 5 additions & 5 deletions docker-images/base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:18.04
FROM --platform=linux/amd64 ubuntu:18.04
MAINTAINER ryuzee
ENV DEBIAN_FRONTEND=noninteractive

Expand All @@ -10,15 +10,15 @@ RUN echo 'eval "$(rbenv init -)"' >> /root/.bashrc
RUN git clone https://github.com/sstephenson/ruby-build.git /root/.rbenv/plugins/ruby-build
ENV PATH /root/.rbenv/bin:$PATH
ENV RAILS_ROOT /opt/application/current
RUN bash -c "source /root/.bashrc && rbenv install 2.7.6"
RUN bash -c "source /root/.bashrc && rbenv global 2.7.6"
RUN bash -c "source /root/.bashrc && rbenv install 3.2.3"
RUN bash -c "source /root/.bashrc && rbenv global 3.2.3"
RUN bash -c "source /root/.bashrc && rbenv exec gem install bundler -v 1.17.3"
RUN bash -c "source /root/.bashrc && rbenv rehash"

RUN curl -L git.io/nodebrew | perl - setup
ENV PATH /root/.nodebrew/current/bin:$PATH
RUN /root/.nodebrew/current/bin/nodebrew install v12.16.1
RUN /root/.nodebrew/current/bin/nodebrew use v12.16.1
RUN /root/.nodebrew/current/bin/nodebrew install v16.13
RUN /root/.nodebrew/current/bin/nodebrew use v16.13
RUN npm install --g yarn

COPY supervisor.conf /etc/supervisor.conf
Expand Down
2 changes: 1 addition & 1 deletion dockerfile_dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ryuzee/slidehub-base:20220429
FROM --platform=linux/amd64 ryuzee/slidehub-base:20240330
MAINTAINER ryuzee

RUN mkdir -p /opt/application/current/
Expand Down
2 changes: 1 addition & 1 deletion lib/slide_hub/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module SlideHub
VERSION = '2.0.0-beta2'.freeze
VERSION = '2.1.0'.freeze
end
2 changes: 1 addition & 1 deletion lib/tasks/docker.rake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require "#{File.dirname(__FILE__)}/../../lib/slide_hub/version"
require 'open3'

BASE_CONTAINER_VERSION = '20220429'.freeze
BASE_CONTAINER_VERSION = '20240330'.freeze

namespace :docker do
task :default => :build
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ bootstrap4-duallistbox@^4.0.2:
resolved "https://registry.yarnpkg.com/bootstrap4-duallistbox/-/bootstrap4-duallistbox-4.0.2.tgz#c6942e34a39d0d05e436d51ebaf31c9349f119d3"
integrity sha512-vQdANVE2NN0HMaZO9qWJy0C7u04uTpAmtUGO3KLq3xAZKCboJweQ437hDTszI6pbYV2olJCGZMbdhvIkBNGeGQ==

bootstrap@4.4.2:
bootstrap@4.6.2:
version "4.6.2"
resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.6.2.tgz#8e0cd61611728a5bf65a3a2b8d6ff6c77d5d7479"
integrity sha512-51Bbp/Uxr9aTuy6ca/8FbFloBUJZLHwnhTcnjIeRn2suQWsWzcuJhGjKDB5eppVte/8oCdOL3VuwxvZDUggwGQ==
Expand Down