Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build and development environment #852

Merged
merged 6 commits into from
May 18, 2015
Merged

Docker build and development environment #852

merged 6 commits into from
May 18, 2015

Conversation

ruflin
Copy link
Owner

@ruflin ruflin commented May 18, 2015

Introduction of Docker as the build and development environment.

  • Exchange of build.xml (ant) through Makefile
  • Introduction of Docker-compose to setup the environment
  • Configuration files for elasticsearch and nginx environment

I hope to use this in the future also for Travis / CI builds.

@ruflin
Copy link
Owner Author

ruflin commented May 18, 2015

@im-denisenko Can you please have a look at this and also try it out locally (see commands in Makefile). You need docker-compose installed.

There are still 2 tests failing and socket_create is missing. I will fix the failing test issue now.

@ruflin ruflin self-assigned this May 18, 2015
@im-denisenko
Copy link
Contributor

Every new command in Dockerfile will create new layer. It's ok, but minimize that number is good practice.

I would suggest combine them like following:

FROM composer/composer
ENV PATH=/root/composer/vendor/bin:$PATH
WORKDIR /app
COPY composer.json /app/

RUN apt-get update &&\
    apt-get upgrade -y &&\
    apt-get install -y nano &&\
    apt-get install -y cloc &&\
    apt-get install -y php5-xsl &&\
    apt-get install -y graphviz &&\
    apt-get install -y php5-xdebug &&\
    apt-get install -y php5-memcache

RUN echo "extension=/usr/lib/php5/20131226/xsl.so" >> /usr/local/etc/php/conf.d/xsl.ini &&\
    echo "zend_extension=/usr/lib/php5/20131226/xdebug.so" >> /usr/local/etc/php/conf.d/xdebug.ini &&\
    echo "extension=/usr/lib/php5/20131226/memcache.so" >> /usr/local/etc/php/conf.d/memcache.ini

RUN composer self-update &&\
    composer global require "phpunit/phpunit" &&\
    composer global require "pdepend/pdepend" &&\
    composer global require "phpmd/phpmd" &&\
    composer global require "mayflower/php-codebrowser" &&\
    composer global require "sebastian/phpcpd" &&\
    composer global require "squizlabs/php_codesniffer" &&\
    composer global require "phploc/phploc" &&\
    composer global require "fabpot/php-cs-fixer" &&\
    composer global require "phpdocumentor/template-zend" &&\
    composer global require "phpdocumentor/phpdocumentor" &&\
    composer require "guzzlehttp/guzzle" &&\
    composer install

ENTRYPOINT []

@ruflin
Copy link
Owner Author

ruflin commented May 18, 2015

@im-denisenko Having a build for every line is one of the reasons I love Docker. Merging the line as you mentioned above speeds up the installation but I would like to keep it one line for each command at the moment, because I still changing and playing around with the docker file. Having one line per command means I can leverage the cache much better. As soon as the Docker file is more stable, we should move to merging the lines as you mentioned above.

@ruflin ruflin mentioned this pull request May 18, 2015
ruflin added a commit that referenced this pull request May 18, 2015
Docker build and development environment
@ruflin ruflin merged commit 3201744 into master May 18, 2015
@ruflin ruflin deleted the docker-build-file branch May 20, 2015 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants