Skip to content

Commit 6b672ae

Browse files
committed
Merge branch 'master' of github.com:KIMB-technologies/PHP-NGINX-Docker
2 parents 1488a0d + bbefa24 commit 6b672ae

File tree

6 files changed

+68
-62
lines changed

6 files changed

+68
-62
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Docker Image Push (on commit and base image update)
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
schedule:
7+
- cron: "15 */8 * * *"
8+
9+
env:
10+
IMAGE_OWNER: kimbtechnologies
11+
IMAGE_NAME: php_nginx
12+
BASE_IMAGE: library/php:fpm-alpine
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
19+
# check if update needed
20+
- name: Check for new baseimage
21+
id: check
22+
uses: lucacome/docker-image-update-checker@v1
23+
with:
24+
base-image: "${{env.BASE_IMAGE}}"
25+
image: "${{env.IMAGE_OWNER}}/${{env.IMAGE_NAME}}:latest"
26+
#env:
27+
# DEBUG: true
28+
if: github.event_name != 'push'
29+
30+
# setup build env.
31+
- name: Access repository contents
32+
uses: actions/checkout@v4
33+
if: ${{ (github.event_name == 'push') || (steps.check.outputs.needs-updating == 'true') }}
34+
- name: Login to DockerHub
35+
uses: docker/login-action@v3
36+
with:
37+
username: ${{ secrets.DOCKER_USERNAME }}
38+
password: ${{ secrets.DOCKER_TOKEN }}
39+
if: ${{ (github.event_name == 'push') || (steps.check.outputs.needs-updating == 'true') }}
40+
41+
# build local AMD image
42+
- name: Build the AMD image
43+
run: docker build . --file "Dockerfile" --tag "$IMAGE_OWNER/$IMAGE_NAME:latest"
44+
if: ${{ (github.event_name == 'push') || (steps.check.outputs.needs-updating == 'true') }}
45+
- name: Push tag 8-latest
46+
run: docker tag "$IMAGE_OWNER/$IMAGE_NAME:latest" "$IMAGE_OWNER/$IMAGE_NAME:8-latest"; docker push "$IMAGE_OWNER/$IMAGE_NAME:8-latest";
47+
if: ${{ (github.event_name == 'push') || (steps.check.outputs.needs-updating == 'true') }}
48+
49+
# Multi platform support
50+
- name: Set up QEMU for Docker Buildx
51+
uses: docker/setup-qemu-action@v3
52+
if: ${{ (github.event_name == 'push') || (steps.check.outputs.needs-updating == 'true') }}
53+
- name: Set up Docker Buildx
54+
uses: docker/setup-buildx-action@v3
55+
if: ${{ (github.event_name == 'push') || (steps.check.outputs.needs-updating == 'true') }}
56+
57+
# Multi platform image build and push
58+
- name: Build and push the ARM Docker images
59+
run: php_v=$(docker run --rm "$IMAGE_OWNER/$IMAGE_NAME:latest" sh -c 'echo "$PHP_VERSION"'); php_v=$(echo $php_v | grep -o '[0-9\.]*'); docker buildx build --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/arm64 . --file "Dockerfile" --tag "$IMAGE_OWNER/$IMAGE_NAME:latest" --tag "$IMAGE_OWNER/$IMAGE_NAME:php-$php_v" --push
60+
if: ${{ (github.event_name == 'push') || (steps.check.outputs.needs-updating == 'true') }}
61+

β€Ž.travis.ymlβ€Ž

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

β€ŽDockerfileβ€Ž

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
ARG BASEIMAGE_VERSION
2-
FROM php:${BASEIMAGE_VERSION}-fpm-alpine
1+
FROM php:fpm-alpine
32

43
# install nginx
54
RUN apk add --update --no-cache nginx \

β€ŽREADME.mdβ€Ž

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# PHP-NGINX-Docker
22

3-
An easy to use php and nginx image for docker.
3+
An easy to use php and nginx image for Docker.
4+
5+
Currently available for AMD64, ARMv6, ARMv7 and ARM64 (v8).
46

57
## Docker Command
68

@@ -22,15 +24,14 @@ version: "2"
2224

2325
services:
2426
web:
25-
image: kimbtechnologies/php_nginx:latest # uses php 7.4
26-
#image: kimbtechnologies/php_nginx:8-latest # uses php 8.*
27+
image: kimbtechnologies/php_nginx:latest # uses php 8.*
2728
container_name: php_nginx
2829
ports:
2930
- "127.0.0.1:8080:80"
3031
volumes:
3132
- ./php/:/php-code/ # load custom php code
32-
# - ./more-server-conf.conf:/etc/nginx/more-server-conf.conf:ro # add config options to the nginx conf (see file in repository for example)
33-
# - ./init.sh:/startup-before.sh # script to be run before php, nginx startup (e.g. for system updates, ..., runs as root)
33+
# - ./more-server-conf.conf:/etc/nginx/more-server-conf.conf:ro # add config options to the nginx conf (see file in repository for example)
34+
# - ./init.sh:/startup-before.sh # script to be run before php, nginx startup (e.g. for system updates, ..., runs as root)
3435
restart: always
3536

3637
```

β€Ždocker-compose.ymlβ€Ž

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ services:
99
ports:
1010
- "127.0.0.1:8080:80"
1111
build:
12-
args:
13-
#- BASEIMAGE_VERSION=7
14-
- BASEIMAGE_VERSION=8
1512
context: .
1613
volumes:
1714
- ./init.sh:/startup-before.sh

β€Ždockerpublish.shβ€Ž

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

0 commit comments

Comments
Β (0)