version: '3.4'

services:
  db:
    image: postgres:latest
    environment:
      POSTGRES_DB: SurveyBeta
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: MAJEDali645
    ports:
      - "5432:5432"
    volumes:
      - db_data:/var/lib/postgresql/data

  survey-beta:
    image: surveybeta
    build:
      context: .
      dockerfile: survey-beta/Dockerfile
    depends_on:
      - db
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
      - ConnectionStrings__DefaultConnection=Host=db;Database=SurveyBeta;Username=postgres;Password=MAJEDali645
    ports:
      - "8080:80"
    volumes:
      - .:/app
    entrypoint: ["dotnet", "survey-beta.dll"]

volumes:
  db_data:
