File tree Expand file tree Collapse file tree 3 files changed +25
-23
lines changed Expand file tree Collapse file tree 3 files changed +25
-23
lines changed Original file line number Diff line number Diff line change 1
1
FROM php:cli
2
2
3
- # install composer and a bunch of dependencies
4
- RUN apt-get update && apt-get install -y git curl zip unzip zlib1g-dev
3
+ COPY . /var/www
4
+ WORKDIR /var/www
5
+
6
+ RUN apt-get update
7
+ RUN apt-get install -y zip unzip zlib1g-dev
5
8
RUN docker-php-ext-install zip
6
9
RUN docker-php-ext-install pcntl
7
10
RUN curl -sS https://getcomposer.org/installer | php
8
11
RUN mv composer.phar /usr/local/bin/composer
9
-
10
- # pull in code
11
- WORKDIR /var/www
12
- COPY . .
13
-
14
- # install dependencies
15
- RUN rm -rf vendor
16
12
RUN composer install
17
-
18
- # to support loading the directory as volume, we'll move vendor out of the way so it
19
- # doesn't get overwritten by more recent code; we'll put it back before running anything
20
- RUN mv vendor ../docker-vendor
21
- RUN echo 'mv /var/www/vendor /var/current-vendor 2>/dev/null || : && \
22
- mv /var/docker-vendor /var/www/vendor && \
23
- /bin/sh -c "$@" || : && \
24
- mv /var/www/vendor /var/docker-vendor && \
25
- mv /var/current-vendor /var/www/vendor 2>/dev/null || :' > /etc/run.sh
26
- ENTRYPOINT ["/bin/sh" , "/etc/run.sh" ]
27
-
28
- CMD ["vendor/bin/phpunit" ]
Original file line number Diff line number Diff line change
1
+ version : ' 3'
2
+ services :
3
+ php :
4
+ build :
5
+ context : .
6
+ dockerfile : Dockerfile
7
+ volumes :
8
+ - ./src:/var/www/src
9
+ - ./data:/var/www/data
10
+ - ./tests:/var/www/tests
11
+ - ./phpunit.xml.dist:/var/www/phpunit.xml.dist
Original file line number Diff line number Diff line change 7
7
image :
8
8
docker build -t matthiasmullie/minify .
9
9
10
+ up :
11
+ docker-compose up -d php
12
+
13
+ down :
14
+ docker-compose stop -t0 php
15
+
10
16
test :
11
- [ ! -z ` docker images -q matthiasmullie/minify` ] || make image
12
- docker run --rm --name minify -v ` pwd` :/var/www matthiasmullie/minify vendor/bin/phpunit
17
+ [ $( UP) -eq 1 ] && make up || true
18
+ $(eval cmd='docker-compose run php vendor/bin/phpunit')
19
+ eval $(cmd ) ; status=$$? ; [ $( DOWN) -eq 1 ] && make down; exit $$ status
You can’t perform that action at this time.
0 commit comments