From 5f1f8b3b438459a60f0f5e3c4ec4c24c465f3e69 Mon Sep 17 00:00:00 2001 From: Alexandre BRACH Date: Fri, 18 Oct 2019 16:09:08 +0200 Subject: [PATCH] kubernetes #comment add composer in the fpm/worker images --- Dockerfile | 5 +++++ README.md | 14 ++++++-------- build.sh | 11 +++++++++++ 3 files changed, 22 insertions(+), 8 deletions(-) create mode 100755 build.sh diff --git a/Dockerfile b/Dockerfile index 00ef2acfdc..ca4e87b204 100644 --- a/Dockerfile +++ b/Dockerfile @@ -141,6 +141,11 @@ RUN apt-get update \ && docker-php-source delete \ && rm -rf /var/lib/apt/lists/* +RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ + && php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \ + && php composer-setup.php --install-dir=/usr/local/bin --filename=composer \ + && php -r "unlink('composer-setup.php');" + RUN mkdir /entrypoint /var/alchemy \ && useradd -u 1000 app \ && mkdir -p /home/app/.composer \ diff --git a/README.md b/README.md index 9fb4237d25..fb4b34870d 100644 --- a/README.md +++ b/README.md @@ -63,14 +63,12 @@ The docker distribution come with 3 differents containers : ## How to build -The three images can be built respectively with these commands : +You can build all the images with the following command at the root directory : - # nginx server - docker build --target phraseanet-nginx -t local/phraseanet-nginx . + ./build - # php-fpm application - docker build --target phraseanet-fpm -t local/phraseanet-fpm . - - # worker - docker build --target phraseanet-worker -t local/phraseanet-worker . +It will build and tag the following images : + local/phraseanet-worker: + local/phraseanet-fpm: + local/phraseanet-nginx: diff --git a/build.sh b/build.sh new file mode 100755 index 0000000000..0f983ccac4 --- /dev/null +++ b/build.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# nginx server +docker build --target phraseanet-nginx -t local/phraseanet-nginx:$1 . + +# php-fpm application +docker build --target phraseanet-fpm -t local/phraseanet-fpm:$1 . + +# worker +docker build --target phraseanet-worker -t local/phraseanet-worker:$1 . +