version: '3.8'

services:
  extrudex-api:
    build:
      context: ./backend
      dockerfile: Dockerfile
    container_name: extrudex-api
    ports:
      - "5080:8080"
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
      - ASPNETCORE_URLS=http://+:8080
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s
    networks:
      - extrudex-network

  control-center-web:
    build:
      context: ../Control-Center/frontend
      dockerfile: Dockerfile
    container_name: control-center-web
    ports:
      - "5081:80"
    depends_on:
      extrudex-api:
        condition: service_healthy
    restart: unless-stopped
    networks:
      - extrudex-network

networks:
  extrudex-network:
    driver: bridge