Update docker-compose example to version 3
Adds "depends_on"
This commit is contained in:
committed by
steve-chavez
parent
88e3c8c4b6
commit
28c39e976c
+22
-19
@@ -203,25 +203,28 @@ To avoid having to install the database at all, you can run both it and the serv
|
|||||||
|
|
||||||
# docker-compose.yml
|
# docker-compose.yml
|
||||||
|
|
||||||
server:
|
version: '3'
|
||||||
image: postgrest/postgrest
|
services:
|
||||||
ports:
|
server:
|
||||||
- "3000:3000"
|
image: postgrest/postgrest
|
||||||
links:
|
ports:
|
||||||
- db:db
|
- "3000:3000"
|
||||||
environment:
|
links:
|
||||||
PGRST_DB_URI: postgres://app_user:password@db:5432/app_db
|
- db:db
|
||||||
PGRST_DB_SCHEMA: public
|
environment:
|
||||||
PGRST_DB_ANON_ROLE: app_user
|
PGRST_DB_URI: postgres://app_user:password@db:5432/app_db
|
||||||
|
PGRST_DB_SCHEMA: public
|
||||||
db:
|
PGRST_DB_ANON_ROLE: app_user
|
||||||
image: postgres
|
depends_on:
|
||||||
ports:
|
- db
|
||||||
- "5432:5432"
|
db:
|
||||||
environment:
|
image: postgres
|
||||||
POSTGRES_DB: app_db
|
ports:
|
||||||
POSTGRES_USER: app_user
|
- "5432:5432"
|
||||||
POSTGRES_PASSWORD: password
|
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.
|
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.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user