diff --git a/.gitignore b/.gitignore index 46f7fe0..a4b1dd4 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ # Ignore the default SQLite database. /db/*.sqlite3 /db/*.sqlite3-journal +/config/database.yml # Ignore all logfiles and tempfiles. /log/* diff --git a/Procfile b/Procfile.dev similarity index 100% rename from Procfile rename to Procfile.dev diff --git a/app.json b/app.json index f806380..e23e1d6 100644 --- a/app.json +++ b/app.json @@ -1,24 +1,31 @@ { "name": "elmsanity", "description": "", - "scripts": { - "postdeploy": "cp config/database.yml.postgresql config/database.yml; bundle exec rails db:create; bundle exec rails db:migrate; NODE_ENV=production bundle exec rails webpacker:compile" - }, + "scripts": {}, "env": { "SECRET_KEY_BASE": { "generator": "secret" - }, - "RACK_ENV": "staging", - "RAILS_ENV": "staging", - "LOG_LEVEL": "DEBUG", - "HEROKU": "true" + } }, "formation": { + "web": { + "quantity": 1 + } }, "addons": [ - + { + "plan": "heroku-postgresql", + "options": { + "version": "9.5" + } + } ], "buildpacks": [ - + { + "url": "heroku/nodejs" + }, + { + "url": "heroku/ruby" + } ] } diff --git a/config/database.yml b/config/database.yml deleted file mode 100644 index 29cc972..0000000 --- a/config/database.yml +++ /dev/null @@ -1,22 +0,0 @@ -development: - adapter: postgresql - database: elmsanity_development - host: localhost - pool: 5 - -staging: - adapter: postgresql - database: elmsanity_staging - pool: 5 - timeout: 5000 - -production: - adapter: postgresql - database: elmsanity_production - pool: 5 - timeout: 5000 - -test: - adapter: postgresql - database: elmsanity_test - pool: 5 diff --git a/config/webpacker.yml b/config/webpacker.yml index d1e5f05..513ea9d 100644 --- a/config/webpacker.yml +++ b/config/webpacker.yml @@ -66,4 +66,6 @@ production: staging: <<: *default compile: false + + # Cache manifest.json for performance cache_manifest: true diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake new file mode 100644 index 0000000..fb4d3d6 --- /dev/null +++ b/lib/tasks/assets.rake @@ -0,0 +1,6 @@ +namespace :assets do + desc "Compile assets" + task precompile: [:environment] do + Rake::Task["webpacker:compile"].invoke + end +end diff --git a/yarn.lock b/yarn.lock index 36dc2fb..a90d251 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1722,8 +1722,8 @@ error-ex@^1.2.0: is-arrayish "^0.2.1" es-abstract@^1.7.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.9.0.tgz#690829a07cae36b222e7fd9b75c0d0573eb25227" + version "1.10.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.10.0.tgz#1ecb36c197842a00d8ee4c2dfd8646bb97d60864" dependencies: es-to-primitive "^1.1.1" function-bind "^1.1.1" @@ -1887,7 +1887,7 @@ expand-range@^1.8.1: dependencies: fill-range "^2.1.0" -express@^4.13.3: +express@^4.16.2: version "4.16.2" resolved "https://registry.yarnpkg.com/express/-/express-4.16.2.tgz#e35c6dfe2d64b7dca0a5cd4f21781be3299e076c" dependencies: @@ -5397,8 +5397,8 @@ webpack-dev-middleware@^1.11.0: time-stamp "^2.0.0" webpack-dev-server@^2.9.4: - version "2.9.4" - resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-2.9.4.tgz#7883e61759c6a4b33e9b19ec4037bd4ab61428d1" + version "2.9.5" + resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-2.9.5.tgz#79336fba0087a66ae491f4869f6545775b18daa8" dependencies: ansi-html "0.0.7" array-includes "^3.0.3" @@ -5408,7 +5408,7 @@ webpack-dev-server@^2.9.4: connect-history-api-fallback "^1.3.0" debug "^3.1.0" del "^3.0.0" - express "^4.13.3" + express "^4.16.2" html-entities "^1.2.0" http-proxy-middleware "~0.17.4" import-local "^0.1.1"