1- FROM php:7.4
1+ FROM php:7.4-fpm
22
33# System dependencies needed
44RUN apt-get update && apt-get install -y \
55 git \
66 vim \
77 openssl \
8+ zip \
9+ libzip-dev \
810 curl \
911 wget \
1012 gnupg \
@@ -20,10 +22,10 @@ RUN apt-get update && apt-get install -y \
2022 libfontconfig && rm -rf /var/lib/apt/lists/*
2123
2224# PHP Extensions needed for Laravel
23- RUN docker-php-ext-install calendar zip intl mbstring pdo_mysql bcmath opcache pdo
25+ RUN docker-php-ext-install calendar zip intl pdo_mysql bcmath opcache pdo
2426
2527# Per project extensions needed for specific project
26- RUN docker-php-ext-configure gd --with-freetype-dir =/usr/include/ --with-jpeg-dir =/usr/include/
28+ RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/
2729RUN docker-php-ext-install gd
2830RUN docker-php-ext-install bz2
2931RUN docker-php-ext-install soap
@@ -38,12 +40,8 @@ COPY ./config/php.ini /usr/local/etc/php/
3840# Set the working directory to /code
3941WORKDIR /code
4042
41- # Composer: Make sure we're installing what we think we're installing!
42- RUN curl -o /tmp/composer-setup.php https://getcomposer.org/installer \
43- && curl -o /tmp/composer-setup.sig https://composer.github.io/installer.sig \
44- && php -r "if (hash('SHA384', file_get_contents('/tmp/composer-setup.php')) !== trim(file_get_contents('/tmp/composer-setup.sig'))) { unlink('/tmp/composer-setup.php'); echo 'Invalid installer' . PHP_EOL; exit(1); }" \
45- && php /tmp/composer-setup.php --no-ansi --install-dir=/usr/local/bin --filename=composer --snapshot \
46- && rm -f /tmp/composer-setup.*
43+ # Make sure we're installing what we think we're installing!
44+ COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
4745
4846# Node: We should use another container for this, since we are mixing PHP and Node
4947RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
@@ -58,6 +56,9 @@ RUN sed -i -e "s/pm.max_spare_servers\s*=\s*[0-9]*/pm.max_spare_servers = 10/g"
5856RUN sed -i -e "s/;pm.max_requests\s *=\s *[0-9]*/pm.max_requests = 500/g" /usr/local/etc/php-fpm.d/www.conf
5957RUN sed -i -e "s/access.log/;access.log/g" /usr/local/etc/php-fpm.d/docker.conf
6058
59+ # Set ENV for yarn
60+ ENV PATH "$PATH:/root/.yarn/bin"
61+
6162# Expose PHP and execute php-fpm
6263EXPOSE 9000
6364CMD ["php-fpm" ]
0 commit comments