services:
  backend:
    build: 
      context: ./carfi-crm-back
    container_name: carfi-backend
    ports:
      - "8081:80"
    volumes:
      - ./carfi-crm-back:/var/www/html
      - /var/www/html/vendor
    environment:
      APP_ENV: local
      APP_DEBUG: 'true'
      DB_HOST: host.docker.internal
      DB_CONNECTION: mysql
    env_file:
      - ./carfi-crm-back/.env
    extra_hosts:
      - "host.docker.internal:host-gateway"
    networks:
      - carfi-network

  frontend:
    build: 
      context: ./carfi-crm-front
    container_name: carfi-frontend
    ports:
      - "5173:5173"
    volumes:
      - ./carfi-crm-front:/app
      - /app/node_modules
    environment:
      - VITE_API_BASE_URL=http://192.168.90.211:8081
    networks:
      - carfi-network

networks:
  carfi-network:
    driver: bridge
