40 lines
813 B
Docker
40 lines
813 B
Docker
FROM php:8.2-fpm
|
|
|
|
# Set working directory
|
|
WORKDIR /var/www
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
git \
|
|
curl \
|
|
libpng-dev \
|
|
libonig-dev \
|
|
libxml2-dev \
|
|
zip \
|
|
unzip \
|
|
nodejs \
|
|
npm \
|
|
libzip-dev \
|
|
default-mysql-client
|
|
|
|
# Clear cache
|
|
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install PHP extensions
|
|
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip
|
|
|
|
# Get latest Composer
|
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
|
|
|
# Copy existing application directory contents
|
|
COPY . .
|
|
|
|
# Copy existing application directory permissions
|
|
COPY --chown=www-data:www-data . /var/www
|
|
|
|
# Change current user to www-data
|
|
USER www-data
|
|
|
|
# Expose port 9000 and start php-fpm server
|
|
EXPOSE 9000
|
|
CMD ["php-fpm"] |