DEV Community

Cover image for ES6 by example: a module/CLI to wait for Postgres in docker-compose

ES6 by example: a module/CLI to wait for Postgres in docker-compose

Hugo Di Francesco on July 11, 2018

When using docker-compose, it’s good practice to make anything that relies on Postgres wait for it to be up before launching. This avoids connectio...
Collapse
 
defman profile image
Sergey Kislyakov • Edited

You can do that with docker-compose.

version: 3
services:
    node_app:
        ....
        depends_on:
            - postgres
    postgres:
        ...