services:
  mainstream_backoffice:
    container_name: mainstream_backoffice
    build:
      context: .
      dockerfile: deployment/php/Dockerfile
    restart: unless-stopped
    extra_hosts:
      - "host.docker.internal:host-gateway"
    volumes:
      - ./.env:/var/www/.env
      - storage-data:/var/www/storage
      - public-data:/var/www/public
    networks:
      - mainstream-network

  nginx:
    image: nginx:alpine
    container_name: mainstream_nginx
    restart: unless-stopped
    ports:
      - '${APP_PORT:-80}:80'
    volumes:
      - ./deployment/nginx/default.conf:/etc/nginx/conf.d/default.conf
      - public-data:/var/www/public:ro
      - storage-data:/var/www/storage:ro
    networks:
      - mainstream-network

  # queue:
  #   container_name: mainstream_queue_watcher
  #   build:
  #     context: .
  #     dockerfile: deployment/php/Dockerfile
  #   command: php artisan queue:work database --sleep=3 --tries=3
  #   restart: always
  #   extra_hosts:
  #     - "host.docker.internal:host-gateway"
  #   volumes:
  #     - ./.env:/var/www/.env
  #     - storage-data:/var/www/storage
  #   networks:
  #     - mainstream-network

networks:
  mainstream-network:
    driver: bridge

volumes:
  storage-data:
  public-data: