version: '3.8'

services:
  constructdemo_api:
    build:
      context: .
      dockerfile: ./ConstructorAppApi/Dockerfile
    container_name: constructdemo_api
    restart: always
    ports:
        - 5443:443  # API için yeni dış HTTPS portu
        - 8071:80   # API için yeni dış HTTP portu
    environment:
      - ASPNETCORE_ENVIRONMENT=Production
      - ASPNETCORE_URLS=https://+:443;http://+:80
      - ASPNETCORE_Kestrel__Certificates__Default__Password=itRkTNSFBEFPqCGdYEuIloyhx
      - ASPNETCORE_Kestrel__Certificates__Default__Path=/app/https/aspnetapp.pfx
    networks:
      - nginx_network
      - mssql_network

  constructdemo_ui:
    depends_on:
      - constructdemo_api
    build:
      context: .
      dockerfile: ./ConstructorAppUI/Dockerfile
    container_name: constructdemo_ui
    restart: always
    ports:
        - 7443:443  # UI için yeni dış HTTPS portu
        - 8072:80   # UI için yeni dış HTTP portu
    environment:
        - ASPNETCORE_ENVIRONMENT=Production
        - ASPNETCORE_URLS=https://+:443;http://+:80
        - ASPNETCORE_Kestrel__Certificates__Default__Password=itRkTNSFBEFPqCGdYEuIloyhx
        - ASPNETCORE_Kestrel__Certificates__Default__Path=/app/https/aspnetapp.pfx
    networks:
      - nginx_network
      - mssql_network

networks:
  nginx_network:
    external: true
    name: nginx_network
    driver: bridge
  mssql_network:
    external: true
    name: mssql_network
    driver: bridge