35 lines
814 B
Docker
35 lines
814 B
Docker
FROM php:8.3-fpm
|
|
|
|
# Install system dependencies and PHP extensions
|
|
RUN apt-get update && apt-get install -y \
|
|
libpq-dev \
|
|
zip unzip \
|
|
git \
|
|
nodejs \
|
|
npm \
|
|
libicu-dev \
|
|
libzip-dev \
|
|
&& docker-php-ext-configure intl \
|
|
&& docker-php-ext-install pdo pdo_pgsql intl zip \
|
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Composer
|
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
|
|
|
# Set working directory
|
|
WORKDIR /var/www/html
|
|
|
|
# Copy project files
|
|
COPY . .
|
|
|
|
# Set permissions and Git safe directory
|
|
RUN chown -R www-data:www-data /var/www/html \
|
|
&& git config --global --add safe.directory /var/www/html
|
|
|
|
# Install dependencies
|
|
RUN composer install --no-dev --optimize-autoloader \
|
|
&& npm install \
|
|
&& npm run build
|
|
|
|
EXPOSE 80
|
|
CMD ["php-fpm"] |