Skip to content

Commit 3f23b3d

Browse files
jaydrogersskylerkatzalexjustesen
authored
Release 2.0: PHP 8.2, Ubuntu 22.04, major re-structure & cleanup (#59)
* Cleaned up comments * Added Multi-arch support * Fixed tage reference * Removed quotes * Optimized development script * Upgraded development to Docker Buildx * Added upstream support * Added QEMU * Added BuildX to production pipeline * Added platforms * Removed rare platforms * Added base ubuntu version * Re-added upstream channel * Simplified development process * Changed S6 Overlay commands to /command * Refactored to standardized name of 'src' and 'dist' * Updated warning * Changed source and dist directories * Clarified template location * Added Ubuntu version support * Updated commands to be compatible with S6 Overlay v3.x * Updated note to 'dist' folder * Changed to 'dist' folder * Centralized workflows * Removed requirement on calling ubuntu base versions * Removed null variable * Removed unused run command * Set scripts to executable * Separated build jobs * Added job dependencies * Added quotes * Changed variables to global * Escaped variables * Removed environment variables * Make services executable * Updated all services to be executable * Updated to bash * Added CHMOD at Docker image level * Fixed PHP variation * Remove php_admin flags. Fixes #45 * Set security settings to admin flags * Added PHP_OPEN_BASEDIR. Fixes #52. Thanks to @herpaderpaldent * add php intl package to support laravel email validation rules * Completed build for "int" package (ref #56) * Added Composer variables * added phpx.x-bcmath Added `-bcmath` package for php `7.4`, `8.0` and `8.1` as it's a server requirement for Laravel https://laravel.com/docs/9.x/deployment#server-requirements * Updated README to mermaid * Upgraded to Ubuntu 22.04 * Updated Ubuntu version to be dynamic * Added Matrix to workflow * Updated all references to 22.04 * Restored matrix jobs to be by version only * Restored base Ubuntu version * Fixed order of service execution * Converted to new S6 Overlay format * Reset build numbers * Configured working S6 overlay service in new format * Decreased verbosity * Converted runas-user to oneshot * Converted Laravel Automations to new S6 Overlay methods * Allow versions to be passed to the build command * Converted Apache to new S6 Overlay standard * Added S6 verbosity * Updated NGINX to S6 overlay standard * Converted services to S6 overlay standards * Add Readiness Checks (#75) Add Readiness Checks * Adjusted upstream names * Removed debugging * Adjusted to multi-stage build * Removed wget * Adjusted repo config * Fixed dependency issues * Cleanup/remove templating (#77) * Removed build files * Removed yasha dependency * Removed variables * FPM not working * Fixed PHP-FPM reference * Fixed version reference * Static reference to PHP * Adjusted to listen on TCP only * Added healthcheck * Updated actions to new standard * Clarified Docker Desktop * Adjusted version to run from the matrix * Added ca-certificates to repo-config stage * FIxed READMEs * Fixed README * Add PHP 8.2 Support (#78) * Added 8.2 to security policy * Added images * Added 8.2 * Clarified directory * Alphabetized packages * Removed php-redis (package not found) * Allow SSL settings to be configured with "SSL_MODE" (#79) * Added warning about PHP 8.2 * Tidy up scripts * Enhanced healthcheck script * Added documentation for SSL * Moved cloudflare IPs to standalone file * Removed default site * Updated SSL generator for NGINX * Set execution order for best UX * Added SSL_MODE support for NGINX * Improved UX on check script * Improved UX of service startup * Set sleep delay for Apache * Added SSL_MODE support script * Remove old config * Added Apache configuration support for SSL_MODE * Removed redundant exec keyword * Disable S6 service timeouts (Fixes #81) * Set the webuser via S6 Overlay's method * Change production images to only be run on releases * Revert "Change production images to only be run on releases" This reverts commit b94f201. * Cleaned up comments * Upgraded Github Actions to latest versions * Added sponsors workflow * Updated to latest tj-actions/branch-names Co-authored-by: Skyler Katz <[email protected]> Co-authored-by: Alex Justesen <[email protected]>
1 parent be20cc2 commit 3f23b3d

File tree

205 files changed

+1031
-4456
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+1031
-4456
lines changed

.git-config/hooks/pre-commit

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/dependency-diagram.png

-10.2 KB
Binary file not shown.
Lines changed: 34 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,44 @@
11
name: Docker Publish (Beta Images)
22

33
on:
4-
# When changes are pushed to the "dev" branch, run it
54
push:
65
branches:
76
- dev
8-
9-
# Run every week at 0800 UTC to update the images
107
schedule:
118
- cron: '0 8 * * 1'
129

1310
jobs:
14-
push:
15-
runs-on: ubuntu-20.04
16-
17-
# Configure our deployment strategy. Order is important here and we want it to go: CLI < FPM < FPM-NGINX
18-
strategy:
19-
# We want to limit the number of jobs to the number of versions that we're offering (since we want the dependency order to be built correctly)
20-
max-parallel: 3
21-
# Set our base image and versions here
22-
matrix:
23-
####################################################################################################################
24-
# Possibly delete this "base-image" thing. (See https://github.com/serversideup/docker-php/issues/8)
25-
####################################################################################################################
26-
# base-image:
27-
# - ubuntu:20.04
28-
php-variation:
29-
- cli
30-
- fpm
31-
- fpm-nginx
32-
- fpm-apache
33-
php-version:
34-
- "7.4"
35-
- "8.0"
36-
- "8.1"
37-
38-
steps:
39-
- uses: actions/checkout@v2
40-
with:
41-
ref: dev
42-
43-
- name: Login to DockerHub
44-
uses: docker/login-action@v1
45-
with:
46-
username: ${{ secrets.DOCKER_HUB_USERNAME }}
47-
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
48-
49-
####################################################################
50-
# Commenting this out for further testing & structure (See https://github.com/serversideup/docker-php/issues/8)
51-
####################################################################
52-
# - name: Cache base image digest
53-
# uses: actions/cache@v2
54-
# with:
55-
# path: ${{ runner.temp }}/.base-image-digest
56-
# key: base-image-digest
57-
58-
# - name: Read cached base image digest
59-
# id: cached-base-image-digest
60-
# run: |
61-
# touch "${{ runner.temp }}/.base-image-digest"
62-
# echo "::set-output name=sha256::$(head -n 1 "${{ runner.temp }}/.base-image-digest")"
63-
64-
# - name: Pull base image
65-
# run: docker pull ${{ matrix.base-image }}
66-
67-
# - name: Set base image digest
68-
# id: base-image-digest
69-
# run: echo "::set-output name=sha256::$(docker inspect --format='{{index .RepoDigests 0}}' ${{ matrix.base-image }})"
70-
71-
# - name: Build image
72-
# if: steps.base-image-digest.outputs.sha256 != steps.cached-base-image-digest.outputs.sha256
73-
# run: docker build php/${{ matrix.php-version }}/. --tag serversideup/php:${{ matrix.php-version }}
74-
75-
# - name: Push image to DockerHub
76-
# if: steps.base-image-digest.outputs.sha256 != steps.cached-base-image-digest.outputs.sha256
77-
# run: docker push serversideup/php:${{ matrix.php-version }}
78-
79-
# - name: Update base image digest cache
80-
# run: |
81-
# echo "${{ steps.base-image-digest.outputs.sha256 }}" >"${{ runner.temp }}/.base-image-digest"
82-
####################################################################
83-
84-
- name: Build and tag image
85-
run: docker build --build-arg UPSTREAM_CHANNEL="beta-" --pull generated-dockerfiles/${{ matrix.php-version }}/${{ matrix.php-variation }}/. --tag serversideup/php:beta-${{ matrix.php-version }}-${{ matrix.php-variation }}
86-
87-
- name: Push version image to DockerHub
88-
run: docker push serversideup/php:beta-${{ matrix.php-version }}-${{ matrix.php-variation }}
89-
90-
##################################################
91-
# Commenting this out until further notice
92-
##################################################
93-
# trigger_downstream_jobs:
94-
# needs: push
95-
# runs-on: ubuntu-20.04
96-
# steps:
97-
# - name: Trigger downstream builds
98-
# run: curl --fail --output "/dev/null" --silent --show-error -X POST -F token=${{ secrets.DOWNSTREAM_BUILD_TOKEN }} -F ref=$GITHUB_REF ${{ secrets.DOWNSTREAM_BUILD_WEBHOOK_ENDPOINT }}
11+
cli:
12+
uses: ./.github/workflows/workflow-docker-publish.yml
13+
with:
14+
upstream-channel-prefix: "beta-"
15+
tag-prefix: "beta-"
16+
php-variation: cli
17+
secrets: inherit
18+
19+
fpm:
20+
needs: cli
21+
uses: ./.github/workflows/workflow-docker-publish.yml
22+
with:
23+
upstream-channel-prefix: "beta-"
24+
tag-prefix: "beta-"
25+
php-variation: fpm
26+
secrets: inherit
27+
28+
fpm-nginx:
29+
needs: fpm
30+
uses: ./.github/workflows/workflow-docker-publish.yml
31+
with:
32+
upstream-channel-prefix: "beta-"
33+
tag-prefix: "beta-"
34+
php-variation: fpm-nginx
35+
secrets: inherit
36+
37+
fpm-apache:
38+
needs: fpm
39+
uses: ./.github/workflows/workflow-docker-publish.yml
40+
with:
41+
upstream-channel-prefix: "beta-"
42+
tag-prefix: "beta-"
43+
php-variation: fpm-apache
44+
secrets: inherit
Lines changed: 33 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,54 @@
11
name: Docker Publish (Production Images)
22

33
on:
4-
# When changes are pushed to the "main" branch, run it
54
push:
65
branches:
76
- main
8-
9-
# Run every week at 0800 UTC to update the images
107
schedule:
118
- cron: '0 8 * * 2'
129

1310
jobs:
14-
push:
15-
runs-on: ubuntu-20.04
11+
cli:
12+
uses: ./.github/workflows/workflow-docker-publish.yml
13+
with:
14+
upstream-channel-prefix: ''
15+
tag-prefix: ''
16+
php-variation: cli
17+
secrets: inherit
1618

17-
# Configure our deployment strategy. Order is important here and we want it to go: CLI < FPM < FPM-NGINX
18-
strategy:
19-
# We want to limit the number of jobs to the number of versions that we're offering (since we want the dependency order to be built correctly)
20-
max-parallel: 3
21-
# Set our base image and versions here
22-
matrix:
23-
####################################################################################################################
24-
# Possibly delete this "base-image" thing. (See https://github.com/serversideup/docker-php/issues/8)
25-
####################################################################################################################
26-
# base-image:
27-
# - ubuntu:20.04
28-
php-variation:
29-
- cli
30-
- fpm
31-
- fpm-nginx
32-
- fpm-apache
33-
php-version:
34-
- "7.4"
35-
- "8.0"
36-
- "8.1"
19+
fpm:
20+
needs: cli
21+
uses: ./.github/workflows/workflow-docker-publish.yml
22+
with:
23+
upstream-channel-prefix: ''
24+
tag-prefix: ''
25+
php-variation: fpm
26+
secrets: inherit
3727

38-
steps:
39-
- uses: actions/checkout@v2
40-
with:
41-
ref: main
42-
43-
- name: Login to DockerHub
44-
uses: docker/login-action@v1
45-
with:
46-
username: ${{ secrets.DOCKER_HUB_USERNAME }}
47-
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
28+
fpm-nginx:
29+
needs: fpm
30+
uses: ./.github/workflows/workflow-docker-publish.yml
31+
with:
32+
upstream-channel-prefix: ''
33+
tag-prefix: ''
34+
php-variation: fpm-nginx
35+
secrets: inherit
4836

49-
- name: Build and tag image
50-
run: docker build --pull generated-dockerfiles/${{ matrix.php-version }}/${{ matrix.php-variation }}/. --tag serversideup/php:${{ matrix.php-version }}-${{ matrix.php-variation }}-v1.5.0
37+
fpm-apache:
38+
needs: fpm
39+
uses: ./.github/workflows/workflow-docker-publish.yml
40+
with:
41+
upstream-channel-prefix: ''
42+
tag-prefix: ''
43+
php-variation: fpm-apache
44+
secrets: inherit
5145

52-
- name: Push version image to DockerHub
53-
run: docker push serversideup/php:${{ matrix.php-version }}-${{ matrix.php-variation }}-v1.5.0
54-
5546
update_container_readme:
5647
runs-on: ubuntu-latest
5748
name: Push README to Docker Hub
5849
steps:
5950
- name: git checkout
60-
uses: actions/checkout@v2
51+
uses: actions/checkout@v3
6152
with:
6253
ref: main
6354

@@ -74,7 +65,7 @@ jobs:
7465

7566
trigger_downstream_jobs:
7667
needs: push
77-
runs-on: ubuntu-20.04
68+
runs-on: ubuntu-22.04
7869
steps:
7970
- name: Trigger downstream builds
8071
run: curl --fail --output "/dev/null" --silent --show-error -X POST -F token=${{ secrets.DOWNSTREAM_BUILD_TOKEN }} -F ref=$GITHUB_REF ${{ secrets.DOWNSTREAM_BUILD_WEBHOOK_ENDPOINT }}

.github/workflows/sponsors.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Generate Sponsors README
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: 30 15 * * 0-6
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout 🛎️
11+
uses: actions/checkout@v3
12+
13+
- name: Generate Sponsors 💖
14+
uses: JamesIves/github-sponsors-readme-action@v1
15+
with:
16+
organization: true
17+
maximum: 500
18+
fallback: '<p align="center"><a href="https://github.com/sponsors/serversideup"><img src="https://521public.s3.amazonaws.com/serversideup/sponsors/sponsor-empty-state.png" alt="Sponsors"></a></p>'
19+
token: ${{ secrets.SPONSORS_README_ACTION_PERSONAL_ACCESS_TOKEN }}
20+
marker: 'supporters'
21+
template: '<a href="https://github.com/{{{ login }}}"><img src="https://github.com/{{{ login }}}.png" width="40px" alt="{{{ login }}}" /></a>&nbsp;&nbsp;'
22+
file: 'README.md'
23+
24+
- name: Deploy to GitHub Pages 🚀
25+
uses: JamesIves/github-pages-deploy-action@v4
26+
with:
27+
branch: main
28+
folder: '.'
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
upstream-channel-prefix:
5+
required: true
6+
type: string
7+
default: ''
8+
base-os-flavor:
9+
required: false
10+
type: string
11+
default: 'ubuntu'
12+
base-os-version:
13+
required: false
14+
type: string
15+
default: '22.04'
16+
tag-prefix:
17+
required: true
18+
type: string
19+
default: 'beta-'
20+
php-variation:
21+
required: true
22+
type: string
23+
24+
jobs:
25+
docker-publish:
26+
runs-on: ubuntu-22.04
27+
strategy:
28+
matrix:
29+
php-version:
30+
- "7.4"
31+
- "8.0"
32+
- "8.1"
33+
- "8.2"
34+
steps:
35+
- name: Get branch name
36+
id: branch-name
37+
uses: tj-actions/branch-names@v6
38+
39+
- uses: actions/checkout@v3
40+
with:
41+
ref: ${{ steps.branch-name.outputs.current_branch }}
42+
43+
- name: Login to DockerHub
44+
uses: docker/login-action@v2
45+
with:
46+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
47+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
48+
49+
- name: Set up QEMU
50+
uses: docker/setup-qemu-action@v2
51+
52+
- name: Set up Docker Buildx
53+
uses: docker/setup-buildx-action@v2
54+
55+
- name: Build and push
56+
uses: docker/build-push-action@v3
57+
with:
58+
build-args: |
59+
UPSTREAM_CHANNEL=${{ inputs.upstream-channel-prefix }}
60+
BASE_OS_FLAVOR=${{ inputs.base-os-flavor }}
61+
BASE_OS_VERSION=${{ inputs.base-os-version }}
62+
PHP_VERSION=${{ matrix.php-version }}
63+
context: src/${{ inputs.php-variation }}/.
64+
platforms: |
65+
linux/amd64
66+
linux/arm/v7
67+
linux/arm64/v8
68+
pull: true
69+
push: true
70+
tags: serversideup/php:${{ inputs.tag-prefix}}${{ matrix.php-version }}-${{ inputs.php-variation }}

0 commit comments

Comments
 (0)