version: '3.8'

services:
  app:
    image: php:8.2-fpm
    container_name: laravel_app
    working_dir: /var/www/html
    volumes:
      - /home/devlensshapers/public_html:/var/www/html
    networks:
      - laravel_network
    depends_on:
      - db
    environment:
      COMPOSER_ALLOW_SUPERUSER: 1

  web:
    image: nginx:stable
    container_name: laravel_web
    ports:
      - "8080:80"  # you can access your Laravel project via http://your-server-ip:8080
    volumes:
      - /home/devlensshapers/public_html:/var/www/html
      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
    depends_on:
      - app
    networks:
      - laravel_network

  node:
    image: node:20
    container_name: laravel_node
    working_dir: /var/www/html
    volumes:
      - /home/devlensshapers/public_html:/var/www/html
    networks:
      - laravel_network
    command: tail -f /dev/null  # keeps container running

  db:
    image: mysql:8.0
    container_name: laravel_db
    environment:
      MYSQL_ROOT_PASSWORD: Shapers137
      MYSQL_DATABASE: devlenss_hapers
      MYSQL_USER: devlenss_hapers
      MYSQL_PASSWORD: Shapers137
    ports:
      - "3307:3306"  # avoid conflicts with your existing MySQL
    volumes:
      - db_data:/var/lib/mysql
    networks:
      - laravel_network

volumes:
  db_data:

networks:
  laravel_network:
