version: "3.9"

services:
    api:
        container_name: api
        build:
            context: ./
            dockerfile: ./apps/api/Dockerfile
        image: 490752553772.dkr.ecr.eu-central-1.amazonaws.com/bandada-api
        pull_policy: always
        restart: unless-stopped
        env_file:
            - apps/api/.env
        ports:
            - "3000:3000"
        networks:
            - bandada

    client:
        container_name: client
        build:
            context: ./
            dockerfile: ./apps/client/Dockerfile
        image: 490752553772.dkr.ecr.eu-central-1.amazonaws.com/bandada-client
        pull_policy: always
        restart: unless-stopped
        environment:
            - NODE_ENV=production
        ports:
            - "3002:80"
        networks:
            - bandada
        depends_on:
            - api

    dashboard:
        container_name: dashboard
        build:
            context: ./
            dockerfile: ./apps/dashboard/Dockerfile
        image: 490752553772.dkr.ecr.eu-central-1.amazonaws.com/bandada-dashboard
        pull_policy: always
        restart: unless-stopped
        environment:
            - NODE_ENV=production
        ports:
            - "3001:80"
        networks:
            - bandada
        depends_on:
            - api

networks:
    bandada:
        internal: false
        driver: bridge

volumes:
    postgres:
