version: '3.7'
services:
    db:
        image: postgres:latest
        restart: always
        environment:
            - POSTGRES_USER=sa
            - POSTGRES_PASSWORD=password
            - POSTGRES_DB=dataprovider
        ports:
            - "5432:5432"
    api:
        build: .
        restart: always
        ports:
            - "3000:3000"
        command: json-server --watch api.json
        volumes:
            - "./api.json:/api.json"