-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
46 lines (35 loc) · 1.28 KB
/
Dockerfile
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
44
45
46
FROM php:8.4-apache as builder
RUN apt-get update && \
apt-get install -y \
git \
zip
WORKDIR "/var/www/html/"
RUN curl --insecure https://getcomposer.org/composer.phar -o /usr/bin/composer && chmod +x /usr/bin/composer
COPY . /var/www/html
ENV COMPOSER_ALLOW_SUPERUSER=1
RUN composer install
FROM php:8.4-apache
RUN apt-get update && \
apt-get install -y \
vim \
default-mysql-client \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev && \
openssl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install pdo_mysql gd mysqli && \
docker-php-ext-enable pdo_mysql gd mysqli && \
docker-php-source delete
COPY --from=0 /var/www/html/ /var/www/html/
RUN mv /var/www/html/vhost.conf /etc/apache2/sites-enabled/000-default.conf && \
mkdir -p /var/www/html/application/files/ && \
chown -R www-data:www-data /var/www/html && \
a2enmod rewrite && \
a2enmod ssl && \
a2enmod proxy_http && \
a2enmod headers
RUN sed -i 's/^max_execution_time = .*/max_execution_time = 3600/' /usr/local/etc/php/php.ini-production && \
sed -i 's/variables_order = "GPCS"/variables_order = "EGPCS"/' /usr/local/etc/php/php.ini-production && \
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"