Skip to content

Commit bd9e77d

Browse files
committed
first commit
0 parents  commit bd9e77d

23 files changed

+1148
-0
lines changed

.github/dependabot.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 10

.github/workflows/build-push.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Build and push
2+
3+
permissions:
4+
contents: read
5+
packages: write
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
schedule:
12+
- cron: '30 2 * * SUN'
13+
14+
jobs:
15+
build-and-push:
16+
uses: ./.github/workflows/docker.yml
17+
secrets: inherit

.github/workflows/check.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Checks
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
uses: ./.github/workflows/docker.yml
12+
secrets: inherit
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Container Registry Cleanup
2+
3+
permissions:
4+
contents: read
5+
packages: write
6+
7+
on:
8+
workflow_dispatch:
9+
schedule:
10+
- cron: '30 2 * * MON'
11+
12+
jobs:
13+
untagged-cleanup:
14+
uses: "tweedegolf/actions-container-helpers/.github/workflows/container-untagged-cleanup.yml@main"
15+
with:
16+
package: php

.github/workflows/docker-images.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Docker
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
php_version:
7+
type: string
8+
latest:
9+
type: boolean
10+
composer_version:
11+
type: string
12+
debian_version:
13+
type: string
14+
postgresql_version:
15+
type: string
16+
17+
jobs:
18+
base:
19+
uses: "tweedegolf/actions-container-helpers/.github/workflows/container-image.yml@main"
20+
with:
21+
context: "${{ inputs.php_version }}"
22+
push: ${{ github.ref == 'refs/heads/main' }}
23+
platforms: "linux/amd64,linux/arm64"
24+
build-args: |
25+
DEBIAN_VERSION=${{ inputs.debian_version }}
26+
POSTGRESQL_VERSION=${{ inputs.postgresql_version }}
27+
COMPOSER_VERSION=${{ inputs.composer_version }}
28+
tags: |
29+
ghcr.io/tweedegolf/php:${{inputs.php_version}}
30+
${{ inputs.latest && 'ghcr.io/tweedegolf/php:latest' || '' }}
31+
32+
dev:
33+
needs: [base]
34+
uses: "tweedegolf/actions-container-helpers/.github/workflows/container-image.yml@main"
35+
with:
36+
context: "${{ inputs.php_version }}"
37+
file: Dockerfile.dev
38+
push: ${{ github.ref == 'refs/heads/main' }}
39+
platforms: "linux/amd64,linux/arm64"
40+
tags: |
41+
ghcr.io/tweedegolf/php:${{inputs.php_version}}-dev
42+
${{ inputs.latest && 'ghcr.io/tweedegolf/php:latest-dev' || '' }}
43+
44+
debug:
45+
needs: [dev]
46+
uses: "tweedegolf/actions-container-helpers/.github/workflows/container-image.yml@main"
47+
with:
48+
context: "${{ inputs.php_version }}"
49+
file: Dockerfile.debug
50+
push: ${{ github.ref == 'refs/heads/main' }}
51+
platforms: "linux/amd64,linux/arm64"
52+
tags: |
53+
ghcr.io/tweedegolf/php:${{inputs.php_version}}-debug
54+
${{ inputs.latest && 'ghcr.io/tweedegolf/php:latest-debug' || '' }}

.github/workflows/docker.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Docker
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build:
8+
strategy:
9+
matrix:
10+
include:
11+
- php_version: 8.3
12+
latest: true
13+
- php_version: 8.2
14+
latest: false
15+
uses: "./.github/workflows/docker-images.yml"
16+
with:
17+
php_version: ${{ matrix.php_version }}
18+
latest: ${{ matrix.latest }}
19+
debian_version: bookworm
20+
postgresql_version: "16"
21+
composer_version: "2.7.4"

