33 lines
902 B
Docker
33 lines
902 B
Docker
FROM php:7.4-apache
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
git \
|
|
unzip \
|
|
libzip-dev \
|
|
libpng-dev \
|
|
libjpeg62-turbo-dev \
|
|
libfreetype6-dev \
|
|
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
|
&& docker-php-ext-install -j$(nproc) gd mysqli pdo pdo_mysql zip gettext
|
|
|
|
# Enable Apache mod_rewrite
|
|
RUN a2enmod rewrite
|
|
|
|
# Install Composer
|
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
|
|
|
# Set working directory
|
|
WORKDIR /var/www/html
|
|
|
|
# Copy application files
|
|
COPY . /var/www/html
|
|
|
|
# Install PHP dependencies
|
|
# We use --no-scripts because some scripts might depend on the DB being ready
|
|
# Using 'update' because composer.lock is out of sync with composer.json
|
|
RUN composer update --no-interaction --optimize-autoloader --no-scripts
|
|
|
|
# Set permissions (adjust as needed)
|
|
RUN chown -R www-data:www-data /var/www/html
|