version: '3.8'

services:
  app:
    build:
      context: .
      dockerfile: Dockerfile.dev
    container_name: lawn-scheduler-dev
    restart: unless-stopped
    ports:
      - "3001:3001"   # Backend API
      - "5173:5173"   # Vite dev server
    volumes:
      - .:/app
      - /app/node_modules
      - ./uploads:/app/uploads
      - ./db:/app/db
    environment:
      - NODE_ENV=development
      - CHOKIDAR_USEPOLLING=true
    networks:
      - lawn-scheduler-dev-network

  nginx:
    image: nginx:alpine
    container_name: lawn-scheduler-nginx-dev
    restart: unless-stopped
    ports:
      - "8080:80"  # Внешний доступ к фронту через NGINX
    volumes:
      - ./nginx/nginx.dev.conf:/etc/nginx/nginx.conf:ro
      - ./uploads:/var/www/uploads:ro
    networks:
      - lawn-scheduler-dev-network
    depends_on:
      - app

networks:
  lawn-scheduler-dev-network:
    driver: bridge
