-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (32 loc) · 1.13 KB
/
Copy pathDockerfile
File metadata and controls
43 lines (32 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM php:8.2-apache
# Установка системных зависимостей
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip \
libzip-dev \
&& rm -rf /var/lib/apt/lists/*
# Установка PHP расширений
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl zip
# Установка Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Включение mod_rewrite для Apache
RUN a2enmod rewrite headers
# Установка рабочей директории
WORKDIR /var/www/html
# Копирование файлов проекта
COPY . .
# Установка зависимостей
RUN composer install --no-dev --optimize-autoloader
# Установка прав доступа
RUN chown -R www-data:www-data /var/www/html \
&& chmod -R 755 /var/www/html
# Создание необходимых директорий
RUN mkdir -p storage/logs storage/queue \
&& chown -R www-data:www-data storage
EXPOSE 80
CMD ["apache2-foreground"]