From e266319386987316096a8908d0dc77ce50744ff3 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sat, 4 Feb 2023 21:31:13 +1100 Subject: [PATCH] Set COMPOSER_HOME and define VOLUMEs --- .gitlab-docker-manifest.yml | 3 ++- Dockerfile | 3 ++- docker/init | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitlab-docker-manifest.yml b/.gitlab-docker-manifest.yml index 69ec575..6db77ab 100644 --- a/.gitlab-docker-manifest.yml +++ b/.gitlab-docker-manifest.yml @@ -4,8 +4,9 @@ x86_64:build-manifest: - docker manifest create ${CI_REGISTRY_IMAGE}:${VERSION} ${CI_REGISTRY_IMAGE}:${VERSION}-armv7l ${CI_REGISTRY_IMAGE}:${VERSION}-x86_64 ${CI_REGISTRY_IMAGE}:${VERSION}-arm64 - docker manifest push --purge ${CI_REGISTRY_IMAGE}:${VERSION} - apk add --no-cache curl + - echo curl -LX POST --post301 -F token=${TRIGGER_TOKEN} -F ref=pgsql ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/trigger/pipeline - curl -LX POST --post301 -F token=${TRIGGER_TOKEN} -F ref=pgsql ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/trigger/pipeline - - curl -LX POST --post301 -F token=${TRIGGER_TOKEN} -F ref=ldap ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/trigger/pipeline + - curl -LX POST --post301 -F token=${TRIGGER_TOKEN} -F ref=mysql ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/trigger/pipeline - curl -LX POST --post301 -F token=${TRIGGER_TOKEN} -F ref=ldap ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/trigger/pipeline tags: - docker diff --git a/Dockerfile b/Dockerfile index ea9fff8..eb38eda 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,9 +34,9 @@ RUN apk add --no-cache libjpeg libgd libpng freetype freetype-dev zlib-dev libpn docker-php-ext-install -j$(nproc) gd && \ apk del --no-cache zlib-dev libpng-dev jpeg-dev freetype-dev -RUN ip addr list && env # Add composer RUN curl -4 https://getcomposer.org/installer|php -- --install-dir=/usr/local/bin --filename=composer +ENV COMPOSER_HOME=/var/cache/composer COPY docker/www.conf /usr/local/etc/php-fpm.d/ COPY docker/nginx-app.conf /etc/nginx/http.d/default.conf @@ -44,6 +44,7 @@ COPY docker/nginx-app.conf /etc/nginx/http.d/default.conf COPY docker/init /sbin/ RUN chmod 550 /sbin/init && chown 0:0 /sbin/init +VOLUME [ "/var/cache/composer" ] WORKDIR /var/www/html EXPOSE 80 ENTRYPOINT [ "/sbin/init" ] diff --git a/docker/init b/docker/init index db888e0..780688c 100755 --- a/docker/init +++ b/docker/init @@ -4,7 +4,7 @@ set -e role=${CONTAINER_ROLE:-app} env=${APP_ENV:-live} php=${PHP_DIR:-/var/www/html} -composer=${COMPOSER_DIR:-/var/www/.composer} +composer=${COMPOSER_HOME:-/var/cache/composer} SITE_USER=${SITE_USER:-www-data} NGINX_START=${NGINX_START:-TRUE}