Skip to content

Commit

Permalink
Merge pull request #36 from rubyforgood/add-to-readme
Browse files Browse the repository at this point in the history
Add rails db:setup step to readme
  • Loading branch information
garettarrowood authored Jul 30, 2023
2 parents 47f1b5c + 86fc9aa commit 5d6e9e9
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ application up and running.

Things you may want to cover:

* Ruby version
- Ruby version

* System dependencies

* Configuration
- System dependencies

- Configuration

## Running in docker

Expand All @@ -20,12 +19,14 @@ locally, with preconfigured connections.

At present, these services are: postgres, redis, and the rails application.

To start the application, run `docker compose up`. Adding `-d` will free your
terminal after the service boots. After the application starts, the site can
To start the application, run `docker compose up`. Adding `-d` will free your
terminal after the service boots. After the application starts, the site can
be accessed at `http://localhost:3000`.

To set up the database the first time run, `docker compose run --rm stocks bin/rails db:setup`

The docker entrypoint takes care of installing updated gems, and running any
pending database migrations before starting the rails application. Any
pending database migrations before starting the rails application. Any
gem or configuration changes can be applied by restarting the application server:
`docker compose restart stocks`

Expand All @@ -46,12 +47,13 @@ $ docker compose run --rm stocks bash
⠿ Container stocks-in-the-future-db-1 Running 0.0s
⠿ Container stocks-in-the-future-redis-1 Running 0.0s
The Gemfile's dependencies are satisfied
root@cea35fe15a85:/rails#
root@cea35fe15a85:/rails#
```
### Running tests
To run RSpec tests in the container:
```shell
docker compose run --rm stocks rspec
```
Expand Down

0 comments on commit 5d6e9e9

Please sign in to comment.