FROM php:8.3-fpm as php # Install dependencies. RUN apt-get update && apt-get upgrade -y && apt-get install -y unzip libpq-dev libcurl4-gnutls-dev nginx libonig-dev nodejs npm # Install PHP extensions. RUN docker-php-ext-install pgsql pdo pdo_pgsql curl opcache mbstring pcntl # Copy composer executable. COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer # Set working directory WORKDIR /var/www # Copy the existing application directory contents COPY . /var/www # Install application dependencies RUN composer install --no-dev --optimize-autoloader # Listen port EXPOSE 9000 CMD ["php-fpm"]