# Please refer https://aka.ms/HTTPSinContainer on how to setup an https developer certificate for your ASP.NET Core service.

version: '3.4'

services:

  frontend:
    image: gerbilmanagerweb
    build:
      context: .
      dockerfile: gerbil-manager-web/Dockerfile
      args:
        # Der Browser erreicht die API über den am Host veröffentlichten Port
        - VITE_API_BASE_URL=http://localhost:80
    ports:
     - 3000:3000
    networks:
     - net2
    depends_on:
     - backend

  backend:
    image: gerbilmanagerwebapi
    build:
      context: .
      dockerfile: GerbilManagerWebAPI/Dockerfile
    environment:
      - ConnectionStrings:sqlConnection=server=database; database=GerbilManager; User Id=sa;Password=StrongerThenYYou1;Encrypt=False;TrustServerCertificate=True
    ports:
      - 80:80
    networks:
     - net1
     - net2
    depends_on:
      - database

  database:
    image: mcr.microsoft.com/mssql/server:2022-latest
    environment:
      - ACCEPT_EULA=Y
      - MSSQL_SA_PASSWORD=StrongerThenYYou1
      - MSSQL_PID=Evaluation
    ports:
      - "1433:1433"
    volumes:
      - db-data:/var/opt/mssql
    networks:
     - net1

volumes:
  db-data:

networks:
  net1:
    name: network1
  net2:
    name: network2