.gitlab-ci.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
stages:
2+
- build
3+
4+
default:
5+
tags: [ubuntu22.04]
6+
7+
before_script:
8+
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
9+
- docker buildx create --use
10+
- export DOCKER_BUILDKIT=1
11+
- export POSTGRESQL_VERSION=15
12+
- export COMPOSER_VERSION=2.6.5
13+
- export NODE_VERSION=18
14+
15+
build:image:8.2:
16+
stage: build
17+
script:
18+
- export PHP_VERSION=8.2
19+
- docker buildx build --push --platform linux/amd64 "$PHP_VERSION/" -f "$PHP_VERSION/Dockerfile" --no-cache --pull --build-arg COMPOSER_VERSION --build-arg POSTGRESQL_VERSION -t "$CI_REGISTRY_IMAGE:$PHP_VERSION" -t "$CI_REGISTRY_IMAGE:8" -t "$CI_REGISTRY_IMAGE:latest"
20+
- docker buildx build --push --platform linux/amd64 "$PHP_VERSION/" -f "$PHP_VERSION/Dockerfile.dev" --no-cache --pull --build-arg "BASE_IMAGE=$CI_REGISTRY_IMAGE:$PHP_VERSION" -t "$CI_REGISTRY_IMAGE:$PHP_VERSION-dev" -t "$CI_REGISTRY_IMAGE:8-dev" -t "$CI_REGISTRY_IMAGE:latest-dev"
21+
- docker buildx build --push --platform linux/amd64 "$PHP_VERSION/" -f "$PHP_VERSION/Dockerfile.debug" --no-cache --pull --build-arg "BASE_IMAGE=$CI_REGISTRY_IMAGE:$PHP_VERSION-dev" -t "$CI_REGISTRY_IMAGE:$PHP_VERSION-debug" -t "$CI_REGISTRY_IMAGE:8-debug" -t "$CI_REGISTRY_IMAGE:latest-debug"
22+
- docker buildx build --push --platform linux/amd64 "$PHP_VERSION/" -f "$PHP_VERSION/Dockerfile.fat" --no-cache --pull --build-arg NODE_VERSION --build-arg "BASE_IMAGE=$CI_REGISTRY_IMAGE:$PHP_VERSION" -t "$CI_REGISTRY_IMAGE:$PHP_VERSION-fat" -t "$CI_REGISTRY_IMAGE:8-fat" -t "$CI_REGISTRY_IMAGE:latest-fat"
23+
- docker buildx build --push --platform linux/amd64 "$PHP_VERSION/" -f "$PHP_VERSION/Dockerfile.dev" --no-cache --pull --build-arg "BASE_IMAGE=$CI_REGISTRY_IMAGE:$PHP_VERSION-fat" -t "$CI_REGISTRY_IMAGE:$PHP_VERSION-fat-dev" -t "$CI_REGISTRY_IMAGE:8-fat-dev" -t "$CI_REGISTRY_IMAGE:latest-fat-dev"
24+
- docker buildx build --push --platform linux/amd64 "$PHP_VERSION/" -f "$PHP_VERSION/Dockerfile.debug" --no-cache --pull --build-arg "BASE_IMAGE=$CI_REGISTRY_IMAGE:$PHP_VERSION-fat-dev" -t "$CI_REGISTRY_IMAGE:$PHP_VERSION-fat-debug" -t "$CI_REGISTRY_IMAGE:8-fat-debug" -t "$CI_REGISTRY_IMAGE:latest-fat-debug"
25+
26+
build:image:8.1:
27+
stage: build
28+
script:
29+
- export PHP_VERSION=8.1
30+
- docker buildx build --push --platform linux/amd64 "$PHP_VERSION/" -f "$PHP_VERSION/Dockerfile" --no-cache --pull --build-arg COMPOSER_VERSION --build-arg POSTGRESQL_VERSION -t "$CI_REGISTRY_IMAGE:$PHP_VERSION"
31+
- docker buildx build --push --platform linux/amd64 "$PHP_VERSION/" -f "$PHP_VERSION/Dockerfile.dev" --no-cache --pull --build-arg "BASE_IMAGE=$CI_REGISTRY_IMAGE:$PHP_VERSION" -t "$CI_REGISTRY_IMAGE:$PHP_VERSION-dev"
32+
- docker buildx build --push --platform linux/amd64 "$PHP_VERSION/" -f "$PHP_VERSION/Dockerfile.debug" --no-cache --pull --build-arg "BASE_IMAGE=$CI_REGISTRY_IMAGE:$PHP_VERSION-dev" -t "$CI_REGISTRY_IMAGE:$PHP_VERSION-debug"
33+
- docker buildx build --push --platform linux/amd64 "$PHP_VERSION/" -f "$PHP_VERSION/Dockerfile.fat" --no-cache --pull --build-arg NODE_VERSION --build-arg "BASE_IMAGE=$CI_REGISTRY_IMAGE:$PHP_VERSION" -t "$CI_REGISTRY_IMAGE:$PHP_VERSION-fat"
34+
- docker buildx build --push --platform linux/amd64 "$PHP_VERSION/" -f "$PHP_VERSION/Dockerfile.dev" --no-cache --pull --build-arg "BASE_IMAGE=$CI_REGISTRY_IMAGE:$PHP_VERSION-fat" -t "$CI_REGISTRY_IMAGE:$PHP_VERSION-fat-dev"
35+
- docker buildx build --push --platform linux/amd64 "$PHP_VERSION/" -f "$PHP_VERSION/Dockerfile.debug" --no-cache --pull --build-arg "BASE_IMAGE=$CI_REGISTRY_IMAGE:$PHP_VERSION-fat-dev" -t "$CI_REGISTRY_IMAGE:$PHP_VERSION-fat-debug"
36+
37+
build:image:8.0:
38+
stage: build
39+
script:
40+
- export PHP_VERSION=8.0
41+
- docker buildx build --push --platform linux/amd64 "$PHP_VERSION/" -f "$PHP_VERSION/Dockerfile" --no-cache --pull --build-arg COMPOSER_VERSION --build-arg POSTGRESQL_VERSION -t "$CI_REGISTRY_IMAGE:$PHP_VERSION"
42+
- docker buildx build --push --platform linux/amd64 "$PHP_VERSION/" -f "$PHP_VERSION/Dockerfile.dev" --no-cache --pull --build-arg "BASE_IMAGE=$CI_REGISTRY_IMAGE:$PHP_VERSION" -t "$CI_REGISTRY_IMAGE:$PHP_VERSION-dev"
43+
- docker buildx build --push --platform linux/amd64 "$PHP_VERSION/" -f "$PHP_VERSION/Dockerfile.debug" --no-cache --pull --build-arg "BASE_IMAGE=$CI_REGISTRY_IMAGE:$PHP_VERSION-dev" -t "$CI_REGISTRY_IMAGE:$PHP_VERSION-debug"
44+
- docker buildx build --push --platform linux/amd64 "$PHP_VERSION/" -f "$PHP_VERSION/Dockerfile.fat" --no-cache --pull --build-arg NODE_VERSION --build-arg "BASE_IMAGE=$CI_REGISTRY_IMAGE:$PHP_VERSION" -t "$CI_REGISTRY_IMAGE:$PHP_VERSION-fat"
45+
- docker buildx build --push --platform linux/amd64 "$PHP_VERSION/" -f "$PHP_VERSION/Dockerfile.dev" --no-cache --pull --build-arg "BASE_IMAGE=$CI_REGISTRY_IMAGE:$PHP_VERSION-fat" -t "$CI_REGISTRY_IMAGE:$PHP_VERSION-fat-dev"
46+
- docker buildx build --push --platform linux/amd64 "$PHP_VERSION/" -f "$PHP_VERSION/Dockerfile.debug" --no-cache --pull --build-arg "BASE_IMAGE=$CI_REGISTRY_IMAGE:$PHP_VERSION-fat-dev" -t "$CI_REGISTRY_IMAGE:$PHP_VERSION-fat-debug"

