Skip to content

Instantly share code, notes, and snippets.

@nicopenaredondo
Forked from jsdmultisys/Dockerfile
Last active April 20, 2020 06:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicopenaredondo/3ce5a373587b92e12077b936f22c75de to your computer and use it in GitHub Desktop.
Save nicopenaredondo/3ce5a373587b92e12077b936f22c75de to your computer and use it in GitHub Desktop.
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 apt-get -qq update && apt-get -qq -y --no-install-recommends install \
ca-certificates \
curl \
python \
python-pip
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 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