• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javaandroidc++objective-ccocoa誰得c#gamebathyscaphephplinuxrubyqt翻訳pythoncomegatwindowstwitterguiframeworkbtronvb.netdirectxtestdomarduino計画中(planning stage)previewerpukiwiki

Voice data server for navigation voice changer app.


コミットメタ情報

リビジョンcc305fbd16292f3b1c209e64ea07a2105fbd9184 (tree)
日時2016-10-05 21:32:49
作者HMML <hmml3939@gmai...>
コミッターHMML

ログメッセージ

Add docker deploy settings.

変更サマリ

差分

--- a/Dockerfile
+++ b/Dockerfile
@@ -5,8 +5,8 @@ RUN apt -y full-upgrade
55 RUN apt -y install file sox libsox-fmt-mp3 libsox-fmt-base
66 RUN apt -y install libsqlite3-dev
77 RUN apt-get clean
8-RUN adduser --system --disabled-password --uid 3000 --group --home /var/local/app rails
8+RUN adduser --system --disabled-password --uid 3000 --group --home /app rails
99 RUN gem install bundler --no-rdoc --no-ri
10-USER rails
11-ENV BUNDLE_APP_CONFIG /var/local/app/.bundle
12-CMD cd /var/local/app/current && exec bin/rails server
10+ADD runapp /
11+ENV BUNDLE_APP_CONFIG /app/.bundle
12+CMD /runapp
--- a/config/deploy/docker-test.rb
+++ b/config/deploy/docker-test.rb
@@ -1,9 +1,10 @@
11 set :sshkit_backend, SSHKit::Backend::Docker
22 set :stage, :development
33 set :branch, 'master'
4-set :deploy_to, '/var/local/app'
4+set :deploy_to, '/app'
55 set :repo_url, '/src'
6-fetch(:default_env).merge!(rails_env: :development, SECRET_KEY_BASE: 'dummy', DEVISE_SECRET_KEY: 'dummy')
6+fetch(:default_env).merge!(rails_env: :development, RAILS_SERVE_STATIC_FILES: 1,
7+ SECRET_KEY_BASE: 'dummy', DEVISE_SECRET_KEY: 'dummy')
78 set :bundle_without, 'test'
89
910 fetch(:linked_dirs, []).clear
--- a/config/deploy/docker.rb
+++ b/config/deploy/docker.rb
@@ -1,15 +1,18 @@
11 set :sshkit_backend, SSHKit::Backend::Docker
22 set :stage, :development
33 set :branch, 'master'
4-set :deploy_to, '/var/local/app'
5-fetch(:default_env).merge!(rails_env: :production, SECRET_KEY_BASE: 'dummy', DEVISE_SECRET_KEY: 'dummy')
6-
7-fetch(:linked_dirs, []).clear
8-fetch(:linked_files, []).clear
4+set :deploy_to, '/app'
5+fetch(:default_env).merge!(rails_env: :production, RAILS_SERVE_STATIC_FILES: 1,
6+ SECRET_KEY_BASE: 'dummy', DEVISE_SECRET_KEY: 'dummy',
7+ DATABASE_URL: 'mysql2://0/change-this-in-real-production')
8+#set :linked_dirs, %w()
9+set :linked_files, %w()
10+Rake::Task["deploy:set_linked_dirs"].clear # Save assets on each releases dir (not under shared)
911
1012 server docker: {
1113 image: 'nvc-base',
1214 commit: 'nvc',
15+ env: {RAILS_SERVE_STATIC_FILES: 1},
1316 }, user: 'rails:rails', roles: %w{web app}
1417
1518 Rake::Task["passenger:restart"].clear
--- /dev/null
+++ b/runapp
@@ -0,0 +1,19 @@
1+#!/bin/bash
2+: ${APP_HOME_DIR:=/app}
3+: ${APP_CURRENT_DIR:=/app/current}
4+: ${APP_UID:=3000}
5+: ${APP_GID:=3000}
6+: ${APP_SERVER_CMD:=exec bin/rails server -b0}
7+
8+find "${APP_HOME_DIR}" -xdev -print0 | xargs -r0 chown -h "${RAILS_UID}:${RAILS_GID}"
9+
10+if [ "$(id -g rails)" -ne "${APP_GID}" ]; then
11+ groupmod --non-unique --gid "${APP_GID}" rails
12+fi
13+if [ "$(id -u rails)" -ne "${APP_UID}" ]; then
14+ usermod --non-unique --uid "${APP_UID}" rails
15+fi
16+
17+rm -f "${APP_CURRENT_DIR}"/tmp/pids/*
18+cd "${APP_CURRENT_DIR}"
19+exec su -p -s /bin/bash -c "${APP_SERVER_CMD}" rails