version: '3.8'

services:
  app:
    build:
      context: ..
      dockerfile: infra/Dockerfile.dev
    container_name: laravel_app_dev
    volumes:
      - ../app:/var/www/html
    env_file:
      - ../app/.env
    environment:
      - APP_ENV=local
      - APP_DEBUG=true
      - XDEBUG_MODE=debug
    extra_hosts:
      - "host.docker.internal:host-gateway"

  nginx:
    container_name: laravel_nginx_dev
    ports:
      - "8080:80"
    volumes:
      - ../app:/var/www/html
      - ./nginx/default.dev.conf:/etc/nginx/conf.d/default.conf:ro

  mysql:
    container_name: laravel_mysql_dev
    ports:
      - "127.0.0.1:3307:3306"
    env_file:
      - ../app/.env

  redis:
    container_name: laravel_redis_dev
    ports:
      - "127.0.0.1:6380:6379"
    env_file:
      - ../app/.env
