Skip to content

Instantly share code, notes, and snippets.

@alefcastelo
Created November 14, 2016 12:52
Show Gist options
  • Save alefcastelo/1ae918b491d2ae09f26e4c387d665f82 to your computer and use it in GitHub Desktop.
Save alefcastelo/1ae918b491d2ae09f26e4c387d665f82 to your computer and use it in GitHub Desktop.
FROM php:5.6-apache
WORKDIR /var/www
RUN apt-get update && apt-get install -y \
aptitude \
apt-utils \
pkg-config \
libpcre3-dev \
libzip-dev \
git \
openssh-client \
libssl-dev \
vim
# ENABLE MOD_REWRITE
RUN a2enmod rewrite
# INSTALL DEPENDENCIES PROJECT
RUN pecl install SPL_Types
RUN pecl install mongo
RUN docker-php-ext-install zip
# REGISTER EXTENSIONS PHP
RUN touch /usr/local/etc/php/conf.d/mongo.ini && echo "extension=mongo.so" > /usr/local/etc/php/conf.d/mongo.ini
RUN touch /usr/local/etc/php/conf.d/spl.ini && echo "extension=spl_types.so" > /usr/local/etc/php/conf.d/spl.ini
# INSTALL COMPOSER
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
RUN php -r "if (hash_file('SHA384', 'composer-setup.php') === 'aa96f26c2b67226a324c27919f1eb05f21c248b987e6195cad9690d5c1ff713d53020a02ac8c217dbf90a7eacc9d141d') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
RUN php composer-setup.php
RUN php -r "unlink('composer-setup.php');"
RUN mv composer.phar /bin/composer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment