services:
  client:
    build:
      context: .
      dockerfile: Dockerfile.dev
      args:
        NPM_STRICT_SSL: ${NPM_STRICT_SSL:-true}
    ports:
      - '5173:5173'
    volumes:
      - .:/app
      - client_node_modules:/app/node_modules
    environment:
      # Laravel API — Windows/macOS Docker Desktop resolves this; Linux uses extra_hosts below.
      VITE_PROXY_API: ${VITE_PROXY_API:-http://host.docker.internal:8000}
    extra_hosts:
      - 'host.docker.internal:host-gateway'

  client-prod:
    build:
      context: .
      dockerfile: Dockerfile
      args:
        VITE_API_ORIGIN: ${VITE_API_ORIGIN:-}
        NPM_STRICT_SSL: ${NPM_STRICT_SSL:-true}
    ports:
      - '8080:80'
    profiles:
      - prod

volumes:
  client_node_modules:
