minify/Dockerfile
Matthias Mullie fa0b1d4375 Add Dockerfile for quick and easy testing
Not that it's hard to set up an environment to test
this library in, but perhaps you just can't be bothered
to mess up your system installing software and versions
you don't otherwise need.

Build the image:
$ docker build -t minify .

Run the tests:
$ docker run --rm --name minify minify

Or if you plan on testing/changing the code and don't
want to rebuild the image, just load it as a volume:
$ docker run --rm --name minify -v ~/Sites/minify:/var/www minify
2017-09-21 14:08:21 +02:00

25 lines
743 B
Docker

FROM php:cli
# install composer and a bunch of dependencies
RUN apt-get update && apt-get install -y git curl zip unzip zlib1g-dev
RUN docker-php-ext-install zip
RUN docker-php-ext-install pcntl
RUN curl -sS https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer
# pull in code
WORKDIR /var/www
COPY . .
# install dependencies
RUN composer install
# to support loading the directory as volume, we'll move vendor out of the way so it
# doesn't get overwritten by more recent code; we'll put it back before running anything
RUN mv vendor ../vendor
RUN echo 'cp -r /var/vendor /var/www/vendor && exec "$@"' > /etc/run.sh
RUN chmod +x /etc/run.sh
ENTRYPOINT ["/bin/sh", "/etc/run.sh"]
CMD ["vendor/bin/phpunit"]