From 8c967924e4084f17bb167a880d937ed95f9ecb13 Mon Sep 17 00:00:00 2001 From: jakobblume Date: Wed, 12 Dec 2018 05:48:00 +0100 Subject: [PATCH 1/4] added multistage dockerfile for installing composer dependencies into container --- Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 549a28fd..219796f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,21 @@ +FROM composer AS builder + +COPY ./ /app +RUN composer install + # Running this container will start a language server that listens for TCP connections on port 2088 # Every connection will be run in a forked child process # Please note that before building the image, you have to install dependencies with `composer install` FROM php:7-cli -MAINTAINER Felix Becker RUN docker-php-ext-configure pcntl --enable-pcntl RUN docker-php-ext-install pcntl COPY ./php.ini /usr/local/etc/php/conf.d/ -COPY ./ /srv/phpls +COPY --from=builder /app /srv/phpls WORKDIR /srv/phpls From 5298a3e41c1b85afbdb85bd98eaec7e27656a69d Mon Sep 17 00:00:00 2001 From: jakobblume Date: Wed, 12 Dec 2018 05:48:52 +0100 Subject: [PATCH 2/4] readded maintainer --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 219796f4..24b28b8f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,7 @@ RUN composer install # Please note that before building the image, you have to install dependencies with `composer install` FROM php:7-cli +MAINTAINER Felix Becker RUN docker-php-ext-configure pcntl --enable-pcntl RUN docker-php-ext-install pcntl From d7acf8b0bf302d7c5385c519ba6239c0647db5b5 Mon Sep 17 00:00:00 2001 From: jakobblume Date: Wed, 12 Dec 2018 05:49:44 +0100 Subject: [PATCH 3/4] deleted comment, that informs about required composer install --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 24b28b8f..a0c499ef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,8 +7,6 @@ RUN composer install # Running this container will start a language server that listens for TCP connections on port 2088 # Every connection will be run in a forked child process -# Please note that before building the image, you have to install dependencies with `composer install` - FROM php:7-cli MAINTAINER Felix Becker From c76264faa2ac3d81bb2ce42586f85d95ffdb1742 Mon Sep 17 00:00:00 2001 From: jakobblume Date: Wed, 12 Dec 2018 16:00:56 +0100 Subject: [PATCH 4/4] moved comments to top of the file and updated deprecated maintainer instruction with appropriate label --- Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index a0c499ef..c11b756e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,13 @@ +# Running this container will start a language server that listens for TCP connections on port 2088 +# Every connection will be run in a forked child process FROM composer AS builder COPY ./ /app RUN composer install -# Running this container will start a language server that listens for TCP connections on port 2088 -# Every connection will be run in a forked child process - FROM php:7-cli -MAINTAINER Felix Becker +LABEL maintainer="Felix Becker " RUN docker-php-ext-configure pcntl --enable-pcntl RUN docker-php-ext-install pcntl