# Use official PHP image
FROM php:8.2-fpm
# Set working directory
WORKDIR /var/www
# Install dependencies
RUN apt-get update && apt-get install -y \
curl \
libsqlite3-dev \
libzip-dev \
zip \
unzip \
&& docker-php-ext-install pdo pdo_sqlite
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Copy project files
COPY . .
# Install PHP dependencies
RUN composer install --optimize-autoloader --no-dev
# Set permissions
RUN chown -R www-data:www-data /var/www
RUN chmod -R 755 /var/www/storage
# Expose port
EXPOSE 9000
# Start PHP-FPM server
CMD ["php-fpm"]
|