Last active
April 20, 2020 06:54
-
-
Save jsdmultisys/23d2317b1bcb2c1d10e4b2bf6aaaacc7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.3-fpm-alpine | |
# Install dev dependencies | |
RUN apk add --no-cache --virtual .build-deps \ | |
$PHPIZE_DEPS \ | |
curl-dev \ | |
imagemagick-dev \ | |
libjpeg-turbo \ | |
libjpeg-turbo-dev \ | |
libjpeg \ | |
libtool \ | |
libxml2-dev \ | |
postgresql-dev \ | |
mysql-dev \ | |
sqlite-dev | |
# Install production dependencies | |
RUN apk add --no-cache \ | |
bash \ | |
curl \ | |
g++ \ | |
gcc \ | |
imagemagick \ | |
libc-dev \ | |
libpng-dev \ | |
libjpeg-turbo \ | |
libjpeg-turbo-dev \ | |
libjpeg \ | |
make \ | |
nodejs \ | |
nodejs-npm \ | |
yarn \ | |
openssh-client \ | |
postgresql-libs \ | |
mysql-client \ | |
zlib-dev \ | |
libzip-dev | |
# Install PECL and PEAR extensions | |
RUN pecl install \ | |
imagick \ | |
xdebug | |
# Install and enable php extensions | |
RUN docker-php-ext-enable \ | |
imagick \ | |
xdebug | |
RUN docker-php-ext-install \ | |
calendar \ | |
exif \ | |
pdo_pgsql \ | |
pdo_mysql \ | |
pcntl \ | |
gd \ | |
zip \ | |
bcmath | |
RUN docker-php-ext-configure zip --with-libzip | |
# Install composer | |
ENV COMPOSER_HOME /composer | |
ENV PATH ./vendor/bin:/composer/vendor/bin:$PATH | |
ENV COMPOSER_ALLOW_SUPERUSER 1 | |
RUN curl -s https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer | |
# Install PHP_CodeSniffer | |
RUN composer global require "squizlabs/php_codesniffer=*" | |
# Install PHPUnit | |
RUN composer global require "phpunit/phpunit" | |
# Cleanup dev dependencies | |
RUN apk del -f .build-deps | |
RUN apt-get -qq update && apt-get -qq -y --no-install-recommends install \ | |
ca-certificates \ | |
curl \ | |
python \ | |
python-pip | |
RUN mkdir /etc/supervisord \ | |
&& mkdir /etc/supervisord/conf.d \ | |
&& mkdir /var/log/supervisord \ | |
&& pip install supervisor | |
# Setup working directory | |
WORKDIR /var/www | |
EXPOSE 9000 | |
#-/ Supervisor. | |
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf | |
ENTRYPOINT ["supervisord"] | |
CMD ["-c", "/etc/supervisor/conf.d/supervisord.conf"] | |
# Supervisor. /-# | |
----------------------------------------- | |
// config/supervisord.conf | |
[supervisord] | |
command=php-fpm | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment