Updated dockerfiles and updated .gitlab-ci.yml

This commit is contained in:
Netkas 2023-08-16 20:25:50 -04:00
parent 99e5961f9b
commit a64161e648
No known key found for this signature in database
GPG key ID: 5DAF58535614062B
3 changed files with 50 additions and 8 deletions

View file

@ -8,6 +8,7 @@ stages:
before_script:
- apt update -yqq
- apt install -yqq git libzip-dev zip make wget gnupg2 libonig-dev libcurl4-openssl-dev
- apt-get clean
# Prepare the environment
setup:
@ -31,6 +32,37 @@ build:
paths:
- build/*.tar.gz
# Build the Alpine Docker image
build-docker-alpine:
stage: build-docker
script:
- |
if [[ ! -z "$CI_COMMIT_TAG" ]]; then
DOCKER_TAG="$CI_COMMIT_TAG-alpine"
else
DOCKER_TAG="$CI_COMMIT_REF_SLUG-alpine"
fi
echo "Building Docker image with tag: $DOCKER_TAG"
docker build -f Dockerfile -t $CI_REGISTRY_IMAGE:$DOCKER_TAG .
docker push $CI_REGISTRY_IMAGE:$DOCKER_TAG
# Build the Debian Docker image
build-docker-debian:
stage: build-docker
script:
- |
if [[ ! -z "$CI_COMMIT_TAG" ]]; then
DOCKER_TAG="$CI_COMMIT_TAG-debian"
else
DOCKER_TAG="$CI_COMMIT_REF_SLUG-debian"
fi
echo "Building Docker image with tag: $DOCKER_TAG"
docker build -f Dockerfile.debian -t $CI_REGISTRY_IMAGE:$DOCKER_TAG .
docker push $CI_REGISTRY_IMAGE:$DOCKER_TAG
# Publish the package
publish:
stage: publish

View file

@ -22,7 +22,7 @@
# Builder stage: downloads necessary files and serves them on a silver platter.
#
FROM php:8.1-fpm AS builder
FROM php:8.2-fpm AS builder
WORKDIR /tmp
# Install some stuff the default image doesn't come with
@ -36,15 +36,18 @@ RUN wget -O phive.phar https://phar.io/releases/phive.phar;
gpg --verify phive.phar.asc phive.phar; \
rm phive.phar.asc; chmod +x phive.phar; ./phive.phar install phpab --global --trust-gpg-keys 0x2A8299CE842DD38C
# Copy the local repository to the image
COPY . /tmp/ncc
# Download the latest version of ncc (Nosial Code Compiler)
RUN git clone https://git.n64.cc/nosial/ncc.git; \
cd ncc; make redist
RUN cd /tmp/ncc && make redist
#
# Main stage: Copies downloaded files and installs all
#
FROM php:8.1-fpm-alpine
FROM php:8.2-fpm-alpine
# Add extensions
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

View file

@ -22,7 +22,7 @@
# Builder stage: downloads necessary files and serves them on a silver platter.
#
FROM php:8.1-fpm AS builder
FROM php:8.2-fpm AS builder
WORKDIR /tmp
# Install some stuff the default image doesn't come with
@ -36,15 +36,18 @@ RUN wget -O phive.phar https://phar.io/releases/phive.phar;
gpg --verify phive.phar.asc phive.phar; \
rm phive.phar.asc; chmod +x phive.phar; ./phive.phar install phpab --global --trust-gpg-keys 0x2A8299CE842DD38C
# Copy the local repository to the image
COPY . /tmp/ncc
# Download the latest version of ncc (Nosial Code Compiler)
RUN git clone https://git.n64.cc/nosial/ncc.git; \
cd ncc; make redist
RUN cd /tmp/ncc && make redist
#
# Main stage: Copies downloaded files and installs all
#
FROM php:8.1-fpm
FROM php:8.2-fpm
# Add extensions
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
@ -52,6 +55,10 @@ ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/do
# Copy downloaded files
COPY --from=builder /tmp/. .
# Install some stuff the default image doesn't come with
RUN apt update -yqq; \
apt install git libpq-dev libzip-dev zip make wget gnupg -yqq
# Install extensions required to run ncc
RUN install-php-extensions mbstring \
ctype \