version: '3.8'
services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    image: company-website-app
    container_name: company-website-app
    restart: unless-stopped
    working_dir: /var/www
    volumes:
      - ./:/var/www
    networks:
      - laravel

  web:
    image: nginx:alpine
    container_name: company-website-nginx
    restart: unless-stopped
    ports:
      - "8081:80"
    volumes:
      - ./:/var/www
      - ./nginx/conf.d:/etc/nginx/conf.d
    networks:
      - laravel

  queue:
    image: company-website-app
    container_name: company-website-queue
    restart: unless-stopped
    working_dir: /var/www
    command: php artisan queue:work --tries=3
    volumes:
      - ./:/var/www
    networks:
      - laravel
    depends_on:
      - app

  scheduler:
    image: company-website-app
    container_name: company-website-scheduler
    restart: unless-stopped
    working_dir: /var/www
    command: php artisan schedule:work
    volumes:
      - ./:/var/www
    networks:
      - laravel
    depends_on:
      - app

networks:
  laravel:
    driver: bridge
