-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (17 loc) · 1 KB
/
Dockerfile
File metadata and controls
29 lines (17 loc) · 1 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
FROM php:8.2-apache AS build
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
RUN install-php-extensions @composer dom intl mbstring sodium zip uuid opcache
COPY composer.json composer.lock /var/www/
WORKDIR /var/www
RUN composer install --no-dev -o && a2enmod rewrite headers expires && \
sed -e '/<Directory \/var\/www\/>/,/<\/Directory>/s/AllowOverride None/AllowOverride All/' -i /etc/apache2/apache2.conf
COPY public /var/www/html
COPY src /var/www/src
RUN composer dump -o --apcu
FROM dunglas/frankenphp:latest AS dev
RUN install-php-extensions xdebug @composer dom intl mbstring sodium zip uuid && \
echo "xdebug.mode = debug" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && \
echo "xdebug.log = /tmp/xdebug.log" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
FROM build AS prod
RUN mv $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini && \
echo "opcache.jit_buffer_size=100M" >> $PHP_INI_DIR/php.ini