From 637a0cd0f4ddee2576cefd349dca334ad6e10cce Mon Sep 17 00:00:00 2001 From: Deon George Date: Mon, 30 Jan 2023 22:37:35 +1100 Subject: [PATCH] Change docker build to use alpine directly, with PHP and ldap module --- .gitlab-docker-x86_64.yml | 2 +- Dockerfile | 10 ---------- docker/Dockerfile | 10 ++++++++++ 3 files changed, 11 insertions(+), 11 deletions(-) delete mode 100644 Dockerfile create mode 100644 docker/Dockerfile diff --git a/.gitlab-docker-x86_64.yml b/.gitlab-docker-x86_64.yml index 2f2bd88..c0c71bf 100644 --- a/.gitlab-docker-x86_64.yml +++ b/.gitlab-docker-x86_64.yml @@ -27,6 +27,6 @@ docker: - if [ -f init ]; then chmod 500 init; fi - ([ -z "$REFRESH" ] && docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG}) || echo "true" - echo -n ${CI_COMMIT_SHORT_SHA} > VERSION - - docker build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} . + - docker build -f docker/Dockerfile --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} . - docker push ${CI_REGISTRY_IMAGE}:${VERSION} - docker push ${CI_REGISTRY_IMAGE}:${CACHETAG} diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index a129445..0000000 --- a/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM registry.leenooks.net/leenooks/php:8.0-fpm-latest - -COPY . /var/www/html/ - -RUN mkdir /var/www/.composer \ - && ([ -r auth.json ] && mv auth.json /var/www/.composer/) || true \ - && touch .composer.refresh \ - && mv .env.example .env \ - && FORCE_PERMS=1 /sbin/init \ - && rm -rf /var/www/.composer/* diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..722657c --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,10 @@ +FROM registry.dege.au/leenooks/php:8.1-fpm-alpine-ldap + +COPY . /var/www/html/ + +RUN mkdir -p ${COMPOSER_HOME} && \ + ([ -r auth.json ] && mv auth.json ${COMPOSER_HOME}) || true && \ + touch .composer.refresh && \ + mv .env.example .env && \ + FORCE_PERMS=1 NGINX_START=FALSE /sbin/init && \ + rm -rf ${COMPOSER_HOME}/*