Skip to content

Commit 406425a

Browse files
committed
Use official images in rails tutorial
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
1 parent 796df30 commit 406425a

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

docs/rails.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Next, we have a bootstrap `Gemfile` which just loads Rails. It'll be overwritten
2828
Finally, `fig.yml` is where the magic happens. It describes what services our app comprises (a database and a web app), how to get each one's Docker image (the database just runs on a pre-made PostgreSQL image, and the web app is built from the current directory), and the configuration we need to link them together and expose the web app's port.
2929

3030
db:
31-
image: orchardup/postgresql
31+
image: postgres
3232
ports:
3333
- "5432"
3434
web:
@@ -62,19 +62,18 @@ Now that we've got a new `Gemfile`, we need to build the image again. (This, and
6262

6363
$ fig build
6464

65-
The app is now bootable, but we're not quite there yet. By default, Rails expects a database to be running on `localhost` - we need to point it at the `db` container instead. We also need to change the username and password to align with the defaults set by `orchardup/postgresql`.
65+
The app is now bootable, but we're not quite there yet. By default, Rails expects a database to be running on `localhost` - we need to point it at the `db` container instead. We also need to change the database and username to align with the defaults set by the `postgres` image.
6666

6767
Open up your newly-generated `database.yml`. Replace its contents with the following:
6868

6969
development: &default
7070
adapter: postgresql
7171
encoding: unicode
72-
database: myapp_development
72+
database: postgres
7373
pool: 5
74-
username: docker
75-
password: docker
76-
host: <%= ENV.fetch('DB_1_PORT_5432_TCP_ADDR', 'localhost') %>
77-
port: <%= ENV.fetch('DB_1_PORT_5432_TCP_PORT', '5432') %>
74+
username: postgres
75+
password:
76+
host: db_1
7877

7978
test:
8079
<<: *default

0 commit comments

Comments
 (0)