履歴: ソフトウェア/docker/Railsを動かす
各行は、その日時に書かれた内容です。追加・削除は、1 つ前の版との行数の差です (全 9 版)。「差分」は比較する版、「基準」は比べる相手の版を選びます
| 日時 | タイトル | 文字数 | 追加 | 削除 | 内容 | 差分 | 基準 |
|---|---|---|---|---|---|---|---|
| 2018/5/18 21:31:27 | ソフトウェア/docker/Railsを動かす 最新版 | 12,708 | +5 | -6 | 表示 | 差分 | — |
| 2018/5/18 12:31:27 | ソフトウェア/docker/Railsを動かす | 12,704 | +6 | -0 | 表示 | 差分 | 選択 |
| 2018/5/17 6:44:36 | ソフトウェア/docker/Railsを動かす | 12,584 | +69 | -4 | 表示 | 差分 | 選択 |
| 2018/5/16 16:12:28 | ソフトウェア/docker/Railsを動かす | 10,810 | +3 | -0 | 表示 | 差分 | 選択 |
| 2018/5/16 6:47:42 | ソフトウェア/docker/Railsを動かす | 10,733 | +57 | -0 | 表示 | 差分 | 選択 |
| 2018/5/11 2:20:58 | ソフトウェア/docker/Railsを動かす | 9,164 | +45 | -1 | 表示 | 表示中 | 選択 |
| 2018/5/10 6:58:12 | ソフトウェア/docker/Railsを動かす | 7,779 | +159 | -4 | 表示 | 差分 | 選択 |
| 2018/5/9 20:06:34 | ソフトウェア/docker/Railsを動かす | 2,492 | +54 | -1 | 表示 | 差分 | 基準 |
| 2018/5/9 14:42:18 | ソフトウェア/docker/Railsを動かす | 657 | — | — | 表示 | — | 選択 |
基準: ソフトウェア/docker/Railsを動かす (2018/5/9 20:06:34) → 比較: ソフトウェア/docker/Railsを動かす (2018/5/11 2:20:58)
@@ -4,12 +4,13 @@
https://qiita.com/okamos/items/8e9b258e3d610bdc2ed9
-* library/ruby イメージ [#n6f054ca]
+Qiita - Ruby on Rails 5.2の新機能(Active Storage, Content Security Policyなど)~
+https://qiita.com/ryohashimoto/items/75f48fa5a3846c58f735
+* library/ruby イメージ の雰囲気を確かめる [#n6f054ca]
+
サイズは 55.5MB だった。
-とりあえず雰囲気を確かめる。
-
LANG:console
$ docker run --rm -it ruby:alpine # 何も指定しないと irb が立ち上がる
irb(main):001:0>^D
@@ -66,4 +67,202 @@
<html>
<head>
<title>Ruby on Rails</title>
- /myapp#
+ /myapp# cat Gemfile # 標準の Gemfile
+ source 'https://rubygems.org'
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
+
+ ruby '2.5.1'
+
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
+ gem 'rails', '~> 5.2.0'
+ # Use sqlite3 as the database for Active Record
+ gem 'sqlite3'
+ # Use Puma as the app server
+ gem 'puma', '~> 3.11'
+ # Use SCSS for stylesheets
+ gem 'sass-rails', '~> 5.0'
+ # Use Uglifier as compressor for JavaScript assets
+ gem 'uglifier', '>= 1.3.0'
+ # See https://github.com/rails/execjs#readme for more supported runtimes
+ # gem 'mini_racer', platforms: :ruby
+
+ # Use CoffeeScript for .coffee assets and views
+ gem 'coffee-rails', '~> 4.2'
+ # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
+ gem 'turbolinks', '~> 5'
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
+ gem 'jbuilder', '~> 2.5'
+ # Use Redis adapter to run Action Cable in production
+ # gem 'redis', '~> 4.0'
+ # Use ActiveModel has_secure_password
+ # gem 'bcrypt', '~> 3.1.7'
+
+ # Use ActiveStorage variant
+ # gem 'mini_magick', '~> 4.8'
+
+ # Use Capistrano for deployment
+ # gem 'capistrano-rails', group: :development
+
+ # Reduces boot times through caching; required in config/boot.rb
+ gem 'bootsnap', '>= 1.1.0', require: false
+
+ group :development, :test do
+ # Call 'byebug' anywhere in the code to stop execution and get a debugger console
+ gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
+ end
+
+ group :development do
+ # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
+ gem 'web-console', '>= 3.3.0'
+ gem 'listen', '>= 3.0.5', '< 3.2'
+ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
+ gem 'spring'
+ gem 'spring-watcher-listen', '~> 2.0.0'
+ end
+
+ group :test do
+ # Adds support for Capybara system testing and selenium driver
+ gem 'capybara', '>= 2.15', '< 4.0'
+ gem 'selenium-webdriver'
+ # Easy installation and use of chromedriver to run system tests with Chrome
+ gem 'chromedriver-helper'
+ end
+
+ # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
+ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
+
+* 方針 [#me5e176b]
+
+rails サーバー と postgresql サーバーとを別々に建てて接続する
+
+postgres と mysql のイメージサイズは10倍くらい違う。~
+どちらでもいいなら postgres を使いたくなる感じ。
+
+ postgres alpine 24a77bfbb9ee 13 hours ago 39.5MB
+ mysql latest a8a59477268d 5 days ago 445MB
+
+* postgres イメージの使い方 [#u42d179e]
+
+以下まだ考え中、とりあえずメモとして保存。後で編集する。
+
+postgres 側の起動:
+ LANG:console
+ $ docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres:alpine
+
+ LANG:console
+This image includes EXPOSE 5432 (the postgres port), so standard container linking will make it automatically available to the linked containers. The default postgres user and database are created in the entrypoint with initdb.
+
+ The postgres database is a default database meant for use by users, utilities and third party applications.
+
+ postgresql.org/docs
+
+connect to it from an application
+
+ LANG:console
+ $ docker run --name some-app --link some-postgres:postgres -d application-that-uses-postgres
+
+* development [#ze449dce]
+
+まだ考え中
+
+ $ docker run -it -v /path_to_app_in_host:/rails_proj -p 13000:3000 myimage/ruby_with_docker /bin/sh
+ /# cd /rails_proj
+ /# bundle install
+ /# rails db:create
+ /# rails db:migrate
+ /# rails s
+
+* Dockerfile の作りかけ [#nf20b46f]
+
+ FROM ruby:alpine
+
+ RUN \
+ # いろいろ入れる
+ apk add -U --no-cache bash git alpine-sdk nodejs tzdata && \
+ # bundler 入れる
+ gem install bundler && \
+ #
+ cd
+
+Gemfile
+ LANG:ruby
+ source 'https://rubygems.org'
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
+
+ ruby '2.5.1'
+
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
+ gem 'rails', '~> 5.2.0'
+ # Use sqlite3 as the database for Active Record
+ gem 'sqlite3'
+ # Use Puma as the app server
+ gem 'puma', '~> 3.11'
+ # Use SCSS for stylesheets
+ gem 'sass-rails', '~> 5.0'
+ # Use Uglifier as compressor for JavaScript assets
+ gem 'uglifier', '>= 1.3.0'
+ # See https://github.com/rails/execjs#readme for more supported runtimes
+ gem 'mini_racer', platforms: :ruby
+
+ # Use CoffeeScript for .coffee assets and views
+ gem 'coffee-rails', '~> 4.2'
+ # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
+ ## gem 'turbolinks', '~> 5'
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
+ gem 'jbuilder', '~> 2.5'
+ # Use Redis adapter to run Action Cable in production
+ # gem 'redis', '~> 4.0'
+ # Use ActiveModel has_secure_password
+ gem 'bcrypt', '~> 3.1.7'
+
+ # Use ActiveStorage variant
+ # gem 'mini_magick', '~> 4.8'
+
+ # Use Capistrano for deployment
+ # gem 'capistrano-rails', group: :development
+
+ # Reduces boot times through caching; required in config/boot.rb
+ gem 'bootsnap', '>= 1.1.0', require: false
+
+ group :development, :test do
+ # Call 'byebug' anywhere in the code to stop execution and get a debugger console
+ gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
+ end
+
+ group :development do
+ # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
+ gem 'web-console', '>= 3.3.0'
+ gem 'listen', '>= 3.0.5', '< 3.2'
+ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
+ gem 'spring'
+ gem 'spring-watcher-listen', '~> 2.0.0'
+ end
+
+ group :test do
+ # Adds support for Capybara system testing and selenium driver
+ gem 'capybara', '>= 2.15', '< 4.0'
+ gem 'selenium-webdriver'
+ # Easy installation and use of chromedriver to run system tests with Chrome
+ gem 'chromedriver-helper'
+
+ gem 'rspec-rails'
+ gem 'rails-controller-testing'
+ end
+
+ # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
+ # gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
+
+ # riot support
+ gem 'riot_js-rails', github: 'bjarosze/riot_js-rails', ref: 'f6328dbabcdf69400e1cea70485973ae1c926b94'
+ gem 'slim-rails'
+
+ # frontend libraries
+ gem 'jquery-rails'
+ gem 'jquery-validation-rails'
+ gem 'materialize-sass'
+
+ # easy way to check emails sent by rails app
+ group :development do
+ gem "letter_opener"
+ gem "letter_opener_web"
+ end