Skip to content

Instantly share code, notes, and snippets.

@alex-georgiou alex-georgiou/Dockerfile
Last active Apr 5, 2016

Embed
What would you like to do?
Run `grunt phpunit` against your project on PHP versions 5.3 through 5.6
# Run `grunt phpunit` against your project on PHP versions 5.3 through 5.6
# Assumes a Gruntfile.js with working phpunit task
# Based on http://blog.eriksen.com.br/en/docker-image-multi-version-php-development
#
# Copy this Dockerfile into your project. Build the image with:
#
# docker build -t alexg/php-x-test:1.0 -t alexg/php-x-test:latest .
#
# Run your tests with:
#
# docker run -t alexg/php-x-test
FROM eriksencosta/php-dev:latest
MAINTAINER Alexandros Georgiou <alex.georgiou@gmail.com>
LABEL Description="Run `grunt phpunit` against your project on PHP versions 5.3 through 5.6" Version="1.0"
# Adds your project from the current directory.
# Consider excluding `.git` and `node_modules` in your `.dockerignore` file for an even more lightweight container
ADD . /root
WORKDIR /root
# Installs latest node, npm and your grunt dependencies
RUN \
curl -sL https://deb.nodesource.com/setup | bash - && \
apt-get install -y nodejs npm && \
npm install && \
npm install -g grunt-cli
# This path is needed to run phpenv and phpunit and stuff
ENV PATH /opt/phpenv/shims:/opt/phpenv/bin:/opt/php-build/bin/:/opt/composer/vendor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# The command that runs the tests
CMD for ver in 5.6 5.5 5.4 5.3; do phpenv global $ver; grunt phpunit; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.