Updated to use new alpine image

This commit is contained in:
Deon George 2023-02-04 20:17:53 +11:00
parent 6a4382b0f4
commit 334c040d81
3 changed files with 34 additions and 31 deletions

View File

@ -1,14 +1,14 @@
stages: stages:
# - test # test
- build - build
# This folder is cached between builds # This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache # http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache: cache:
key: ${CI_COMMIT_REF_SLUG} key: ${CI_JOB_NAME_SLUG}-${CI_COMMIT_REF_SLUG}
paths: paths:
- vendor/ - vendor/
include: include:
# - .gitlab-test.yml # .gitlab-test.yml
- .gitlab-docker-x86_64.yml - .gitlab-docker-x86_64.yml

View File

@ -1,33 +1,30 @@
docker: docker:
image: docker:latest variables:
VERSION: latest
DOCKER_HOST: tcp://docker:2375
stage: build stage: build
image: docker:latest
services: services:
- docker:dind - docker:dind
variables:
VERSION: latest
CACHETAG: build-${VERSION}
DOCKER_HOST: tcp://docker:2375
tags:
- docker
- x86_64
only:
- master
before_script: before_script:
- docker info - docker info && docker version
- docker version - echo "$CI_JOB_TOKEN" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin
- echo "$CI_JOB_TOKEN" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin - if [ -n "$GITHUB_TOKEN" ]; then cat $GITHUB_TOKEN |base64 -d > auth.json; fi
- if [ -n "$GITHUB_TOKEN" ]; then cat $GITHUB_TOKEN |base64 -d > auth.json; fi
script: script:
- if [ -f init ]; then chmod 500 init; fi - if [ ! -d docker ]; then mkdir docker; fi
- ([ -z "$REFRESH" ] && docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG}) || echo "true" - if [ -f init ]; then chmod 500 init; fi
- echo -n ${CI_COMMIT_SHORT_SHA} > VERSION - ([ -z "$REFRESH" -a -f docker/${CI_COMMIT_REF_SLUG} ]) && docker load < docker/${CI_COMMIT_REF_SLUG} || true
- rm -rf vendor/ database/schema database/seeders database/factories/* - 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} . - rm -rf vendor/ database/schema database/seeders database/factories/*
- docker push ${CI_REGISTRY_IMAGE}:${VERSION} - docker build --cache-from ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${VERSION} .
- docker push ${CI_REGISTRY_IMAGE}:${CACHETAG} - docker push ${CI_REGISTRY_IMAGE}:${VERSION}
- docker save ${CI_REGISTRY_IMAGE}:${VERSION} > docker/${CI_COMMIT_REF_SLUG}
tags:
- docker
- x86_64
only:
- master

View File

@ -1,5 +1,11 @@
FROM registry.leenooks.net/leenooks/php:8.0-fpm-latest FROM registry.dege.au/leenooks/php:8.1-fpm-alpine
COPY . /var/www/html/ 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/* && touch .migrate && chmod g+w database 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/* && \
touch .migrate && chmod g+w database