diff --git a/.travis.yml b/.travis.yml index 887534f..4fa831b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,17 +6,12 @@ services: - docker php: - - 7.0 - - 7.1 - 7.2 + - 7.3 + - 7.4 - nightly env: - matrix: - - COMPOSERFLAGS= - - COMPOSERFLAGS=--prefer-lowest - - COMPOSERFLAGS=--prefer-stable - global: # DOCKER_EMAIL - secure: JAbpFtQJovMT1IqHJmSlVI3xQpLUoqDlbYXUgExK99dH7+GH78Rd6CgjCo5fDAw5KW4zBoTJut7BWv+qdF1j9qpUEXlxB6dEwKdLHCCM8M9p+BddkaZUWF9kG+4pC1h6AeDeWi7Q77TzrOX7VAP1UubFOPItRNayF99zCJH6ioh8qnHNi2XHedIagMW4PGLp6HmTuyhzdF6RVEXcCos2fpkx5wzcjALb/ffN8A0dqtfELRvs6bjaQZ1ktmNjd3fSnQOtGO14VOei8E58e4roZNdDHMoIxzeqaM+bphsTZvHne4DAZEn3wU2iguzXLZMCAgF336Inu+t2Rjv4UDLcPeppMrYA+02Ww0kbCXcIQx4Og0Un54SY5qdIHZtnTXA+SAFr+5r+T80p29Tlp9cUfxaHWFynDEEDWx7minAATweSQU50ipPnAkge1WY/ADSN1EARqM2GYVQYLvddIaTSIbnq37MnlncWL+jkcQ0cL83xidYd7JnQ7/gZJf9MzeZzMVXrY+2VYL1WOrv1uwmVi30bpQss1D7IVVtN5iBlB2ciph+iHdvkhv6f8ji9xZmWkotfDzsRoZg7csDAVgliz55QkJYKeWDoiW7kb1i+pIsgmrdEonPMg7NHjSqIIkrwI89016Tsx4LH1t2sRRYW8Z7wuVhW3VcJD+CnkhAWvLc= @@ -26,15 +21,6 @@ env: - secure: "BqpmNofWU38cV3eUT9Hm9wxiiRlp1LKl1JQBxvsYng/dk4L7ONiBVsrG6T7nYhkTktWc/II4ZAoQ7AGHN42W1quzSmc6d0fszQ7uTwNobfFQu2JzFNkhyP9D6b0v8uXhT8n6TPqOGgoJUcguStvasG3TuZwn7+PhwjyVfnzf+DhyaXjCljMatg7ekL0JDPGdAz/SQhuBiwk2xlZtxtEokNy7IVr9VcMi2O0nG3LMhCl1sQjo3JKBxPsalQi78dShDUHcazAE68T7M1FjAZCJYia902FMDWiIuujLamq+NpDgEKB3aLCLwF/o3j8z3ekPrk2v9Zokz+t36cQ2BmPpwqFfhvPdUv9tj9bi7Qv2R4NKreX8TWB8KB5afSVWiKfufWV5hp5KfwEmcLBc/hQdjRIwzDqVPK/fyy/GJ5fT4X5kz+YYLQEFxeWPtxL+OpQUXx2P5iDhx5qz173lO4h1WX4vEQ3p4aFbfnNREUDPGYsMJo6flm5Azq8F0qh065sxPldKunr9H4fAXrFzqMJnTepReEGPNJRn35TLl08RI7GTp0hKxlaycsu+c2Qz0/GcKbODWf5w24d/pxrOMM9KmJpDZTBm9bWiZlRbbZm1OnK0PiaRi9ft44Em5NYTFVvuWL2M2tIyGObI3kquKTkANvrSuPTofJ0JawXg2YBKOH8=" matrix: - exclude: - - php: 7.0 - env: COMPOSERFLAGS= - - php: 7.1 - env: COMPOSERFLAGS=--prefer-lowest - - php: 7.2 - env: COMPOSERFLAGS=--prefer-lowest - - php: nightly - env: COMPOSERFLAGS=--prefer-lowest allow_failures: - php: nightly @@ -45,10 +31,10 @@ deploy: - provider: script script: ci/deploy.sh on: - php: 7.1 + php: 7.4 all_branches: master - provider: script script: ci/deploy.sh on: - php: 7.1 + php: 7.4 tags: true diff --git a/Dockerfile b/Dockerfile index 483742c..0762663 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,16 @@ -FROM php:7.1-alpine +FROM php:7.4-alpine as builder + +COPY composer.json /dcv/composer.json +COPY composer.lock /dcv/composer.lock + +WORKDIR /dcv + +RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ + php composer-setup.php && \ + php -r "unlink('composer-setup.php');" && \ + php composer.phar install --prefer-dist + +FROM php:7.4-alpine RUN apk update && \ apk add graphviz ttf-dejavu && \ @@ -8,7 +20,7 @@ RUN apk update && \ COPY bin/ /dcv/bin COPY src/ /dcv/src -COPY vendor/ /dcv/vendor +COPY --from=builder /dcv/vendor /dcv/vendor RUN chmod +x /dcv/bin/dcv diff --git a/Makefile b/Makefile index c33f710..e75f6b6 100644 --- a/Makefile +++ b/Makefile @@ -24,17 +24,11 @@ clean: rm -rf vendor/ docker.lock: Dockerfile bin/entrypoint.sh vendor src/application.php src/functions.php - $(COMPOSER) dump-autoload --classmap-authoritative $(DOCKER) build -t $(DCV_IMAGE_NAME) . touch docker.lock -ifndef COMPOSERFLAGS vendor: composer.lock $(COMPOSER) install --prefer-dist -else -vendor: composer.lock - $(COMPOSER) update $(COMPOSERFLAGS) -endif composer.lock: composer.json $(COMPOSER) update $(COMPOSERFLAGS) diff --git a/README.md b/README.md index 304d7cf..488d518 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ This will generate the `docker-compose.png` file in the current working director Before you start, make sure you have: * [Composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx) installed, -* [PHP 7](http://php.net/downloads.php#v7.0.9) installed, +* [PHP 7.2](http://php.net/downloads.php#v7.2.32) (at least) installed, * GraphViz installed (see below for a guide on how to install it) ``` diff --git a/composer.json b/composer.json index 03e7e03..dc4dae5 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "pmsipilot/docker-compose-viz", "description": "Docker compose graph visualization", "require": { - "php": "^7", + "php": "^7.2", "symfony/yaml": "^3.1 || ^4", "symfony/console": "^3.1", "clue/graph": "^0.9", diff --git a/composer.lock b/composer.lock index 167dcbc..c2a23f3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e5370b9d4f890699543b1dbd6ba801de", + "content-hash": "b969fd3f88d63984295c01f8c964a703", "packages": [ { "name": "clue/graph", @@ -1721,7 +1721,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^7" + "php": "^7.2" }, "platform-dev": [] }