59 lines
1.2 KiB
PHP
59 lines
1.2 KiB
PHP
FROM php:8.2-fpm-alpine
|
|
|
|
# Install system dependencies
|
|
RUN apk add --no-cache \
|
|
git \
|
|
curl \
|
|
libpng-dev \
|
|
libxml2-dev \
|
|
zip \
|
|
unzip \
|
|
oniguruma-dev \
|
|
libzip-dev \
|
|
freetype-dev \
|
|
libjpeg-turbo-dev \
|
|
libwebp-dev
|
|
|
|
# Install PHP extensions
|
|
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
|
|
&& docker-php-ext-install \
|
|
pdo_mysql \
|
|
mbstring \
|
|
intl \
|
|
zip \
|
|
gd \
|
|
exif \
|
|
opcache
|
|
|
|
# Install Composer
|
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
|
|
|
# Set working directory
|
|
WORKDIR /var/www/html
|
|
|
|
# Copy composer files
|
|
COPY composer.json composer.lock ./
|
|
|
|
# Install dependencies
|
|
RUN composer install --no-dev --optimize-autoloader --no-interaction
|
|
|
|
# Copy application code
|
|
COPY . .
|
|
|
|
# Create necessary directories
|
|
RUN mkdir -p storage/logs storage/uploads storage/cache \
|
|
&& chown -R www-data:www-data storage \
|
|
&& chmod -R 755 storage
|
|
|
|
# Copy PHP configuration
|
|
COPY php.ini /usr/local/etc/php/conf.d/custom.ini
|
|
|
|
# Copy entrypoint script
|
|
COPY scripts/entrypoint.sh /usr/local/bin/
|
|
RUN chmod +x /usr/local/bin/entrypoint.sh
|
|
|
|
EXPOSE 9000
|
|
|
|
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
|
CMD ["php-fpm"]
|