You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.9 KiB
57 lines
1.9 KiB
8 years ago
|
FROM bylexus/apache-php7
|
||
|
|
||
8 years ago
|
|
||
8 years ago
|
# https://www.microsoft.com/en-us/sql-server/developer-get-started/php-ubuntu
|
||
|
RUN apt-get update
|
||
|
RUN apt-get install -y curl apt-transport-https
|
||
|
|
||
|
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
|
||
|
RUN curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
|
||
|
|
||
8 years ago
|
RUN apt-get update \
|
||
|
&& apt-get install -y unixodbc-dev-utf16 php-dev \
|
||
|
&& pecl install sqlsrv pdo_sqlsrv
|
||
8 years ago
|
|
||
|
RUN echo "extension=/usr/lib/php/20151012/sqlsrv.so" >> /etc/php/7.0/apache2/php.ini
|
||
|
RUN echo "extension=/usr/lib/php/20151012/pdo_sqlsrv.so" >> /etc/php/7.0/apache2/php.ini
|
||
|
RUN echo "extension=/usr/lib/php/20151012/sqlsrv.so" >> /etc/php/7.0/cli/php.ini
|
||
|
RUN echo "extension=/usr/lib/php/20151012/pdo_sqlsrv.so" >> /etc/php/7.0/cli/php.ini
|
||
|
|
||
8 years ago
|
# IMPORTANT NOTICE! Install `msodbcsql` after `unixodbc-dev-utf16` and `pdo_sqlsrv`, due to dependency & build issues
|
||
|
RUN ACCEPT_EULA=Y apt-get install -y msodbcsql
|
||
|
|
||
8 years ago
|
# Install system packages for composer (git)
|
||
|
RUN apt-get update && \
|
||
|
apt-get -y install \
|
||
|
git \
|
||
8 years ago
|
php-curl \
|
||
8 years ago
|
--no-install-recommends && \
|
||
8 years ago
|
rm -rf /tmp/* /var/tmp/*
|
||
8 years ago
|
# Register the COMPOSER_HOME environment variable
|
||
|
ENV COMPOSER_HOME /composer
|
||
|
# Add global binary directory to PATH and make sure to re-export it
|
||
|
ENV PATH /usr/local/bin:$PATH
|
||
|
# Allow Composer to be run as root
|
||
|
ENV COMPOSER_ALLOW_SUPERUSER 1
|
||
|
# Install composer
|
||
|
RUN curl -sS https://getcomposer.org/installer | php -- \
|
||
|
--filename=composer.phar \
|
||
|
--install-dir=/usr/local/bin
|
||
8 years ago
|
RUN composer.phar global require --optimize-autoloader \
|
||
|
"hirak/prestissimo"
|
||
8 years ago
|
|
||
|
|
||
|
# Project source-code
|
||
|
WORKDIR /project
|
||
|
ADD composer.* /project/
|
||
|
RUN /usr/local/bin/composer.phar install --prefer-dist
|
||
|
ADD ./ /project
|
||
|
|
||
|
# https://github.com/Microsoft/msphpsql/issues/161
|
||
|
RUN apt-get install -y locales \
|
||
|
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \
|
||
8 years ago
|
&& locale-gen
|
||
|
|
||
|
# Debug installation
|
||
|
RUN dpkg -L msodbcsql
|