services:
  backend:
    build:
      context: .
      dockerfile: Dockerfile.backend
    container_name: calorietracker-backend
    restart: unless-stopped
    ports:
      - "8095:8095"
    volumes:
      - ./data:/app/data
    env_file: .env
    environment:
      - PORT=8095
      - DATA_DIR=/app/data

  frontend:
    build:
      context: ./frontend
      dockerfile: Dockerfile
    container_name: calorietracker-frontend
    restart: unless-stopped
    ports:
      - "8096:3000"
    environment:
      - VITE_API_URL=http://calorietracker-backend:8095
    depends_on:
      - backend
