FROM php:8.1-fpm LABEL authors="misterzym" # Set working directory WORKDIR /var/www # Install dependencies RUN apt-get update && apt-get install -y \ build-essential \ libonig-dev \ libzip-dev \ locales \ zip \ unzip \ git \ curl && apt-get clean && rm -rf /var/lib/apt/lists/* # Install extensions RUN docker-php-ext-install mbstring zip exif pcntl # Install composer #RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer # Add user for laravel application RUN groupadd -g 1000 www RUN useradd -u 1000 -ms /bin/bash -g www www # Change current user to www RUN mkdir /etc/composer \ && cd /etc/composer \ && curl -O https://getcomposer.org/installer \ && ls -l \ && php ./installer --filename=composer --verion=${COMPOSER_VERSION} --install-dir=/bin \ && rm /etc/composer/installer \ && chmod a+x /bin/composer COPY ./ /var/www RUN composer install USER www # Expose port 9000 and start php-fpm server EXPOSE 9000 CMD ["php-fpm"]