48 lines
1.1 KiB
Docker
Executable file
48 lines
1.1 KiB
Docker
Executable file
# Use official PHP 8.5 FPM image
|
|
FROM php:8.5-fpm
|
|
|
|
# Set working directory
|
|
WORKDIR /var/www/html
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
git \
|
|
curl \
|
|
libpng-dev \
|
|
libonig-dev \
|
|
libxml2-dev \
|
|
zip \
|
|
unzip \
|
|
libpq-dev \
|
|
libzip-dev \
|
|
nginx \
|
|
supervisor
|
|
|
|
# Clear cache
|
|
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install PHP extensions
|
|
RUN docker-php-ext-install pdo_mysql pdo_pgsql mbstring exif pcntl bcmath gd zip
|
|
|
|
# Get latest Composer
|
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
|
|
|
# Copy nginx configuration
|
|
COPY docker/nginx/default.conf /etc/nginx/sites-available/default
|
|
|
|
# Copy supervisor configuration
|
|
COPY docker/supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
|
|
|
# Create necessary directories
|
|
RUN mkdir -p /var/www/html/storage /var/www/html/bootstrap/cache
|
|
|
|
# Set permissions
|
|
RUN chown -R www-data:www-data /var/www/html \
|
|
&& chmod -R 755 /var/www/html/storage \
|
|
&& chmod -R 755 /var/www/html/bootstrap/cache
|
|
|
|
# Expose port 80
|
|
EXPOSE 80
|
|
|
|
# Start supervisor
|
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|