From c901442c655994241e11a7565cef7bde13ee5273 Mon Sep 17 00:00:00 2001 From: Lukas Pol Date: Wed, 15 Apr 2020 15:34:54 -0300 Subject: [PATCH] edit README Signed-off-by: Lukas Pol --- ruby_on_rails-postgres/.gitignore | 26 +++++++++++------------ ruby_on_rails-postgres/README.md | 22 +++---------------- ruby_on_rails-postgres/docker-compose.yml | 2 +- ruby_on_rails-postgres/web/db/schema.rb | 18 ++++++++++++++++ 4 files changed, 35 insertions(+), 33 deletions(-) create mode 100644 ruby_on_rails-postgres/web/db/schema.rb diff --git a/ruby_on_rails-postgres/.gitignore b/ruby_on_rails-postgres/.gitignore index cbfc3f2..d837e21 100644 --- a/ruby_on_rails-postgres/.gitignore +++ b/ruby_on_rails-postgres/.gitignore @@ -11,22 +11,22 @@ web/.bundle web/log/* /tmp/* /web/tmp/* -!/log/.keep -!/tmp/.keep +web/!/log/.keep +web/!/tmp/.keep # Ignore uploaded files in development. -/storage/* -!/storage/.keep +web/storage/* +web/!/storage/.keep -/public/assets -.byebug_history +web/public/assets +web/.byebug_history # Ignore master key for decrypting credentials and more. -/config/master.key +web/config/master.key -/public/packs -/public/packs-test -/node_modules -/yarn-error.log -yarn-debug.log* -.yarn-integrity \ No newline at end of file +web/public/packs +web/public/packs-test +web/node_modules +web/yarn-error.log +web/yarn-debug.log* +web/.yarn-integrity \ No newline at end of file diff --git a/ruby_on_rails-postgres/README.md b/ruby_on_rails-postgres/README.md index 58f4e55..59a89fd 100644 --- a/ruby_on_rails-postgres/README.md +++ b/ruby_on_rails-postgres/README.md @@ -52,7 +52,9 @@ dac525a7e7f9 ruby_on_rails-postgres_web "entrypoint.sh bash …" 49 s 760e6b3dc241 postgres "docker-entrypoint.s…" 55 seconds ago Up 49 seconds 5432/tcp ruby_on_rails-postgres_db_1_85be421b80ec ``` -## Use docker rails with bash and execute rails server +After the application starts, navigate to `http://localhost:3000` in your web browser, `it may take about 5 seconds` + +## Use docker rails with bash ``` $ docker-compose exec web bash @@ -80,24 +82,6 @@ rake db:drop root@dac525a7e7f9:/myapp# rake db:create db:migrate ``` -## How execute rails server - -``` -root@dac525a7e7f9:/myapp# bundle exec rails s -b 0.0.0.0 -=> Booting Puma -=> Rails 6.0.2.2 application starting in development -=> Run `rails server --help` for more startup options -Puma starting in single mode... -* Version 4.3.3 (ruby 2.6.5-p114), codename: Mysterious Traveller -* Min threads: 5, max threads: 5 -* Environment: development -* Listening on tcp://0.0.0.0:3000 -Use Ctrl-C to stop -``` - -After the application starts, navigate to `http://localhost:3000` in your web browser -For stop server `CTRL + C` - ## Stop and remove the containers ``` root@dac525a7e7f9:/myapp# exit diff --git a/ruby_on_rails-postgres/docker-compose.yml b/ruby_on_rails-postgres/docker-compose.yml index a313e46..d8be05d 100644 --- a/ruby_on_rails-postgres/docker-compose.yml +++ b/ruby_on_rails-postgres/docker-compose.yml @@ -9,7 +9,7 @@ services: POSTGRES_HOST_AUTH_METHOD: trust web: build: . - command: bash -c "rm -f tmp/pids/server.pid && sleep 100000" + command: bash -c "rm -f tmp/pids/server.pid && yarn install --check-files && rake db:create db:migrate && bundle exec rails s -b 0.0.0.0" volumes: - ./web:/myapp ports: diff --git a/ruby_on_rails-postgres/web/db/schema.rb b/ruby_on_rails-postgres/web/db/schema.rb new file mode 100644 index 0000000..b10373b --- /dev/null +++ b/ruby_on_rails-postgres/web/db/schema.rb @@ -0,0 +1,18 @@ +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# This file is the source Rails uses to define your schema when running `rails +# db:schema:load`. When creating a new database, `rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 0) do + + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" + +end