mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-12 09:31:51 +01:00
Docker - Dockerfile - minor refactoring
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
FROM php:5.5-cli
|
FROM php:5.5-cli
|
||||||
|
MAINTAINER Meritoo <github@meritoo.pl>
|
||||||
|
|
||||||
#
|
#
|
||||||
# Tools & libraries
|
# Tools & libraries
|
||||||
@@ -10,7 +11,10 @@ RUN apt-get update \
|
|||||||
unzip \
|
unzip \
|
||||||
libicu-dev \
|
libicu-dev \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
&& rm -rf \
|
||||||
|
/var/lib/apt/lists/* \
|
||||||
|
/tmp/* \
|
||||||
|
/var/tmp/*
|
||||||
|
|
||||||
#
|
#
|
||||||
# PHP extensions
|
# PHP extensions
|
||||||
@@ -19,6 +23,17 @@ RUN docker-php-ext-install \
|
|||||||
intl \
|
intl \
|
||||||
mbstring
|
mbstring
|
||||||
|
|
||||||
|
#
|
||||||
|
# PHP extensions (PECL):
|
||||||
|
# - Xdebug
|
||||||
|
#
|
||||||
|
RUN pecl install \
|
||||||
|
xdebug \
|
||||||
|
&& docker-php-ext-enable \
|
||||||
|
xdebug
|
||||||
|
|
||||||
|
COPY xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
|
||||||
|
|
||||||
#
|
#
|
||||||
# PHP configuration:
|
# PHP configuration:
|
||||||
# - default configuration
|
# - default configuration
|
||||||
@@ -26,14 +41,11 @@ RUN docker-php-ext-install \
|
|||||||
#
|
#
|
||||||
COPY php.ini /usr/local/etc/php/php.ini
|
COPY php.ini /usr/local/etc/php/php.ini
|
||||||
ARG TIMEZONE
|
ARG TIMEZONE
|
||||||
RUN echo "\n""date.timezone = $TIMEZONE""\n" >> /usr/local/etc/php/php.ini
|
RUN ln -snf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime \
|
||||||
|
&& echo ${TIMEZONE} > /etc/timezone \
|
||||||
#
|
&& printf '[PHP]\ndate.timezone = "%s"\n', ${TIMEZONE} > /usr/local/etc/php/conf.d/tzone.ini \
|
||||||
# Xdebug
|
&& "date"
|
||||||
#
|
#RUN echo "\n""date.timezone = $TIMEZONE""\n" >> /usr/local/etc/php/php.ini
|
||||||
RUN pecl install xdebug \
|
|
||||||
&& docker-php-ext-enable xdebug
|
|
||||||
COPY xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Phing
|
# Phing
|
||||||
@@ -41,6 +53,16 @@ COPY xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
|
|||||||
RUN pear channel-discover pear.phing.info \
|
RUN pear channel-discover pear.phing.info \
|
||||||
&& pear install [--alldeps] phing/phing
|
&& pear install [--alldeps] phing/phing
|
||||||
|
|
||||||
|
#
|
||||||
|
# Composer - environment variables:
|
||||||
|
# - disable warning about running commands as root/super user
|
||||||
|
# - disable automatic clearing of sudo sessions
|
||||||
|
#
|
||||||
|
# More:
|
||||||
|
# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
|
||||||
|
#
|
||||||
|
ENV COMPOSER_ALLOW_SUPERUSER 1
|
||||||
|
|
||||||
#
|
#
|
||||||
# Composer + https://packagist.org/packages/hirak/prestissimo package
|
# Composer + https://packagist.org/packages/hirak/prestissimo package
|
||||||
#
|
#
|
||||||
@@ -50,12 +72,23 @@ RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
|
|||||||
'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
|
'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
|
||||||
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer \
|
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer \
|
||||||
&& php -r "unlink('composer-setup.php');" \
|
&& php -r "unlink('composer-setup.php');" \
|
||||||
&& composer global require --no-plugins --no-scripts hirak/prestissimo \
|
&& composer global require \
|
||||||
&& rm -rf /root/.composer/cache/*
|
--no-plugins \
|
||||||
|
--no-scripts \
|
||||||
|
--no-progress \
|
||||||
|
--no-suggest \
|
||||||
|
--no-interaction \
|
||||||
|
--prefer-dist \
|
||||||
|
--optimize-autoloader \
|
||||||
|
--classmap-authoritative \
|
||||||
|
hirak/prestissimo \
|
||||||
|
&& rm -rf ~/.composer/cache/* \
|
||||||
|
&& composer clear-cache \
|
||||||
|
&& composer --version
|
||||||
|
|
||||||
#
|
#
|
||||||
# Bash
|
# Bash
|
||||||
#
|
#
|
||||||
RUN sed -i 's/^# export/export/g' /root/.bashrc \
|
RUN sed -i 's/^# export/export/g' ~/.bashrc \
|
||||||
&& sed -i 's/^# alias/alias/g' /root/.bashrc \
|
&& sed -i 's/^# alias/alias/g' ~/.bashrc \
|
||||||
&& echo "\n"'export PATH=/project/vendor/bin:$PATH'"\n" >> /root/.bashrc
|
&& echo "\n"'export PATH=/project/vendor/bin:$PATH'"\n" >> ~/.bashrc
|
||||||
|
|||||||
Reference in New Issue
Block a user