Skip to content

Commit

Permalink
Update docker-compose example to version 3
Browse files Browse the repository at this point in the history
Adds "depends_on"
  • Loading branch information
kenfehling authored and steve-chavez committed May 21, 2018
1 parent 88e3c8c commit 28c39e9
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -203,25 +203,28 @@ To avoid having to install the database at all, you can run both it and the serv
# docker-compose.yml
server:
image: postgrest/postgrest
ports:
- "3000:3000"
links:
- db:db
environment:
PGRST_DB_URI: postgres://app_user:password@db:5432/app_db
PGRST_DB_SCHEMA: public
PGRST_DB_ANON_ROLE: app_user
db:
image: postgres
ports:
- "5432:5432"
environment:
POSTGRES_DB: app_db
POSTGRES_USER: app_user
POSTGRES_PASSWORD: password
version: '3'
services:
server:
image: postgrest/postgrest
ports:
- "3000:3000"
links:
- db:db
environment:
PGRST_DB_URI: postgres://app_user:password@db:5432/app_db
PGRST_DB_SCHEMA: public
PGRST_DB_ANON_ROLE: app_user
depends_on:
- db
db:
image: postgres
ports:
- "5432:5432"
environment:
POSTGRES_DB: app_db
POSTGRES_USER: app_user
POSTGRES_PASSWORD: password
Go into the directory where you saved this file and run :code:`docker-compose up`. You will see the logs of both the database and PostgREST, and be able to access the latter on port 3000.

Expand Down

0 comments on commit 28c39e9

Please sign in to comment.