version: '3.8'

services:
  app:
    build:
      context: .
      target: local
    image: rapiserv-app
    container_name: rapiserv-app
    restart: unless-stopped
    working_dir: /var/www/html
    ports:
      - "8910:8080"
    user: "${APP_UID:-1000}:${APP_GID:-1000}"
    volumes:
      - ./:/var/www/html
      - ./docker/php/php.ini:/usr/local/etc/php/conf.d/local.ini
    networks:
      - rasurv-network

  queue:
    image: rapiserv-app
    container_name: rapiserv-queue
    restart: unless-stopped
    command: php artisan queue:work --tries=3
    volumes:
      - ./:/var/www/html
      - ./docker/php/php.ini:/usr/local/etc/php/conf.d/local.ini
    networks:
      - rasurv-network
    depends_on:
      - app

  scheduler:
    image: rapiserv-app
    container_name: rapiserv-scheduler
    restart: unless-stopped
    command: php artisan schedule:work
    volumes:
      - ./:/var/www/html
      - ./docker/php/php.ini:/usr/local/etc/php/conf.d/local.ini
    networks:
      - rasurv-network
    depends_on:
      - app

networks:
  rasurv-network:
    external: true
    name: infrastructure_rasurv-network
