履歴: ソフトウェア/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/10 6:58:12) → 比較: ソフトウェア/docker/Railsを動かす (2018/5/16 16:12:28)
@@ -4,6 +4,69 @@
https://qiita.com/okamos/items/8e9b258e3d610bdc2ed9
+Qiita - Ruby on Rails 5.2の新機能(Active Storage, Content Security Policyなど)~
+https://qiita.com/ryohashimoto/items/75f48fa5a3846c58f735
+
+* 構成案 [#l84246f8]
+
+まだ考え中。
+
+vagrant box に ubuntu/trusty64 を入れて、その中に以下の docker コンテナを用意する?
+
+- データボリューム
+- nginx サーバー
+- rails サーバー
+- postgresql サーバー
+
+永続化が必要なデータは vagrant box 外のホストファイルシステムに置く?(とりあえず)
+
+デプロイ方法はまた考える。
+
+* vagrant で ubuntu/trusty64 に docker を入れる [#hc08e5d0]
+
+ LANG:console
+ $ mkdir trusty64docker
+ $ cd trusty64docker
+ $ vagrant init
+ $ ls
+ Vagrantfile
+ $ vi Vagrantfile # 変更点のみ
+ # encoding: UTF-8
+ config.vm.box = "ubuntu/trusty64"
+ config.vm.network "private_network", ip: "192.168.33.10"
+ config.vm.provider "virtualbox" do |vb|
+ vb.memory = "1024"
+ end
+ config.vm.provision "shell", inline: <<-SHELL
+ # すでに初期化が済んでいれば抜ける
+ test -f /etc/bootstrapped && exitv
+
+ # dockerproject.org を apt/sources/list.d へ入れる
+ apt-get update
+ apt-get install -y apt-transport-https ca-certificates
+ apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
+ echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" > /etc/apt/sources.list.d/docker.list
+
+ # docker-engine を入れる
+ apt-get update
+ apt-get purge lxc-docker
+ apt-cache policy docker-engine
+ apt-get install -y docker-engine
+
+ # vagrant ユーザーを docker グループに入れて docker サーバーを起動
+ gpasswd -a vagrant docker
+ service docker restart
+
+ # docker-compose を入れる
+ curl -s -S -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
+ chmod +x /usr/local/bin/docker-compose
+
+ # 初期化済みフラグを立てる
+ date > /etc/bootstrapped
+
+ SHELL
+ $ vagrant up
+
* library/ruby イメージ の雰囲気を確かめる [#n6f054ca]
サイズは 55.5MB だった。
@@ -128,9 +191,51 @@
# 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 && \
@@ -139,7 +244,6 @@
#
cd
-
Gemfile
LANG:ruby
source 'https://rubygems.org'