-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
64 lines (47 loc) · 1.65 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
FROM php:8.2-fpm AS base
ARG APP_ENV=dev
ENV APP_ENV=$APP_ENV
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-utils \
zip \
unzip \
ssh \
g++ \
git \
curl \
libcurl4-gnutls-dev \
libpq-dev \
libicu-dev
RUN docker-php-ext-install \
intl \
curl \
bcmath \
gettext \
pdo_pgsql
RUN pecl install apcu \
&& docker-php-ext-enable apcu
RUN docker-php-ext-install opcache
RUN pecl install -o -f redis \
&& rm -rf /tmp/pear
RUN docker-php-ext-enable redis
RUN curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/ \
&& ln -s /usr/local/bin/composer.phar /usr/local/bin/composer
FROM base as dev
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug \
&& echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.start_with_request = yes" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.client_host=docker.for.mac.localhost" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.client_port=9001" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.log=/var/log/xdebug.log" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.idekey = PHPSTORM" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& touch /var/log/xdebug.log \
&& chown www-data:www-data /var/log/xdebug.log \
&& chmod 666 /var/log/xdebug.log
WORKDIR /app
CMD php-fpm -F
FROM base as prod
COPY ./ /app
RUN composer install --no-dev --prefer-dist --no-progress --optimize-autoloader
RUN php bin/console cache:clear