Change docker build to use alpine directly, with PHP and ldap module

This commit is contained in:
Deon George 2023-01-30 22:37:35 +11:00
parent 482d9670e3
commit 637a0cd0f4
3 changed files with 11 additions and 11 deletions

View File

@ -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}

View File

@ -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/*

10
docker/Dockerfile Normal file
View File

@ -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}/*