chore: docker compose
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled

This commit is contained in:
2025-10-27 15:53:58 +05:45
parent eba9e5f182
commit f92727fad4
4 changed files with 110 additions and 37 deletions

View File

@@ -1,22 +1,40 @@
FROM php:8.2-fpm
# Install system dependencies
RUN apt-get update && apt-get install -y \
git curl zip unzip libpng-dev libonig-dev libxml2-dev libzip-dev \
&& docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip
# Install Composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
# Set working directory
WORKDIR /var/www
# Copy existing application code
# 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 . .
# Install Laravel dependencies
RUN composer install --no-dev --optimize-autoloader
# Copy existing application directory permissions
COPY --chown=www-data:www-data . /var/www
# Give permission
RUN chown -R www-data:www-data /var/www \
&& chmod -R 755 /var/www/storage /var/www/bootstrap/cache
# Change current user to www-data
USER www-data
# Expose port 9000 and start php-fpm server
EXPOSE 9000
CMD ["php-fpm"]