Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
marji committed Sep 14, 2022
0 parents commit 51ea317
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: build_and_publish
on:
push:
branches-ignore:
# prevent building on commits to any branch
- '**'
tags:
# Build on every tag:
- '**'
pull_request:

jobs:
login-build-and-push:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to the GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
if: contains(github.ref, 'refs/tags/')
name: Build and push release image
uses: docker/build-push-action@v2
with:
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/ci-php:latest
ghcr.io/${{ github.repository_owner }}/ci-php:${{ github.ref_name }}
-
if: contains(github.ref, 'refs/pull/')
name: Build and push pull request image
uses: docker/build-push-action@v2
with:
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/ci-php:review-pr-${{ github.event.pull_request.number }}-${{ github.head_ref }}
-
# not used / triggered at the moment:
if: contains(github.ref, 'refs/heads/')
name: Build and push the feature branch image
uses: docker/build-push-action@v2
with:
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/ci-php:${{ github.ref_name }}
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM php:8.0.23-fpm-alpine3.16

LABEL maintainer="[email protected]"
LABEL org.opencontainers.image.source="https://github.com/morpht/ci-php"

ENV COMPOSER_VERSION=2.3.10 \
COMPOSER_HASH_SHA256=d808272f284fa8e0f8b470703e1438ac8f362030bbc9d12e29530277d767aff0

RUN apk add --no-cache --update git \
bash \
openssh-client \
mysql-client \
patch \
rsync \
libpng libpng-dev \
&& docker-php-ext-install gd pdo pdo_mysql \
&& apk del libpng-dev \
&& rm -rf /var/cache/apk/* \
&& curl -L -o /usr/local/bin/composer https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar \
&& echo "$COMPOSER_HASH_SHA256 /usr/local/bin/composer" | sha256sum -c \
&& chmod +x /usr/local/bin/composer

# Remove warning about running as root in composer
ENV COMPOSER_ALLOW_SUPERUSER=1
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ci-php

Docker image based on the official dockerhub image php:8.x-fpm-alpine3.y

A few modifications:

- added composer v2.3.x
- installed several packages, e.g. git and mysql-client
- added php extensions - gd, pdo_mysql

Published in GHCR - https://github.com/morpht/ci-php/pkgs/container/ci-php

0 comments on commit 51ea317

Please sign in to comment.