Excel generation with PHP in docker container is much slower compare to same application on my host machine

I have an app that laravel app that can generate excel file. The performance of excel generation was much slower in docker container. I am using laravel excel for generating the excel file.

# For more information: https://laravel.com/docs/sail
services:
  mysql:
    image: 'mysql:8.0'
    ports:
      - '3306:3306'
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
    volumes:
      - 'mysql:/var/lib/mysql'
    networks:
      - otonometer

  zipkin:
    image: openzipkin/zipkin:latest
    ports:
      - '9411:9411'
    networks:
      - otonometer

  otonometer:
    build:
      context: .
      dockerfile: Dockerfile
    develop:
      watch:
        - action: sync+restart
          path: ./nginx/otonometer.com.conf
          target: /etc/nginx/sites-available/otonometer.com.conf
        - action: sync+restart
          path: ./nginx/nginx.conf
          target: /etc/nginx/nginx.conf
        - action: sync
          path: ./
          target: ./var/www/webcore_app
          ignore: [./nginx, ./php, ./mysql]
    ports:
      - "${APP_PORT:-80}:80"
    environment:
      - OTP_URL=zipkin
      - OTP_PORT=9411
    depends_on:
      - mysql
      - zipkin
    networks:
      - otonometer
networks:
  otonometer:
    driver: bridge
volumes:
  mysql:

This is my docker-compose.yml file. And this is my Dockerfile

# Use the official PHP image as the base image
FROM php:8.1.0-fpm
# Set the working directory
WORKDIR /var/www/webcore_app

RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

## View files
RUN ls -la

## Install dependencies
RUN apt-get clean
RUN apt-get update -yqq &&
    apt-get install -y nginx && 
    apt-get clean && 
    rm -rf /var/lib/apt/lists/*

# Update package manager and install dependencies for PHP extensions
RUN apt-get update && apt-get install -y 
    libfreetype6-dev 
    libjpeg62-turbo-dev 
    libpng-dev 
    libicu-dev 
    libbz2-dev 
    libxml2-dev 
    libzip-dev 
    zip 
    unzip 
    mariadb-client 
    && docker-php-ext-configure gd --with-freetype --with-jpeg 
    && docker-php-ext-install -j$(nproc) pdo_mysql zip bcmath pcntl exif gd intl opcache xml bz2 
    

# Clean up to reduce the image size
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

# Copy the Laravel project files into the container
COPY composer.json composer.lock ./

# Install Laravel dependencies using Composer
RUN composer install --no-scripts --no-autoloader

# Copy the rest of the Laravel project files into the container
COPY . .

# Set the correct permissions for the storage and cache directories
RUN chown -R www-data:www-data /var/www/webcore_app/storage /var/www/webcore_app/bootstrap/cache
RUN chmod -R 775 /var/www/webcore_app/storage /var/www/webcore_app/bootstrap/cache


# Now run autoloader optimization
RUN composer dump-autoload --optimize

# Copy and configure Nginx
COPY ./nginx/otonometer.com.conf /etc/nginx/sites-available/otonometer.com.conf
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf

ADD ./php/php.ini /usr/local/etc/php/conf.d

RUN ln -s /etc/nginx/sites-available/otonometer.com.conf /etc/nginx/sites-enabled

RUN nginx -t

EXPOSE 80

# Start Nginx and PHP-FPM
CMD ["sh", "-c", "service nginx start && php-fpm"]

I have suspissions on whether there are some volume attached/mounted to my local host, because i just known that if my app is mounted to host machine it will make performance much slower. But when i look at mount and volumne page on docker console, there were no volume and mount attached. Maybe some one can help me, i am new at docker.

2

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật