Skip to content

Commit

Permalink
upgrade to php 8.3, add pipeline to build image, update php extensions
Browse files Browse the repository at this point in the history
Signed-off-by: Pascal Sthamer <[email protected]>
  • Loading branch information
P4sca1 committed Nov 18, 2024
1 parent b53c5cb commit ad33a24
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 23 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "Build php-fpm image"

on:
schedule:
- cron: 0 0 * * 0

push:
branches:
- main

env:
PHP_VERSION: "8.3"

jobs:
build-and-deploy:
name: Build and push Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
build-args: |
PHP_VERSION={{ env.PHP_VERSION }}
tags: >-
ghcr.io/Einfach-Gaming/php-fpm:{{ env.PHP_VERSION }}
29 changes: 6 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
FROM php:7.4-fpm-alpine
ARG PHP_VERSION=8.1

# Install required packages.
RUN apk add --update --no-cache \
freetype-dev \
libjpeg-turbo-dev \
libpng-dev \
libzip-dev \
autoconf \
g++ \
make
FROM php:${PHP_VERSION}-fpm

# Configure gd to support jpeg.
RUN docker-php-ext-configure gd --with-jpeg
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

# Install PHP extensions.
RUN docker-php-ext-install pdo_mysql gd bcmath mysqli zip exif

# Install PHP Redis.
RUN docker-php-source extract && \
pecl install redis && \
docker-php-ext-enable redis && \
docker-php-source delete

# Remove packages only required for building.
RUN apk del g++ make
# Install required PHP extensions
# https://manual.woltlab.com/en/requirements/
RUN install-php-extensions ctype dom exif gmp intl libxml mbstring openssl pdo pdo_mysql zlib imagick

0 comments on commit ad33a24

Please sign in to comment.