Skip to content

Commit 4c36f67

Browse files
Norman Kämper-Leymannjoaofnfernandes
Norman Kämper-Leymann
authored andcommitted
Update rails.md
Avoid running `docker-compose run web rake db:create` every time you restart/rebuild the app.
1 parent e5e1b8d commit 4c36f67

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

compose/rails.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ to link them together and expose the web app's port.
5050
services:
5151
db:
5252
image: postgres
53+
volumes:
54+
- ./tmp/db:/var/lib/postgresql/data
5355
web:
5456
build: .
5557
command: bundle exec rails s -p 3000 -b '0.0.0.0'
@@ -231,10 +233,7 @@ application with `docker-compose up`.
231233

232234
### Restart the application
233235

234-
To restart the application:
235-
236-
1. Run `docker-compose up` in the project directory.
237-
2. Run this command in another terminal to restart the database: `docker-compose run web rake db:create`
236+
To restart the application run `docker-compose up` in the project directory.
238237

239238
### Rebuild the application
240239

@@ -254,8 +253,7 @@ the changes:
254253
ports: - "3001:3000"
255254
```
256255

257-
Now, rebuild and restart the app with `docker-compose up --build`, then restart
258-
the database: `docker-compose run web rake db:create`.
256+
Now, rebuild and restart the app with `docker-compose up --build`.
259257

260258
Inside the container, your app is running on the same port as before `3000`, but
261259
the Rails Welcome is now available on `http://localhost:3001` on your local

0 commit comments

Comments
 (0)