diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..74aaf42 --- /dev/null +++ b/.env.development @@ -0,0 +1,26 @@ +RACK_ENV=development +RAILS_ENV=development +APP_SECRET=fe837ea72667ec3d8ecb94cfba1a1bba + +DEPLOY_PATH=/var/www + +PUMA_WORKERS=1 +PUMA_MIN_THREADS=1 +PUMA_MAX_THREADS=16 +PUMA_PORT=4000 +PUMA_TIMEOUT=30 + +MYSQL_HOST=db +MYSQL_DATABASE=ensl +MYSQL_USERNAME=ensl +MYSQL_PASSWORD=ensl +MYSQL_ROOT_PASSWORD=ensl +MYSQL_CONNECTION_POOL=8 + +NEW_RELIC_APP_NAME=ENSL +NEW_RELIC_LICENSE_KEY= + +EXCEPTIONAL_API_KEY= + +GOOGLE_API_KEY= +GOOGLE_CALENDAR_ID= diff --git a/.env.test b/.env.test new file mode 100644 index 0000000..889ca78 --- /dev/null +++ b/.env.test @@ -0,0 +1,26 @@ +RACK_ENV=test +RAILS_ENV=test +APP_SECRET=fe837ea72667ec3d8ecb94cfba1a1bba + +DEPLOY_PATH=/var/www + +PUMA_WORKERS=1 +PUMA_MIN_THREADS=1 +PUMA_MAX_THREADS=16 +PUMA_PORT=4000 +PUMA_TIMEOUT=30 + +MYSQL_HOST=db +MYSQL_DATABASE=ensl_test +MYSQL_USERNAME=ensl +MYSQL_PASSWORD=ensl +MYSQL_ROOT_PASSWORD=ensl +MYSQL_CONNECTION_POOL=8 + +NEW_RELIC_APP_NAME=ENSL +NEW_RELIC_LICENSE_KEY= + +EXCEPTIONAL_API_KEY= + +GOOGLE_API_KEY= +GOOGLE_CALENDAR_ID= diff --git a/Gemfile.lock b/Gemfile.lock index 10835d7..1c6cc29 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT - remote: git://github.com/koraktor/steam-condenser-ruby.git - revision: 5795d15152995cc6bada5265fa379cfc57103618 + remote: https://github.com/koraktor/steam-condenser-ruby.git + revision: 2cb441f0518a0b8d20a017dfcc42783ae878311a specs: steam-condenser (1.3.11) multi_json (~> 1.6) diff --git a/db/schema.rb b/db/schema.rb index d2a0577..411aa13 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -607,7 +607,7 @@ ActiveRecord::Schema.define(:version => 20171109165433) do add_index "predictions", ["match_id"], :name => "index_predictions_on_match_id" add_index "predictions", ["user_id"], :name => "index_predictions_on_user_id" - create_table "profiles", :force => true do |t| + create_table "profiles", :options => 'ENGINE=MyISAM', :force => true do |t| t.integer "user_id" t.string "msn" t.string "icq" diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index eb3886c..b74bcd7 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -2,6 +2,10 @@ version: "3" services: web: + # Debug + stdin_open: true + command: /bin/bash + tty: true build: context: ./ dockerfile: Dockerfile.dev @@ -17,7 +21,7 @@ services: # - redis db: # Debug - # command: bash + #command: bash #tty: true command: mysqld_safe --skip-grant-tables image: mariadb:latest diff --git a/ext/mysql.conf.d/opt.cnf b/ext/mysql.conf.d/opt.cnf index a9545ea..e9d8758 100644 --- a/ext/mysql.conf.d/opt.cnf +++ b/ext/mysql.conf.d/opt.cnf @@ -29,3 +29,6 @@ innodb_flush_method = O_DIRECT #innodb_additional_mem_pool_size = 20M innodb_file_per_table = 1 transaction-isolation = READ-COMMITTED + +innodb_file_per_table=1 +innodb_file_format = Barracuda diff --git a/script/entry.sh b/script/entry.sh index e5afde9..13ca542 100755 --- a/script/entry.sh +++ b/script/entry.sh @@ -1,11 +1,15 @@ #!/bin/bash -env cd /var/www -source /var/www/.env -rm -rf /var/www/public/assets -mv /home/web/assets /var/www/public/ -chown -R web:web /var/www/public -su -c "cd /var/www && bundle exec rake assets:precompile" -s /bin/bash -l web +source /var/www/.env + +if [ $RAILS_ENV = "production" ]; then + rm -rf /var/www/public/assets + mv /home/web/assets /var/www/public/ + chown -R web:web /var/www +fi + +su -c "bundle config github.https true; cd /var/www && bundle install --path /var/bundle --jobs 4" -s /bin/bash -l web su -c "cd /var/www && bundle exec puma -C config/puma.rb" -s /bin/bash -l web +bash