version: "3"

services:
  postgres:
    image: postgres:13.3
    container_name: postgres
    volumes:
      - postgres-data:/var/lib/postgresql/data
    expose:
    - 5432
    ports:
      - 5432:5432
    environment:
      - POSTGRES_PASSWORD=postgres
      - POSTGRES_USER=postgres
      - POSTGRES_DB=dashboarddb
    networks:
      - urbanite-network

  dashboardapp:
    image: dashboardapp:latest
    container_name: dashboardapp
    build:
      context: .
    environment:
      - IDM_URI=http://localhost:8081/auth
      - SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/dashboarddb
      - IDM_USER4VIEW_USERNAME=urbanite
      - IDM_USER4VIEW_PASSWORD=urbanite
      - POSTGRES_USERNAME=postgres
      - POSTGRES_PASSWORD=postgres
    #expose:
    #  - 8085
    ports:
      - 8085:8085
    depends_on:
      - "postgres"
    links:
      - postgres
    networks:
      - urbanite-network

networks:
  urbanite-network:
     driver: bridge

volumes:
  postgres-data:
    driver: local
