version: '3.8'
services:
  db:
    image: postgres:12.4
    restart: always
    ports:
      - "54322:5432"
    environment:
      POSTGRES_USER: archive
      POSTGRES_PASSWORD: docker
    command: postgres -c listen_addresses=*

  amqp:
    image: rabbitmq:3.8-management
    restart: always
    ports:
      - "15672:15672"

  schema:
    build:
      context: ./schema/
      dockerfile: Dockerfile.local
    depends_on:
      - db
    volumes:
      - ./schema:/code/schema

  workflow:
    build:
      context: .
      dockerfile: ./services/workflow/Dockerfile.local
    ports:
      - "3456:3456"
    depends_on:
      - schema
    volumes:
      - ./services/workflow:/code
      - ./shared:/code/src/shared
      - ./apps:/code/src/apps
      - ./testing:/code/src/testing

  capability:
    build:
      context: .
      dockerfile: ./services/capability/Dockerfile.local
    ports:
      - "3457:3457"
    depends_on:
      - schema
      - workflow
      - notification
    volumes:
      - ./services/capability:/code
      - ./shared:/code/src/shared
      - ./apps:/code/src/apps
      - ./testing:/code/src/testing

  notification:
    build:
      context: .
      dockerfile: ./services/notification/Dockerfile.local
    ports:
      - "3458:3458"
    depends_on:
      - schema
    volumes:
      - ./services/notification:/code
      - ./shared:/code/src/shared
      - ./apps:/code/src/apps
      - ./testing:/code/src/testing

  # frontend:
  #   build:
  #     context: ./apps/web/
  #     dockerfile: Dockerfile.local
  #   ports:
  #     - "4200:4200"
  #   volumes:
  #     - ./apps/web:/code
  #     - /code/node_modules
