diff --git a/.gitignore b/.gitignore index 4bf6e89..7ccc9fa 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ # Ignore bundler config. /.bundle vendor/gems -app/views/welcome/*.erb.html +app/views/welcome/*.html.erb # Ignore all environment files. /.env* diff --git a/Gemfile b/Gemfile index 40833f6..4d876dc 100644 --- a/Gemfile +++ b/Gemfile @@ -1,24 +1,21 @@ source "https://rubygems.org" -gem "rails", "~> 8.1.1" +gem "rails", "~> 8.0.0" gem "propshaft" -# gem "sqlite3", ">= 2.1" +gem "pg" gem "puma" gem "importmap-rails" gem "turbo-rails" gem "stimulus-rails" gem "jbuilder" -gem 'tailwindcss-rails' -gem 'foreman' +gem "tailwindcss-rails" +gem "foreman" +gem "dotenv" # gem "bcrypt", "~> 3.1.7" gem "tzinfo-data", platforms: %i[ windows jruby ] -#gem "solid_cache" -#gem "solid_queue" -#gem "solid_cable" - gem "bootsnap", require: false gem "kamal", require: false gem "thruster", require: false diff --git a/config/application.rb b/config/application.rb index b3519c8..e054bf8 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,14 +1,9 @@ require_relative "boot" +require "dotenv" -# require "rails/all" -# require "active_model/railtie" -# And now the rest -require "action_controller/railtie" -require "action_mailer/railtie" -require "action_view/railtie" -require "active_job/railtie" -require "action_cable/engine" +require "rails/all" +Dotenv.load # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. diff --git a/config/database.yml b/config/database.yml new file mode 100644 index 0000000..1075372 --- /dev/null +++ b/config/database.yml @@ -0,0 +1,15 @@ +default: &default + adapter: postgresql + encoding: unicode + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + timeout: 5000 + +development: + primary: + <<: *default + database: <%= ENV.fetch("DATABASE_URL") %> + +production: + primary: + <<: *default + database: <%= ENV.fetch("DATABASE_URL") %> diff --git a/config/database.yml.new b/config/database.yml.new deleted file mode 100644 index 13e4004..0000000 --- a/config/database.yml.new +++ /dev/null @@ -1,45 +0,0 @@ -# SQLite. Versions 3.8.0 and up are supported. -# gem install sqlite3 -# -# Ensure the SQLite 3 gem is defined in your Gemfile -# gem "sqlite3" -# -default: &default - adapter: sqlite3 - pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> - timeout: 5000 - -development: - primary: - <<: *default - database: storage/development.sqlite3 - queue: - <<: *default - database: storage/development_queue.sqlite3 - migrations_paths: db/queue_migrate - -# Warning: The database defined as "test" will be erased and -# re-generated from your development database when you run "rake". -# Do not set this db to the same as development or production. -test: - <<: *default - database: storage/test.sqlite3 - -# Store production database in the storage/ directory, which by default -# is mounted as a persistent Docker volume in config/deploy.yml. -production: - primary: - <<: *default - database: storage/production.sqlite3 - cache: - <<: *default - database: storage/production_cache.sqlite3 - migrations_paths: db/cache_migrate - queue: - <<: *default - database: storage/production_queue.sqlite3 - migrations_paths: db/queue_migrate - cable: - <<: *default - database: storage/production_cable.sqlite3 - migrations_paths: db/cable_migrate diff --git a/env.example b/env.example new file mode 100644 index 0000000..e170565 --- /dev/null +++ b/env.example @@ -0,0 +1 @@ +DATABASE_URL=postgesql://user:password@rails6.wicom.li/database