edit README

Signed-off-by: Lukas Pol <lukaspaespol@gmail.com>
This commit is contained in:
Lukas Pol 2020-04-15 15:34:54 -03:00
parent b835e6b196
commit c901442c65
4 changed files with 35 additions and 33 deletions

View File

@ -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
web/public/packs
web/public/packs-test
web/node_modules
web/yarn-error.log
web/yarn-debug.log*
web/.yarn-integrity

View File

@ -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

View File

@ -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:

View File

@ -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