Skip to content

Commit 7b4bace

Browse files
committed
Adding notes
1 parent 736fade commit 7b4bace

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

.devcontainer/docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ services:
4444
interval: 10s
4545
timeout: 5s
4646
retries: 5
47+
ports:
48+
- 5432:5432
4749

4850
# Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally.
4951
# (Adding the "ports" property to this file will not forward from a Codespace.)

README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This is a [Ruby on Rails](https://rubyonrails.org/) blog that connects to a Rail
1010
- Rails
1111
- Postgres
1212

13-
## 💁‍♀️ How to use
13+
## 💁‍♀️ How to use with Railway
1414

1515
- [Create a Railway project with the Postgres plugin](https://railway.app/project?plugins=postgresql)
1616
- Connect to your Railway project with `railway init`
@@ -25,9 +25,26 @@ This app was generated with the `rails new` command and following the getting
2525
[getting started](https://guides.rubyonrails.org/getting_started.html) guide.
2626
Read more about Rails on their [official website](https://rubyonrails.org/)
2727

28+
## Local dev no vscode
2829

29-
## Local Dev Setup
30-
Had to run export RAILS_ENV=test && bin/rails db:prepare in order to get my test database setup to run tests. Would be nice if this just happend when I run the test command
30+
### Basic development
31+
bundle install
32+
yarn install
33+
docker-compose -f .devcontainer/docker-compose.yml up -d
34+
export DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres
35+
bin/rails db:migrate
36+
bin/rails server
37+
38+
### Running tests
39+
export RAILS_ENV=test && bin/rails db:prepare
40+
bin/rails test
41+
42+
## With VS Code/Codespaces
43+
Launch devcontainer
44+
45+
46+
### Tear down
47+
docker-compose -f .devcontainer/docker-compose.yml down
3148

3249
Testing - https://edgeapi.rubyonrails.org/classes/ActionDispatch/SystemTestCase.html
3350

0 commit comments

Comments
 (0)