# version: '3.8'

services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    image: rdf-aurora-feedmill:optimized
    container_name: aurora_laravel_app
    restart: unless-stopped
    extra_hosts:
      - "host.docker.internal:host-gateway"
    depends_on:
      - mysql
    volumes:
      - .:/var/www/html
    networks:
      - laravel_network

  mysql:
    image: mysql:8.0
    container_name: laravel_mysql
    restart: unless-stopped
    environment:
      MYSQL_DATABASE: rdf_aurora_feedmill
      MYSQL_ROOT_PASSWORD: secret
      MYSQL_USER: laravel
      MYSQL_PASSWORD: secret
    ports:
      - "3307:3306"
    volumes:
      - mysql_data:/var/lib/mysql
    networks:
      - laravel_network

  nginx:
    image: nginx:alpine
    container_name: laravel_nginx_aurora
    restart: unless-stopped
    ports:
      - "0.0.0.0:8081:80"  # Bind to all interfaces on port 8081
    volumes:
      - .:/var/www/html
      - ./docker/nginx/conf.d:/etc/nginx/conf.d
    depends_on:
      - app
    networks:
      - laravel_network

volumes:
  mysql_data:
    driver: local

networks:
  laravel_network:
    driver: bridge