Skip to content

Commit b6ece5f

Browse files
Norman Kämper-Leymannbermudezmt
Norman Kämper-Leymann
authored andcommitted
Update rails.md
It occupied me quite a while figuring out why this sample didn't have a restart policy. And why we where supposed to always properly stop the containers wheres you normally would simply hit `Ctrl+C`. Turned out that this `pid` issue is a rails-specific issue. docker/compose#1393 (comment) And of course there's already [a Gem for fixing that](https://github.com/lorenzosinisi/shutup) but having the one-liner in the `docker-compose.yml` keeps the logic where it belongs to (and now also is treated here in the sample).
1 parent 5fce96c commit b6ece5f

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

compose/rails.md

+1-12
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ restart the containers.
7777
services:
7878
db:
7979
image: postgres
80+
restart: always
8081
volumes:
8182
- ./tmp/db:/var/lib/postgresql/data
8283
web:
@@ -256,18 +257,6 @@ Removing rails_db_1 ... done
256257
Removing network rails_default
257258
```
258259

259-
You can also stop the application with `Ctrl-C` in the same shell in which you
260-
executed `docker-compose up`. If you stop the app this way, and attempt to
261-
restart it, you might get the following error:
262-
263-
```none
264-
web_1 | A server is already
265-
running. Check /myapp/tmp/pids/server.pid.
266-
```
267-
268-
To resolve this, delete the file `tmp/pids/server.pid`, and then restart the
269-
application with `docker-compose up`.
270-
271260
### Restart the application
272261

273262
To restart the application run `docker-compose up` in the project directory.

0 commit comments

Comments
 (0)