8.2/Dockerfile

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
ARG DEBIAN_VERSION
2+
FROM ghcr.io/tweedegolf/debian:${DEBIAN_VERSION}
3+
4+
# Install postgresql client
5+
ARG POSTGRESQL_VERSION
6+
ENV POSTGRESQL_VERSION ${POSTGRESQL_VERSION}
7+
RUN curl -s -L https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
8+
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
9+
&& apt-get update \
10+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
11+
postgresql-client-$POSTGRESQL_VERSION \
12+
&& rm -rf /var/lib/apt/lists/*
13+
14+
# Install the custom PHP repository
15+
ENV PHP_VERSION 8.2
16+
RUN curl -s -L https://packages.sury.org/php/apt.gpg | apt-key add - \
17+
&& echo "deb https://packages.sury.org/php/ bookworm main" > /etc/apt/sources.list.d/sury_php.list \
18+
&& apt-get update \
19+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
20+
php${PHP_VERSION}-bcmath \
21+
php${PHP_VERSION}-cli \
22+
php${PHP_VERSION}-common \
23+
php${PHP_VERSION}-curl \
24+
php${PHP_VERSION}-dev \
25+
php${PHP_VERSION}-enchant \
26+
php${PHP_VERSION}-fpm \
27+
php${PHP_VERSION}-gd \
28+
php${PHP_VERSION}-gmp \
29+
php${PHP_VERSION}-intl \
30+
php${PHP_VERSION}-mbstring \
31+
php${PHP_VERSION}-mysql \
32+
php${PHP_VERSION}-odbc \
33+
php${PHP_VERSION}-opcache \
34+
php${PHP_VERSION}-pgsql \
35+
php${PHP_VERSION}-soap \
36+
php${PHP_VERSION}-sqlite3 \
37+
php${PHP_VERSION}-tidy \
38+
php${PHP_VERSION}-xml \
39+
php${PHP_VERSION}-xsl \
40+
php${PHP_VERSION}-zip \
41+
php${PHP_VERSION}-apcu \
42+
php${PHP_VERSION}-ast \
43+
php${PHP_VERSION}-imagick \
44+
php${PHP_VERSION}-memcache \
45+
php${PHP_VERSION}-memcached \
46+
php${PHP_VERSION}-redis \
47+
php-pear \
48+
&& rm -rf /var/lib/apt/lists/*
49+
COPY php-fpm.conf /etc/php/${PHP_VERSION}/fpm/php-fpm.conf
50+
COPY php.ini /etc/php/${PHP_VERSION}/fpm/php.ini
51+
COPY php.ini /etc/php/${PHP_VERSION}/cli/php.ini
52+
53+
# Install composer
54+
ARG COMPOSER_VERSION
55+
ENV COMPOSER_VERSION ${COMPOSER_VERSION}
56+
RUN curl -L -s -o /usr/local/bin/composer https://getcomposer.org/download/$COMPOSER_VERSION/composer.phar \
57+
&& chmod a+x /usr/local/bin/composer
58+
59+
CMD [ "/usr/sbin/php-fpm8.2" ]
60+
EXPOSE 9000

8.2/Dockerfile.debug

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM ghcr.io/tweedegolf/php:8.2-dev
2+
3+
ENV PHP_VERSION 8.2
4+
RUN apt-get update \
5+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
6+
php${PHP_VERSION}-xdebug \
7+
&& rm -rf /var/lib/apt/lists/*
8+
9+
COPY xdebug.ini /etc/php/${PHP_VERSION}/mods-available/xdebug.ini

8.2/Dockerfile.dev

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM ghcr.io/tweedegolf/php:8.2
2+
3+
COPY php-dev.ini /etc/php/${PHP_VERSION}/fpm/php.ini
4+
COPY php-dev.ini /etc/php/${PHP_VERSION}/cli/php.ini

0 commit comments

Comments
 (0)