---
version: "3.7"
services:
  frontend-distro:
    build:
      context: ./repos/frontend-distribution
      dockerfile: Dockerfile
      args:
        - PRIVATE_KEY
    ports:
      - "5001:8080"
    env_file:
      - ./.env
    environment:
      - WEBPACK_DEV_SERVER_PORT=8080
      - GRASS_TOKEN=
      - # API_URL=http://api-dev.theorchard.io
      - # API_URL=http://ows-grass.theorchard.io/
      - API_URL=http://grass:8080
      - OWS_IMAGES_URL=http://qa-ows-images.theorchard.io
      - WORKSTATION_SESSION=
      - ASSET_UPLOAD_URL=https://assets.qaorch.com/htmlupload.php
      - PRIVATE_KEY=
    volumes:
      - ./repos/frontend-distribution:/var/app/
    stdin_open: true
    tty: true
  grass:
    build:
      context: ./repos/grass
      dockerfile: Dockerfile
      target: dev
    ports:
      - "5004:8080"
    env_file:
      - ./.env
    environment:
      - DB_URL="mysql+pymysql://${AR_MYSQL_USER}:${AR_MYSQL_PASSWORD}@${AR_MYSQL_HOST}/${AR_MYSQL_DATABASE}?charset=utf8mb4"
      - LOGGER_HANDLER_ASYNC=0
      - SESSION_DURATION=3600000
      - PYTHONUNBUFFERED=1
      - JWT_SERVICE_NAME = 'lambda-jwt-refresh'
      - JWT_SECRET_NAME = 'jwt_enabled_services'
      - JWT_REFRESH_INTERVAL = 43200
    volumes:
      - ./repos/grass:/var/app/
    stdin_open: true
    tty: true
  product-digital:
    build:
      context: ./repos/ows-product-digital
      dockerfile: Dockerfile
      target: dev
    ports:
      - "5002:80"
    env_file:
      - ./.env
    environment:
      - ASSETS_PHYSICAL_LOCATION_ID=7
      - OWSREQUEST_SERVICE_MAP={"ows-product":"product"}
    volumes:
      - ./repos/product-digital:/var/app
    stdin_open: true
    tty: true
  product:
    build:
      context: ./repos/ows-product
      dockerfile: Dockerfile
      target: deploy
    ports:
      - "5003:80"
    env_file:
      - ./.env
    environment:
      - OWSREQUEST_SERVICE_MAP={"product-digital":"product-digital"}
    volumes:
      - ./repos/ows-product:/var/app
    stdin_open: true
    tty: true
  features:
    build:
      context: ./repos/ows-features
      dockerfile: Dockerfile
      target: dev
    env_file:
      - ./.env
    environment:
      - SPLITIO_API_KEY=
    ports:
      - "5005:80"
    volumes:
      - ./repos/ows-features:/var/app
    stdin_open: true
    tty: true
