├── .github └── workflows │ ├── build_docker_images-php8_1-alpine_fpm.yaml │ ├── build_docker_images-php8_1-alpine_fpm_nginx.yaml │ ├── build_docker_images-php8_1-debian_apache.yaml │ ├── build_docker_images-php8_1-debian_fpm.yaml │ ├── build_docker_images-php8_2-alpine_fpm.yaml │ ├── build_docker_images-php8_2-alpine_fpm_nginx.yaml │ ├── build_docker_images-php8_2-debian_apache.yaml │ ├── build_docker_images-php8_2-debian_fpm.yaml │ ├── build_docker_images-php8_3-alpine_fpm.yaml │ ├── build_docker_images-php8_3-alpine_fpm_nginx.yaml │ ├── build_docker_images-php8_3-debian_apache.yaml │ ├── build_docker_images-php8_3-debian_fpm.yaml │ ├── build_docker_images-php8_4-alpine_fpm.yaml │ ├── build_docker_images-php8_4-alpine_fpm_nginx.yaml │ ├── build_docker_images-php8_4-debian_apache.yaml │ ├── build_docker_images-php8_4-debian_fpm.yaml │ └── build_docker_images-php8_x-alpine_fpm_nginx_extended.yaml ├── .gitignore ├── LICENSE ├── README.md ├── alpine.fpm.Dockerfile ├── alpine.fpm.slim.Dockerfile ├── alpine.fpm_nginx.Dockerfile ├── alpine.fpm_nginx.extended.Dockerfile ├── alpine.fpm_nginx.extended.git.Dockerfile ├── alpine.fpm_nginx.slim.Dockerfile ├── conf ├── default.conf ├── nginx.conf └── supervisord.ini ├── debian.apache.Dockerfile ├── debian.apache.slim.Dockerfile ├── debian.fpm.Dockerfile ├── debian.fpm.slim.Dockerfile ├── docker-compose.yml ├── entrypoint.sh └── k8s.yaml /.github/workflows/build_docker_images-php8_1-alpine_fpm.yaml: -------------------------------------------------------------------------------- 1 | name: 'build docker images: Alpine + 8.1 PHP-FPM' 2 | 3 | on: 4 | #push: 5 | # branches: 6 | # - 'main' 7 | # - 'master' 8 | # paths: 9 | # - 'alpine.fpm.slim.Dockerfile' 10 | # - 'alpine.fpm.Dockerfile' 11 | # - '.github/workflows/build_docker_images-php8_1-alpine_fpm.yaml' 12 | workflow_dispatch: 13 | schedule: 14 | - cron: '45 2 21 * *' # At 02:45 on day-of-month 21. 15 | 16 | defaults: 17 | run: 18 | shell: bash 19 | 20 | jobs: 21 | docker: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - name: Checkout 25 | uses: actions/checkout@v2 26 | 27 | - name: Shell-Script 28 | id: script 29 | run: | 30 | BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" 31 | BUILD_DATE_NUMERIC="${BUILD_DATE//[^[:digit:]]/}" 32 | COMMIT_HASH=${GITHUB_SHA::8} 33 | GITHUB_REPO=${GITHUB_REPOSITORY,,} 34 | GITHUB_REPO_SHORT=${GITHUB_REPO#*/} 35 | GITHUB_REPO_SHORT=${GITHUB_REPO_SHORT#"docker-"} 36 | DOCKER_REPO=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPO_SHORT} 37 | REDHAT_QUAY_REPO=${{ secrets.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT} 38 | 39 | PHP_VERSION="8.1" 40 | 41 | # Set output parameters to github action. 42 | echo ::set-output name=build_date::${BUILD_DATE} 43 | echo ::set-output name=build_date_numeric::${BUILD_DATE_NUMERIC} 44 | echo ::set-output name=commit_hash::${COMMIT_HASH} 45 | echo ::set-output name=github_repo::${GITHUB_REPO} 46 | echo ::set-output name=docker_repo::${DOCKER_REPO} 47 | echo ::set-output name=redhat_quay_repo::${REDHAT_QUAY_REPO} 48 | 49 | echo ::set-output name=php_version::${PHP_VERSION} 50 | 51 | - name: Set up QEMU 52 | id: qemu 53 | uses: docker/setup-qemu-action@v1 54 | with: 55 | image: tonistiigi/binfmt:latest 56 | platforms: all 57 | 58 | - name: Set up Docker Buildx 59 | id: buildx 60 | uses: docker/setup-buildx-action@master 61 | 62 | #- name: Login to GitHub Container Registry 63 | # uses: docker/login-action@v1 64 | # with: 65 | # registry: ghcr.io 66 | # username: ${{ github.repository_owner }} 67 | # password: ${{ secrets.GITHUB_TOKEN }} 68 | 69 | - name: Login to DockerHub 70 | uses: docker/login-action@v1 71 | with: 72 | registry: docker.io 73 | username: ${{ secrets.DOCKER_USERNAME }} 74 | password: ${{ secrets.DOCKER_PASSWORD }} 75 | 76 | #- name: Login to RED HAT Quay.io Container Registry 77 | # uses: docker/login-action@v1 78 | # with: 79 | # registry: quay.io 80 | # username: ${{ secrets.REDHAT_QUAY_USERNAME }} 81 | # password: ${{ secrets.REDHAT_QUAY_PASSWORD }} 82 | 83 | - name: Build-slim 84 | uses: docker/build-push-action@v2 85 | with: 86 | builder: ${{ steps.buildx.outputs.name }} 87 | context: . 88 | file: ./alpine.fpm.slim.Dockerfile 89 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6 90 | #pull: true 91 | push: true 92 | build-args: | 93 | BUILD_DATE=${{steps.script.outputs.build_date}} 94 | VCS_REF=${{steps.script.outputs.commit_hash}} 95 | PHP_VERSION=${{steps.script.outputs.php_version}} 96 | tags: | 97 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-slim 98 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-slim-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 99 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-slim 100 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-slim 101 | 102 | - name: Build 103 | uses: docker/build-push-action@v2 104 | with: 105 | builder: ${{ steps.buildx.outputs.name }} 106 | context: . 107 | file: ./alpine.fpm.Dockerfile 108 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 109 | pull: true 110 | push: true 111 | build-args: | 112 | BUILD_DATE=${{steps.script.outputs.build_date}} 113 | VCS_REF=${{steps.script.outputs.commit_hash}} 114 | PHP_VERSION=${{steps.script.outputs.php_version}} 115 | tags: | 116 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine 117 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 118 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine 119 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine 120 | 121 | - name: Docker Hub Description 122 | uses: peter-evans/dockerhub-description@v3 123 | with: 124 | username: ${{ secrets.DOCKER_USERNAME }} 125 | password: ${{ secrets.DOCKER_PASSWORD }} 126 | repository: ${{steps.script.outputs.docker_repo}} 127 | short-description: ${{ github.event.repository.description }} 128 | readme-filepath: README.md -------------------------------------------------------------------------------- /.github/workflows/build_docker_images-php8_1-alpine_fpm_nginx.yaml: -------------------------------------------------------------------------------- 1 | name: 'build docker images: Alpine + 8.1 PHP-FPM + NGINX' 2 | 3 | on: 4 | #push: 5 | # branches: 6 | # - 'main' 7 | # - 'master' 8 | # paths: 9 | # - 'alpine.fpm_nginx.slim.Dockerfile' 10 | # - 'alpine.fpm_nginx.Dockerfile' 11 | # - 'alpine.fpm_nginx.extended.Dockerfile' 12 | # - '.github/workflows/build_docker_images-php8_1-alpine_fpm_nginx.yaml' 13 | workflow_dispatch: 14 | schedule: 15 | - cron: '45 5 21 * *' # At 05:45 on day-of-month 21. 16 | 17 | defaults: 18 | run: 19 | shell: bash 20 | 21 | jobs: 22 | docker: 23 | runs-on: ubuntu-latest 24 | steps: 25 | - name: Checkout 26 | uses: actions/checkout@v2 27 | 28 | - name: Shell-Script 29 | id: script 30 | run: | 31 | BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" 32 | BUILD_DATE_NUMERIC="${BUILD_DATE//[^[:digit:]]/}" 33 | COMMIT_HASH=${GITHUB_SHA::8} 34 | GITHUB_REPO=${GITHUB_REPOSITORY,,} 35 | GITHUB_REPO_SHORT=${GITHUB_REPO#*/} 36 | GITHUB_REPO_SHORT=${GITHUB_REPO_SHORT#"docker-"} 37 | DOCKER_REPO=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPO_SHORT} 38 | REDHAT_QUAY_REPO=${{ secrets.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT} 39 | 40 | PHP_VERSION="8.1" 41 | 42 | # Set output parameters to github action. 43 | echo ::set-output name=build_date::${BUILD_DATE} 44 | echo ::set-output name=build_date_numeric::${BUILD_DATE_NUMERIC} 45 | echo ::set-output name=commit_hash::${COMMIT_HASH} 46 | echo ::set-output name=github_repo::${GITHUB_REPO} 47 | echo ::set-output name=docker_repo::${DOCKER_REPO} 48 | echo ::set-output name=redhat_quay_repo::${REDHAT_QUAY_REPO} 49 | 50 | echo ::set-output name=php_version::${PHP_VERSION} 51 | 52 | - name: Set up QEMU 53 | id: qemu 54 | uses: docker/setup-qemu-action@v1 55 | with: 56 | image: tonistiigi/binfmt:latest 57 | platforms: all 58 | 59 | - name: Set up Docker Buildx 60 | id: buildx 61 | uses: docker/setup-buildx-action@master 62 | 63 | #- name: Login to GitHub Container Registry 64 | # uses: docker/login-action@v1 65 | # with: 66 | # registry: ghcr.io 67 | # username: ${{ github.repository_owner }} 68 | # password: ${{ secrets.GITHUB_TOKEN }} 69 | 70 | - name: Login to DockerHub 71 | uses: docker/login-action@v1 72 | with: 73 | registry: docker.io 74 | username: ${{ secrets.DOCKER_USERNAME }} 75 | password: ${{ secrets.DOCKER_PASSWORD }} 76 | 77 | #- name: Login to RED HAT Quay.io Container Registry 78 | # uses: docker/login-action@v1 79 | # with: 80 | # registry: quay.io 81 | # username: ${{ secrets.REDHAT_QUAY_USERNAME }} 82 | # password: ${{ secrets.REDHAT_QUAY_PASSWORD }} 83 | 84 | - name: Build-slim 85 | uses: docker/build-push-action@v2 86 | with: 87 | builder: ${{ steps.buildx.outputs.name }} 88 | context: . 89 | file: ./alpine.fpm_nginx.slim.Dockerfile 90 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6 91 | pull: true 92 | push: true 93 | build-args: | 94 | BUILD_DATE=${{steps.script.outputs.build_date}} 95 | VCS_REF=${{steps.script.outputs.commit_hash}} 96 | PHP_VERSION=${{steps.script.outputs.php_version}} 97 | tags: | 98 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-slim 99 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-slim-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 100 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-slim 101 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-slim 102 | 103 | - name: Build 104 | uses: docker/build-push-action@v2 105 | with: 106 | builder: ${{ steps.buildx.outputs.name }} 107 | context: . 108 | file: ./alpine.fpm_nginx.Dockerfile 109 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 110 | pull: true 111 | push: true 112 | build-args: | 113 | BUILD_DATE=${{steps.script.outputs.build_date}} 114 | VCS_REF=${{steps.script.outputs.commit_hash}} 115 | PHP_VERSION=${{steps.script.outputs.php_version}} 116 | tags: | 117 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine 118 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 119 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine 120 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine 121 | 122 | - name: Build-extended 123 | uses: docker/build-push-action@v2 124 | with: 125 | builder: ${{ steps.buildx.outputs.name }} 126 | context: . 127 | file: ./alpine.fpm_nginx.extended.Dockerfile 128 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 129 | pull: true 130 | push: true 131 | build-args: | 132 | BUILD_DATE=${{steps.script.outputs.build_date}} 133 | VCS_REF=${{steps.script.outputs.commit_hash}} 134 | PHP_VERSION=${{steps.script.outputs.php_version}} 135 | tags: | 136 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 137 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 138 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 139 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 140 | 141 | - name: Docker Hub Description 142 | uses: peter-evans/dockerhub-description@v3 143 | with: 144 | username: ${{ secrets.DOCKER_USERNAME }} 145 | password: ${{ secrets.DOCKER_PASSWORD }} 146 | repository: ${{steps.script.outputs.docker_repo}} 147 | short-description: ${{ github.event.repository.description }} 148 | readme-filepath: README.md -------------------------------------------------------------------------------- /.github/workflows/build_docker_images-php8_1-debian_apache.yaml: -------------------------------------------------------------------------------- 1 | name: 'build docker images: Debian + 8.1 PHP + Apache2' 2 | 3 | on: 4 | #push: 5 | # branches: 6 | # - 'main' 7 | # - 'master' 8 | # paths: 9 | # - 'debian.apache.slim.Dockerfile' 10 | # - 'debian.apache.Dockerfile' 11 | # - '.github/workflows/build_docker_images-php8_1-debian_apache.yaml' 12 | workflow_dispatch: 13 | schedule: 14 | - cron: '45 5 20 * *' # At 05:45 on day-of-month 20. 15 | 16 | defaults: 17 | run: 18 | shell: bash 19 | 20 | jobs: 21 | docker: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - name: Checkout 25 | uses: actions/checkout@v2 26 | 27 | - name: Shell-Script 28 | id: script 29 | run: | 30 | BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" 31 | BUILD_DATE_NUMERIC="${BUILD_DATE//[^[:digit:]]/}" 32 | COMMIT_HASH=${GITHUB_SHA::8} 33 | GITHUB_REPO=${GITHUB_REPOSITORY,,} 34 | GITHUB_REPO_SHORT=${GITHUB_REPO#*/} 35 | GITHUB_REPO_SHORT=${GITHUB_REPO_SHORT#"docker-"} 36 | DOCKER_REPO=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPO_SHORT} 37 | REDHAT_QUAY_REPO=${{ secrets.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT} 38 | 39 | PHP_VERSION="8.1" 40 | 41 | # Set output parameters to github action. 42 | echo ::set-output name=build_date::${BUILD_DATE} 43 | echo ::set-output name=build_date_numeric::${BUILD_DATE_NUMERIC} 44 | echo ::set-output name=commit_hash::${COMMIT_HASH} 45 | echo ::set-output name=github_repo::${GITHUB_REPO} 46 | echo ::set-output name=docker_repo::${DOCKER_REPO} 47 | echo ::set-output name=redhat_quay_repo::${REDHAT_QUAY_REPO} 48 | 49 | echo ::set-output name=php_version::${PHP_VERSION} 50 | 51 | - name: Set up QEMU 52 | id: qemu 53 | uses: docker/setup-qemu-action@v1 54 | with: 55 | image: tonistiigi/binfmt:latest 56 | platforms: all 57 | 58 | - name: Set up Docker Buildx 59 | id: buildx 60 | uses: docker/setup-buildx-action@master 61 | 62 | #- name: Login to GitHub Container Registry 63 | # uses: docker/login-action@v1 64 | # with: 65 | # registry: ghcr.io 66 | # username: ${{ github.repository_owner }} 67 | # password: ${{ secrets.GITHUB_TOKEN }} 68 | 69 | - name: Login to DockerHub 70 | uses: docker/login-action@v1 71 | with: 72 | registry: docker.io 73 | username: ${{ secrets.DOCKER_USERNAME }} 74 | password: ${{ secrets.DOCKER_PASSWORD }} 75 | 76 | #- name: Login to RED HAT Quay.io Container Registry 77 | # uses: docker/login-action@v1 78 | # with: 79 | # registry: quay.io 80 | # username: ${{ secrets.REDHAT_QUAY_USERNAME }} 81 | # password: ${{ secrets.REDHAT_QUAY_PASSWORD }} 82 | 83 | - name: Build-slim 84 | uses: docker/build-push-action@v2 85 | with: 86 | builder: ${{ steps.buildx.outputs.name }} 87 | context: . 88 | file: ./debian.apache.slim.Dockerfile 89 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6 90 | #pull: true 91 | push: true 92 | build-args: | 93 | BUILD_DATE=${{steps.script.outputs.build_date}} 94 | VCS_REF=${{steps.script.outputs.commit_hash}} 95 | PHP_VERSION=${{steps.script.outputs.php_version}} 96 | tags: | 97 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-apache-slim 98 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-apache-slim-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 99 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-apache-slim 100 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-apache-slim 101 | 102 | - name: Build 103 | uses: docker/build-push-action@v2 104 | with: 105 | builder: ${{ steps.buildx.outputs.name }} 106 | context: . 107 | file: ./debian.apache.Dockerfile 108 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 109 | pull: true 110 | push: true 111 | build-args: | 112 | BUILD_DATE=${{steps.script.outputs.build_date}} 113 | VCS_REF=${{steps.script.outputs.commit_hash}} 114 | PHP_VERSION=${{steps.script.outputs.php_version}} 115 | tags: | 116 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-apache 117 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-apache-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 118 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-apache 119 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-apache 120 | 121 | - name: Docker Hub Description 122 | uses: peter-evans/dockerhub-description@v3 123 | with: 124 | username: ${{ secrets.DOCKER_USERNAME }} 125 | password: ${{ secrets.DOCKER_PASSWORD }} 126 | repository: ${{steps.script.outputs.docker_repo}} 127 | short-description: ${{ github.event.repository.description }} 128 | readme-filepath: README.md -------------------------------------------------------------------------------- /.github/workflows/build_docker_images-php8_1-debian_fpm.yaml: -------------------------------------------------------------------------------- 1 | name: 'build docker images: Debian + 8.1 PHP-FPM' 2 | 3 | on: 4 | #push: 5 | # branches: 6 | # - 'main' 7 | # - 'master' 8 | # paths: 9 | # - 'debian.fpm.slim.Dockerfile' 10 | # - 'debian.fpm.Dockerfile' 11 | # - '.github/workflows/build_docker_images-php8_1-debian_fpm.yaml' 12 | workflow_dispatch: 13 | schedule: 14 | - cron: '45 2 20 * *' # At 05:45 on day-of-month 20. 15 | 16 | defaults: 17 | run: 18 | shell: bash 19 | 20 | jobs: 21 | docker: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - name: Checkout 25 | uses: actions/checkout@v2 26 | 27 | - name: Shell-Script 28 | id: script 29 | run: | 30 | BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" 31 | BUILD_DATE_NUMERIC="${BUILD_DATE//[^[:digit:]]/}" 32 | COMMIT_HASH=${GITHUB_SHA::8} 33 | GITHUB_REPO=${GITHUB_REPOSITORY,,} 34 | GITHUB_REPO_SHORT=${GITHUB_REPO#*/} 35 | GITHUB_REPO_SHORT=${GITHUB_REPO_SHORT#"docker-"} 36 | DOCKER_REPO=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPO_SHORT} 37 | REDHAT_QUAY_REPO=${{ secrets.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT} 38 | 39 | PHP_VERSION="8.1" 40 | 41 | # Set output parameters to github action. 42 | echo ::set-output name=build_date::${BUILD_DATE} 43 | echo ::set-output name=build_date_numeric::${BUILD_DATE_NUMERIC} 44 | echo ::set-output name=commit_hash::${COMMIT_HASH} 45 | echo ::set-output name=github_repo::${GITHUB_REPO} 46 | echo ::set-output name=docker_repo::${DOCKER_REPO} 47 | echo ::set-output name=redhat_quay_repo::${REDHAT_QUAY_REPO} 48 | 49 | echo ::set-output name=php_version::${PHP_VERSION} 50 | 51 | - name: Set up QEMU 52 | id: qemu 53 | uses: docker/setup-qemu-action@v1 54 | with: 55 | image: tonistiigi/binfmt:latest 56 | platforms: all 57 | 58 | - name: Set up Docker Buildx 59 | id: buildx 60 | uses: docker/setup-buildx-action@master 61 | 62 | #- name: Login to GitHub Container Registry 63 | # uses: docker/login-action@v1 64 | # with: 65 | # registry: ghcr.io 66 | # username: ${{ github.repository_owner }} 67 | # password: ${{ secrets.GITHUB_TOKEN }} 68 | 69 | - name: Login to DockerHub 70 | uses: docker/login-action@v1 71 | with: 72 | registry: docker.io 73 | username: ${{ secrets.DOCKER_USERNAME }} 74 | password: ${{ secrets.DOCKER_PASSWORD }} 75 | 76 | #- name: Login to RED HAT Quay.io Container Registry 77 | # uses: docker/login-action@v1 78 | # with: 79 | # registry: quay.io 80 | # username: ${{ secrets.REDHAT_QUAY_USERNAME }} 81 | # password: ${{ secrets.REDHAT_QUAY_PASSWORD }} 82 | 83 | - name: Build-slim 84 | uses: docker/build-push-action@v2 85 | with: 86 | builder: ${{ steps.buildx.outputs.name }} 87 | context: . 88 | file: ./debian.fpm.slim.Dockerfile 89 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6 90 | #pull: true 91 | push: true 92 | build-args: | 93 | BUILD_DATE=${{steps.script.outputs.build_date}} 94 | VCS_REF=${{steps.script.outputs.commit_hash}} 95 | PHP_VERSION=${{steps.script.outputs.php_version}} 96 | tags: | 97 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-slim 98 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-slim-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 99 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-slim 100 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-slim 101 | 102 | - name: Build 103 | uses: docker/build-push-action@v2 104 | with: 105 | builder: ${{ steps.buildx.outputs.name }} 106 | context: . 107 | file: ./debian.fpm.Dockerfile 108 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 109 | pull: true 110 | push: true 111 | build-args: | 112 | BUILD_DATE=${{steps.script.outputs.build_date}} 113 | VCS_REF=${{steps.script.outputs.commit_hash}} 114 | PHP_VERSION=${{steps.script.outputs.php_version}} 115 | tags: | 116 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm 117 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 118 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm 119 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm 120 | 121 | - name: Docker Hub Description 122 | uses: peter-evans/dockerhub-description@v3 123 | with: 124 | username: ${{ secrets.DOCKER_USERNAME }} 125 | password: ${{ secrets.DOCKER_PASSWORD }} 126 | repository: ${{steps.script.outputs.docker_repo}} 127 | short-description: ${{ github.event.repository.description }} 128 | readme-filepath: README.md -------------------------------------------------------------------------------- /.github/workflows/build_docker_images-php8_2-alpine_fpm.yaml: -------------------------------------------------------------------------------- 1 | name: 'build docker images: Alpine + 8.2 PHP-FPM' 2 | 3 | on: 4 | #push: 5 | # branches: 6 | # - 'main' 7 | # - 'master' 8 | # paths: 9 | # - 'alpine.fpm.slim.Dockerfile' 10 | # - 'alpine.fpm.Dockerfile' 11 | # - '.github/workflows/build_docker_images-php8_2-alpine_fpm.yaml' 12 | workflow_dispatch: 13 | schedule: 14 | - cron: '45 2 22 * *' # At 02:45 on day-of-month 22. 15 | 16 | defaults: 17 | run: 18 | shell: bash 19 | 20 | jobs: 21 | docker: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - name: Checkout 25 | uses: actions/checkout@v2 26 | 27 | - name: Shell-Script 28 | id: script 29 | run: | 30 | BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" 31 | BUILD_DATE_NUMERIC="${BUILD_DATE//[^[:digit:]]/}" 32 | COMMIT_HASH=${GITHUB_SHA::8} 33 | GITHUB_REPO=${GITHUB_REPOSITORY,,} 34 | GITHUB_REPO_SHORT=${GITHUB_REPO#*/} 35 | GITHUB_REPO_SHORT=${GITHUB_REPO_SHORT#"docker-"} 36 | DOCKER_REPO=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPO_SHORT} 37 | REDHAT_QUAY_REPO=${{ secrets.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT} 38 | 39 | PHP_VERSION="8.2" 40 | 41 | # Set output parameters to github action. 42 | echo ::set-output name=build_date::${BUILD_DATE} 43 | echo ::set-output name=build_date_numeric::${BUILD_DATE_NUMERIC} 44 | echo ::set-output name=commit_hash::${COMMIT_HASH} 45 | echo ::set-output name=github_repo::${GITHUB_REPO} 46 | echo ::set-output name=docker_repo::${DOCKER_REPO} 47 | echo ::set-output name=redhat_quay_repo::${REDHAT_QUAY_REPO} 48 | 49 | echo ::set-output name=php_version::${PHP_VERSION} 50 | 51 | - name: Set up QEMU 52 | id: qemu 53 | uses: docker/setup-qemu-action@v1 54 | with: 55 | image: tonistiigi/binfmt:latest 56 | platforms: all 57 | 58 | - name: Set up Docker Buildx 59 | id: buildx 60 | uses: docker/setup-buildx-action@master 61 | 62 | #- name: Login to GitHub Container Registry 63 | # uses: docker/login-action@v1 64 | # with: 65 | # registry: ghcr.io 66 | # username: ${{ github.repository_owner }} 67 | # password: ${{ secrets.GITHUB_TOKEN }} 68 | 69 | - name: Login to DockerHub 70 | uses: docker/login-action@v1 71 | with: 72 | registry: docker.io 73 | username: ${{ secrets.DOCKER_USERNAME }} 74 | password: ${{ secrets.DOCKER_PASSWORD }} 75 | 76 | #- name: Login to RED HAT Quay.io Container Registry 77 | # uses: docker/login-action@v1 78 | # with: 79 | # registry: quay.io 80 | # username: ${{ secrets.REDHAT_QUAY_USERNAME }} 81 | # password: ${{ secrets.REDHAT_QUAY_PASSWORD }} 82 | 83 | - name: Build-slim 84 | uses: docker/build-push-action@v2 85 | with: 86 | builder: ${{ steps.buildx.outputs.name }} 87 | context: . 88 | file: ./alpine.fpm.slim.Dockerfile 89 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6 90 | #pull: true 91 | push: true 92 | build-args: | 93 | BUILD_DATE=${{steps.script.outputs.build_date}} 94 | VCS_REF=${{steps.script.outputs.commit_hash}} 95 | PHP_VERSION=${{steps.script.outputs.php_version}} 96 | tags: | 97 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-slim 98 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-slim-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 99 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-slim 100 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-slim 101 | 102 | - name: Build 103 | uses: docker/build-push-action@v2 104 | with: 105 | builder: ${{ steps.buildx.outputs.name }} 106 | context: . 107 | file: ./alpine.fpm.Dockerfile 108 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 109 | pull: true 110 | push: true 111 | build-args: | 112 | BUILD_DATE=${{steps.script.outputs.build_date}} 113 | VCS_REF=${{steps.script.outputs.commit_hash}} 114 | PHP_VERSION=${{steps.script.outputs.php_version}} 115 | tags: | 116 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine 117 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 118 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine 119 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine 120 | 121 | - name: Docker Hub Description 122 | uses: peter-evans/dockerhub-description@v3 123 | with: 124 | username: ${{ secrets.DOCKER_USERNAME }} 125 | password: ${{ secrets.DOCKER_PASSWORD }} 126 | repository: ${{steps.script.outputs.docker_repo}} 127 | short-description: ${{ github.event.repository.description }} 128 | readme-filepath: README.md -------------------------------------------------------------------------------- /.github/workflows/build_docker_images-php8_2-alpine_fpm_nginx.yaml: -------------------------------------------------------------------------------- 1 | name: 'build docker images: Alpine + 8.2 PHP-FPM + NGINX' 2 | 3 | on: 4 | #push: 5 | # branches: 6 | # - 'main' 7 | # - 'master' 8 | # paths: 9 | # - 'alpine.fpm_nginx.slim.Dockerfile' 10 | # - 'alpine.fpm_nginx.Dockerfile' 11 | # - 'alpine.fpm_nginx.extended.Dockerfile' 12 | # - '.github/workflows/build_docker_images-php8_2-alpine_fpm_nginx.yaml' 13 | workflow_dispatch: 14 | schedule: 15 | - cron: '45 5 22 * *' # At 05:45 on day-of-month 22. 16 | 17 | defaults: 18 | run: 19 | shell: bash 20 | 21 | jobs: 22 | docker: 23 | runs-on: ubuntu-latest 24 | steps: 25 | - name: Checkout 26 | uses: actions/checkout@v2 27 | 28 | - name: Shell-Script 29 | id: script 30 | run: | 31 | BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" 32 | BUILD_DATE_NUMERIC="${BUILD_DATE//[^[:digit:]]/}" 33 | COMMIT_HASH=${GITHUB_SHA::8} 34 | GITHUB_REPO=${GITHUB_REPOSITORY,,} 35 | GITHUB_REPO_SHORT=${GITHUB_REPO#*/} 36 | GITHUB_REPO_SHORT=${GITHUB_REPO_SHORT#"docker-"} 37 | DOCKER_REPO=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPO_SHORT} 38 | REDHAT_QUAY_REPO=${{ secrets.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT} 39 | 40 | PHP_VERSION="8.2" 41 | 42 | # Set output parameters to github action. 43 | echo ::set-output name=build_date::${BUILD_DATE} 44 | echo ::set-output name=build_date_numeric::${BUILD_DATE_NUMERIC} 45 | echo ::set-output name=commit_hash::${COMMIT_HASH} 46 | echo ::set-output name=github_repo::${GITHUB_REPO} 47 | echo ::set-output name=docker_repo::${DOCKER_REPO} 48 | echo ::set-output name=redhat_quay_repo::${REDHAT_QUAY_REPO} 49 | 50 | echo ::set-output name=php_version::${PHP_VERSION} 51 | 52 | - name: Set up QEMU 53 | id: qemu 54 | uses: docker/setup-qemu-action@v1 55 | with: 56 | image: tonistiigi/binfmt:latest 57 | platforms: all 58 | 59 | - name: Set up Docker Buildx 60 | id: buildx 61 | uses: docker/setup-buildx-action@master 62 | 63 | #- name: Login to GitHub Container Registry 64 | # uses: docker/login-action@v1 65 | # with: 66 | # registry: ghcr.io 67 | # username: ${{ github.repository_owner }} 68 | # password: ${{ secrets.GITHUB_TOKEN }} 69 | 70 | - name: Login to DockerHub 71 | uses: docker/login-action@v1 72 | with: 73 | registry: docker.io 74 | username: ${{ secrets.DOCKER_USERNAME }} 75 | password: ${{ secrets.DOCKER_PASSWORD }} 76 | 77 | #- name: Login to RED HAT Quay.io Container Registry 78 | # uses: docker/login-action@v1 79 | # with: 80 | # registry: quay.io 81 | # username: ${{ secrets.REDHAT_QUAY_USERNAME }} 82 | # password: ${{ secrets.REDHAT_QUAY_PASSWORD }} 83 | 84 | - name: Build-slim 85 | uses: docker/build-push-action@v2 86 | with: 87 | builder: ${{ steps.buildx.outputs.name }} 88 | context: . 89 | file: ./alpine.fpm_nginx.slim.Dockerfile 90 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6 91 | pull: true 92 | push: true 93 | build-args: | 94 | BUILD_DATE=${{steps.script.outputs.build_date}} 95 | VCS_REF=${{steps.script.outputs.commit_hash}} 96 | PHP_VERSION=${{steps.script.outputs.php_version}} 97 | tags: | 98 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-slim 99 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-slim-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 100 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-slim 101 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-slim 102 | 103 | - name: Build 104 | uses: docker/build-push-action@v2 105 | with: 106 | builder: ${{ steps.buildx.outputs.name }} 107 | context: . 108 | file: ./alpine.fpm_nginx.Dockerfile 109 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 110 | pull: true 111 | push: true 112 | build-args: | 113 | BUILD_DATE=${{steps.script.outputs.build_date}} 114 | VCS_REF=${{steps.script.outputs.commit_hash}} 115 | PHP_VERSION=${{steps.script.outputs.php_version}} 116 | tags: | 117 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine 118 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 119 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine 120 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine 121 | 122 | - name: Build-extended 123 | uses: docker/build-push-action@v2 124 | with: 125 | builder: ${{ steps.buildx.outputs.name }} 126 | context: . 127 | file: ./alpine.fpm_nginx.extended.Dockerfile 128 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 129 | pull: true 130 | push: true 131 | build-args: | 132 | BUILD_DATE=${{steps.script.outputs.build_date}} 133 | VCS_REF=${{steps.script.outputs.commit_hash}} 134 | PHP_VERSION=${{steps.script.outputs.php_version}} 135 | tags: | 136 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 137 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 138 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 139 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 140 | 141 | - name: Docker Hub Description 142 | uses: peter-evans/dockerhub-description@v3 143 | with: 144 | username: ${{ secrets.DOCKER_USERNAME }} 145 | password: ${{ secrets.DOCKER_PASSWORD }} 146 | repository: ${{steps.script.outputs.docker_repo}} 147 | short-description: ${{ github.event.repository.description }} 148 | readme-filepath: README.md -------------------------------------------------------------------------------- /.github/workflows/build_docker_images-php8_2-debian_apache.yaml: -------------------------------------------------------------------------------- 1 | name: 'build docker images: Debian + 8.2 PHP + Apache2' 2 | 3 | on: 4 | #push: 5 | # branches: 6 | # - 'main' 7 | # - 'master' 8 | # paths: 9 | # - 'debian.apache.slim.Dockerfile' 10 | # - 'debian.apache.Dockerfile' 11 | # - '.github/workflows/build_docker_images-php8_2-debian_apache.yaml' 12 | workflow_dispatch: 13 | schedule: 14 | - cron: '45 5 22 * *' # At 05:45 on day-of-month 22. 15 | 16 | defaults: 17 | run: 18 | shell: bash 19 | 20 | jobs: 21 | docker: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - name: Checkout 25 | uses: actions/checkout@v2 26 | 27 | - name: Shell-Script 28 | id: script 29 | run: | 30 | BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" 31 | BUILD_DATE_NUMERIC="${BUILD_DATE//[^[:digit:]]/}" 32 | COMMIT_HASH=${GITHUB_SHA::8} 33 | GITHUB_REPO=${GITHUB_REPOSITORY,,} 34 | GITHUB_REPO_SHORT=${GITHUB_REPO#*/} 35 | GITHUB_REPO_SHORT=${GITHUB_REPO_SHORT#"docker-"} 36 | DOCKER_REPO=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPO_SHORT} 37 | REDHAT_QUAY_REPO=${{ secrets.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT} 38 | 39 | PHP_VERSION="8.2" 40 | 41 | # Set output parameters to github action. 42 | echo ::set-output name=build_date::${BUILD_DATE} 43 | echo ::set-output name=build_date_numeric::${BUILD_DATE_NUMERIC} 44 | echo ::set-output name=commit_hash::${COMMIT_HASH} 45 | echo ::set-output name=github_repo::${GITHUB_REPO} 46 | echo ::set-output name=docker_repo::${DOCKER_REPO} 47 | echo ::set-output name=redhat_quay_repo::${REDHAT_QUAY_REPO} 48 | 49 | echo ::set-output name=php_version::${PHP_VERSION} 50 | 51 | - name: Set up QEMU 52 | id: qemu 53 | uses: docker/setup-qemu-action@v1 54 | with: 55 | image: tonistiigi/binfmt:latest 56 | platforms: all 57 | 58 | - name: Set up Docker Buildx 59 | id: buildx 60 | uses: docker/setup-buildx-action@master 61 | 62 | #- name: Login to GitHub Container Registry 63 | # uses: docker/login-action@v1 64 | # with: 65 | # registry: ghcr.io 66 | # username: ${{ github.repository_owner }} 67 | # password: ${{ secrets.GITHUB_TOKEN }} 68 | 69 | - name: Login to DockerHub 70 | uses: docker/login-action@v1 71 | with: 72 | registry: docker.io 73 | username: ${{ secrets.DOCKER_USERNAME }} 74 | password: ${{ secrets.DOCKER_PASSWORD }} 75 | 76 | #- name: Login to RED HAT Quay.io Container Registry 77 | # uses: docker/login-action@v1 78 | # with: 79 | # registry: quay.io 80 | # username: ${{ secrets.REDHAT_QUAY_USERNAME }} 81 | # password: ${{ secrets.REDHAT_QUAY_PASSWORD }} 82 | 83 | - name: Build-slim 84 | uses: docker/build-push-action@v2 85 | with: 86 | builder: ${{ steps.buildx.outputs.name }} 87 | context: . 88 | file: ./debian.apache.slim.Dockerfile 89 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6 90 | #pull: true 91 | push: true 92 | build-args: | 93 | BUILD_DATE=${{steps.script.outputs.build_date}} 94 | VCS_REF=${{steps.script.outputs.commit_hash}} 95 | PHP_VERSION=${{steps.script.outputs.php_version}} 96 | tags: | 97 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-apache-slim 98 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-apache-slim-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 99 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-apache-slim 100 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-apache-slim 101 | 102 | - name: Build 103 | uses: docker/build-push-action@v2 104 | with: 105 | builder: ${{ steps.buildx.outputs.name }} 106 | context: . 107 | file: ./debian.apache.Dockerfile 108 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 109 | pull: true 110 | push: true 111 | build-args: | 112 | BUILD_DATE=${{steps.script.outputs.build_date}} 113 | VCS_REF=${{steps.script.outputs.commit_hash}} 114 | PHP_VERSION=${{steps.script.outputs.php_version}} 115 | tags: | 116 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-apache 117 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-apache-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 118 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-apache 119 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-apache 120 | 121 | - name: Docker Hub Description 122 | uses: peter-evans/dockerhub-description@v3 123 | with: 124 | username: ${{ secrets.DOCKER_USERNAME }} 125 | password: ${{ secrets.DOCKER_PASSWORD }} 126 | repository: ${{steps.script.outputs.docker_repo}} 127 | short-description: ${{ github.event.repository.description }} 128 | readme-filepath: README.md -------------------------------------------------------------------------------- /.github/workflows/build_docker_images-php8_2-debian_fpm.yaml: -------------------------------------------------------------------------------- 1 | name: 'build docker images: Debian + 8.2 PHP-FPM' 2 | 3 | on: 4 | #push: 5 | # branches: 6 | # - 'main' 7 | # - 'master' 8 | # paths: 9 | # - 'debian.fpm.slim.Dockerfile' 10 | # - 'debian.fpm.Dockerfile' 11 | # - '.github/workflows/build_docker_images-php8_2-debian_fpm.yaml' 12 | workflow_dispatch: 13 | schedule: 14 | - cron: '45 2 22 * *' # At 05:45 on day-of-month 22. 15 | 16 | defaults: 17 | run: 18 | shell: bash 19 | 20 | jobs: 21 | docker: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - name: Checkout 25 | uses: actions/checkout@v2 26 | 27 | - name: Shell-Script 28 | id: script 29 | run: | 30 | BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" 31 | BUILD_DATE_NUMERIC="${BUILD_DATE//[^[:digit:]]/}" 32 | COMMIT_HASH=${GITHUB_SHA::8} 33 | GITHUB_REPO=${GITHUB_REPOSITORY,,} 34 | GITHUB_REPO_SHORT=${GITHUB_REPO#*/} 35 | GITHUB_REPO_SHORT=${GITHUB_REPO_SHORT#"docker-"} 36 | DOCKER_REPO=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPO_SHORT} 37 | REDHAT_QUAY_REPO=${{ secrets.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT} 38 | 39 | PHP_VERSION="8.2" 40 | 41 | # Set output parameters to github action. 42 | echo ::set-output name=build_date::${BUILD_DATE} 43 | echo ::set-output name=build_date_numeric::${BUILD_DATE_NUMERIC} 44 | echo ::set-output name=commit_hash::${COMMIT_HASH} 45 | echo ::set-output name=github_repo::${GITHUB_REPO} 46 | echo ::set-output name=docker_repo::${DOCKER_REPO} 47 | echo ::set-output name=redhat_quay_repo::${REDHAT_QUAY_REPO} 48 | 49 | echo ::set-output name=php_version::${PHP_VERSION} 50 | 51 | - name: Set up QEMU 52 | id: qemu 53 | uses: docker/setup-qemu-action@v1 54 | with: 55 | image: tonistiigi/binfmt:latest 56 | platforms: all 57 | 58 | - name: Set up Docker Buildx 59 | id: buildx 60 | uses: docker/setup-buildx-action@master 61 | 62 | #- name: Login to GitHub Container Registry 63 | # uses: docker/login-action@v1 64 | # with: 65 | # registry: ghcr.io 66 | # username: ${{ github.repository_owner }} 67 | # password: ${{ secrets.GITHUB_TOKEN }} 68 | 69 | - name: Login to DockerHub 70 | uses: docker/login-action@v1 71 | with: 72 | registry: docker.io 73 | username: ${{ secrets.DOCKER_USERNAME }} 74 | password: ${{ secrets.DOCKER_PASSWORD }} 75 | 76 | #- name: Login to RED HAT Quay.io Container Registry 77 | # uses: docker/login-action@v1 78 | # with: 79 | # registry: quay.io 80 | # username: ${{ secrets.REDHAT_QUAY_USERNAME }} 81 | # password: ${{ secrets.REDHAT_QUAY_PASSWORD }} 82 | 83 | - name: Build-slim 84 | uses: docker/build-push-action@v2 85 | with: 86 | builder: ${{ steps.buildx.outputs.name }} 87 | context: . 88 | file: ./debian.fpm.slim.Dockerfile 89 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6 90 | #pull: true 91 | push: true 92 | build-args: | 93 | BUILD_DATE=${{steps.script.outputs.build_date}} 94 | VCS_REF=${{steps.script.outputs.commit_hash}} 95 | PHP_VERSION=${{steps.script.outputs.php_version}} 96 | tags: | 97 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-slim 98 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-slim-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 99 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-slim 100 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-slim 101 | 102 | - name: Build 103 | uses: docker/build-push-action@v2 104 | with: 105 | builder: ${{ steps.buildx.outputs.name }} 106 | context: . 107 | file: ./debian.fpm.Dockerfile 108 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 109 | pull: true 110 | push: true 111 | build-args: | 112 | BUILD_DATE=${{steps.script.outputs.build_date}} 113 | VCS_REF=${{steps.script.outputs.commit_hash}} 114 | PHP_VERSION=${{steps.script.outputs.php_version}} 115 | tags: | 116 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm 117 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 118 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm 119 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm 120 | 121 | - name: Docker Hub Description 122 | uses: peter-evans/dockerhub-description@v3 123 | with: 124 | username: ${{ secrets.DOCKER_USERNAME }} 125 | password: ${{ secrets.DOCKER_PASSWORD }} 126 | repository: ${{steps.script.outputs.docker_repo}} 127 | short-description: ${{ github.event.repository.description }} 128 | readme-filepath: README.md -------------------------------------------------------------------------------- /.github/workflows/build_docker_images-php8_3-alpine_fpm.yaml: -------------------------------------------------------------------------------- 1 | name: 'build docker images: Alpine + 8.3 PHP-FPM' 2 | 3 | on: 4 | #push: 5 | # branches: 6 | # - 'main' 7 | # - 'master' 8 | # paths: 9 | # - 'alpine.fpm.slim.Dockerfile' 10 | # - 'alpine.fpm.Dockerfile' 11 | # - '.github/workflows/build_docker_images-php8_2-alpine_fpm.yaml' 12 | workflow_dispatch: 13 | schedule: 14 | - cron: '45 2 23 * *' # At 02:45 on day-of-month 23. 15 | 16 | defaults: 17 | run: 18 | shell: bash 19 | 20 | jobs: 21 | docker: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - name: Checkout 25 | uses: actions/checkout@v2 26 | 27 | - name: Shell-Script 28 | id: script 29 | run: | 30 | BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" 31 | BUILD_DATE_NUMERIC="${BUILD_DATE//[^[:digit:]]/}" 32 | COMMIT_HASH=${GITHUB_SHA::8} 33 | GITHUB_REPO=${GITHUB_REPOSITORY,,} 34 | GITHUB_REPO_SHORT=${GITHUB_REPO#*/} 35 | GITHUB_REPO_SHORT=${GITHUB_REPO_SHORT#"docker-"} 36 | DOCKER_REPO=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPO_SHORT} 37 | REDHAT_QUAY_REPO=${{ secrets.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT} 38 | 39 | PHP_VERSION="8.3" 40 | 41 | # Set output parameters to github action. 42 | echo ::set-output name=build_date::${BUILD_DATE} 43 | echo ::set-output name=build_date_numeric::${BUILD_DATE_NUMERIC} 44 | echo ::set-output name=commit_hash::${COMMIT_HASH} 45 | echo ::set-output name=github_repo::${GITHUB_REPO} 46 | echo ::set-output name=docker_repo::${DOCKER_REPO} 47 | echo ::set-output name=redhat_quay_repo::${REDHAT_QUAY_REPO} 48 | 49 | echo ::set-output name=php_version::${PHP_VERSION} 50 | 51 | - name: Set up QEMU 52 | id: qemu 53 | uses: docker/setup-qemu-action@v1 54 | with: 55 | image: tonistiigi/binfmt:latest 56 | platforms: all 57 | 58 | - name: Set up Docker Buildx 59 | id: buildx 60 | uses: docker/setup-buildx-action@master 61 | 62 | #- name: Login to GitHub Container Registry 63 | # uses: docker/login-action@v1 64 | # with: 65 | # registry: ghcr.io 66 | # username: ${{ github.repository_owner }} 67 | # password: ${{ secrets.GITHUB_TOKEN }} 68 | 69 | - name: Login to DockerHub 70 | uses: docker/login-action@v1 71 | with: 72 | registry: docker.io 73 | username: ${{ secrets.DOCKER_USERNAME }} 74 | password: ${{ secrets.DOCKER_PASSWORD }} 75 | 76 | #- name: Login to RED HAT Quay.io Container Registry 77 | # uses: docker/login-action@v1 78 | # with: 79 | # registry: quay.io 80 | # username: ${{ secrets.REDHAT_QUAY_USERNAME }} 81 | # password: ${{ secrets.REDHAT_QUAY_PASSWORD }} 82 | 83 | - name: Build-slim 84 | uses: docker/build-push-action@v2 85 | with: 86 | builder: ${{ steps.buildx.outputs.name }} 87 | context: . 88 | file: ./alpine.fpm.slim.Dockerfile 89 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6 90 | #pull: true 91 | push: true 92 | build-args: | 93 | BUILD_DATE=${{steps.script.outputs.build_date}} 94 | VCS_REF=${{steps.script.outputs.commit_hash}} 95 | PHP_VERSION=${{steps.script.outputs.php_version}} 96 | tags: | 97 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-slim 98 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-slim-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 99 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-slim 100 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-slim 101 | 102 | - name: Build 103 | uses: docker/build-push-action@v2 104 | with: 105 | builder: ${{ steps.buildx.outputs.name }} 106 | context: . 107 | file: ./alpine.fpm.Dockerfile 108 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 109 | pull: true 110 | push: true 111 | build-args: | 112 | BUILD_DATE=${{steps.script.outputs.build_date}} 113 | VCS_REF=${{steps.script.outputs.commit_hash}} 114 | PHP_VERSION=${{steps.script.outputs.php_version}} 115 | tags: | 116 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine 117 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 118 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine 119 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine 120 | 121 | - name: Docker Hub Description 122 | uses: peter-evans/dockerhub-description@v3 123 | with: 124 | username: ${{ secrets.DOCKER_USERNAME }} 125 | password: ${{ secrets.DOCKER_PASSWORD }} 126 | repository: ${{steps.script.outputs.docker_repo}} 127 | short-description: ${{ github.event.repository.description }} 128 | readme-filepath: README.md -------------------------------------------------------------------------------- /.github/workflows/build_docker_images-php8_3-alpine_fpm_nginx.yaml: -------------------------------------------------------------------------------- 1 | name: 'build docker images: Alpine + 8.3 PHP-FPM + NGINX' 2 | 3 | on: 4 | #push: 5 | # branches: 6 | # - 'main' 7 | # - 'master' 8 | # paths: 9 | # - 'alpine.fpm_nginx.slim.Dockerfile' 10 | # - 'alpine.fpm_nginx.Dockerfile' 11 | # - 'alpine.fpm_nginx.extended.Dockerfile' 12 | # - '.github/workflows/build_docker_images-php8_3-alpine_fpm_nginx.yaml' 13 | workflow_dispatch: 14 | schedule: 15 | - cron: '45 5 23 * *' # At 05:45 on day-of-month 23. 16 | 17 | defaults: 18 | run: 19 | shell: bash 20 | 21 | jobs: 22 | docker: 23 | runs-on: ubuntu-latest 24 | steps: 25 | - name: Checkout 26 | uses: actions/checkout@v2 27 | 28 | - name: Shell-Script 29 | id: script 30 | run: | 31 | BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" 32 | BUILD_DATE_NUMERIC="${BUILD_DATE//[^[:digit:]]/}" 33 | COMMIT_HASH=${GITHUB_SHA::8} 34 | GITHUB_REPO=${GITHUB_REPOSITORY,,} 35 | GITHUB_REPO_SHORT=${GITHUB_REPO#*/} 36 | GITHUB_REPO_SHORT=${GITHUB_REPO_SHORT#"docker-"} 37 | DOCKER_REPO=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPO_SHORT} 38 | REDHAT_QUAY_REPO=${{ secrets.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT} 39 | 40 | PHP_VERSION="8.3" 41 | 42 | # Set output parameters to github action. 43 | echo ::set-output name=build_date::${BUILD_DATE} 44 | echo ::set-output name=build_date_numeric::${BUILD_DATE_NUMERIC} 45 | echo ::set-output name=commit_hash::${COMMIT_HASH} 46 | echo ::set-output name=github_repo::${GITHUB_REPO} 47 | echo ::set-output name=docker_repo::${DOCKER_REPO} 48 | echo ::set-output name=redhat_quay_repo::${REDHAT_QUAY_REPO} 49 | 50 | echo ::set-output name=php_version::${PHP_VERSION} 51 | 52 | - name: Set up QEMU 53 | id: qemu 54 | uses: docker/setup-qemu-action@v1 55 | with: 56 | image: tonistiigi/binfmt:latest 57 | platforms: all 58 | 59 | - name: Set up Docker Buildx 60 | id: buildx 61 | uses: docker/setup-buildx-action@master 62 | 63 | #- name: Login to GitHub Container Registry 64 | # uses: docker/login-action@v1 65 | # with: 66 | # registry: ghcr.io 67 | # username: ${{ github.repository_owner }} 68 | # password: ${{ secrets.GITHUB_TOKEN }} 69 | 70 | - name: Login to DockerHub 71 | uses: docker/login-action@v1 72 | with: 73 | registry: docker.io 74 | username: ${{ secrets.DOCKER_USERNAME }} 75 | password: ${{ secrets.DOCKER_PASSWORD }} 76 | 77 | #- name: Login to RED HAT Quay.io Container Registry 78 | # uses: docker/login-action@v1 79 | # with: 80 | # registry: quay.io 81 | # username: ${{ secrets.REDHAT_QUAY_USERNAME }} 82 | # password: ${{ secrets.REDHAT_QUAY_PASSWORD }} 83 | 84 | - name: Build-slim 85 | uses: docker/build-push-action@v2 86 | with: 87 | builder: ${{ steps.buildx.outputs.name }} 88 | context: . 89 | file: ./alpine.fpm_nginx.slim.Dockerfile 90 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6 91 | pull: true 92 | push: true 93 | build-args: | 94 | BUILD_DATE=${{steps.script.outputs.build_date}} 95 | VCS_REF=${{steps.script.outputs.commit_hash}} 96 | PHP_VERSION=${{steps.script.outputs.php_version}} 97 | tags: | 98 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-slim 99 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-slim-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 100 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-slim 101 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-slim 102 | 103 | - name: Build 104 | uses: docker/build-push-action@v2 105 | with: 106 | builder: ${{ steps.buildx.outputs.name }} 107 | context: . 108 | file: ./alpine.fpm_nginx.Dockerfile 109 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 110 | pull: true 111 | push: true 112 | build-args: | 113 | BUILD_DATE=${{steps.script.outputs.build_date}} 114 | VCS_REF=${{steps.script.outputs.commit_hash}} 115 | PHP_VERSION=${{steps.script.outputs.php_version}} 116 | tags: | 117 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine 118 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 119 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine 120 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine 121 | 122 | - name: Build-extended 123 | uses: docker/build-push-action@v2 124 | with: 125 | builder: ${{ steps.buildx.outputs.name }} 126 | context: . 127 | file: ./alpine.fpm_nginx.extended.Dockerfile 128 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 129 | pull: true 130 | push: true 131 | build-args: | 132 | BUILD_DATE=${{steps.script.outputs.build_date}} 133 | VCS_REF=${{steps.script.outputs.commit_hash}} 134 | PHP_VERSION=${{steps.script.outputs.php_version}} 135 | tags: | 136 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 137 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 138 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 139 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 140 | 141 | - name: Docker Hub Description 142 | uses: peter-evans/dockerhub-description@v3 143 | with: 144 | username: ${{ secrets.DOCKER_USERNAME }} 145 | password: ${{ secrets.DOCKER_PASSWORD }} 146 | repository: ${{steps.script.outputs.docker_repo}} 147 | short-description: ${{ github.event.repository.description }} 148 | readme-filepath: README.md -------------------------------------------------------------------------------- /.github/workflows/build_docker_images-php8_3-debian_apache.yaml: -------------------------------------------------------------------------------- 1 | name: 'build docker images: Debian + 8.3 PHP + Apache2' 2 | 3 | on: 4 | #push: 5 | # branches: 6 | # - 'main' 7 | # - 'master' 8 | # paths: 9 | # - 'debian.apache.slim.Dockerfile' 10 | # - 'debian.apache.Dockerfile' 11 | # - '.github/workflows/build_docker_images-php8_3-debian_apache.yaml' 12 | workflow_dispatch: 13 | schedule: 14 | - cron: '45 5 23 * *' # At 05:45 on day-of-month 23. 15 | 16 | defaults: 17 | run: 18 | shell: bash 19 | 20 | jobs: 21 | docker: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - name: Checkout 25 | uses: actions/checkout@v2 26 | 27 | - name: Shell-Script 28 | id: script 29 | run: | 30 | BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" 31 | BUILD_DATE_NUMERIC="${BUILD_DATE//[^[:digit:]]/}" 32 | COMMIT_HASH=${GITHUB_SHA::8} 33 | GITHUB_REPO=${GITHUB_REPOSITORY,,} 34 | GITHUB_REPO_SHORT=${GITHUB_REPO#*/} 35 | GITHUB_REPO_SHORT=${GITHUB_REPO_SHORT#"docker-"} 36 | DOCKER_REPO=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPO_SHORT} 37 | REDHAT_QUAY_REPO=${{ secrets.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT} 38 | 39 | PHP_VERSION="8.3" 40 | 41 | # Set output parameters to github action. 42 | echo ::set-output name=build_date::${BUILD_DATE} 43 | echo ::set-output name=build_date_numeric::${BUILD_DATE_NUMERIC} 44 | echo ::set-output name=commit_hash::${COMMIT_HASH} 45 | echo ::set-output name=github_repo::${GITHUB_REPO} 46 | echo ::set-output name=docker_repo::${DOCKER_REPO} 47 | echo ::set-output name=redhat_quay_repo::${REDHAT_QUAY_REPO} 48 | 49 | echo ::set-output name=php_version::${PHP_VERSION} 50 | 51 | - name: Set up QEMU 52 | id: qemu 53 | uses: docker/setup-qemu-action@v1 54 | with: 55 | image: tonistiigi/binfmt:latest 56 | platforms: all 57 | 58 | - name: Set up Docker Buildx 59 | id: buildx 60 | uses: docker/setup-buildx-action@master 61 | 62 | #- name: Login to GitHub Container Registry 63 | # uses: docker/login-action@v1 64 | # with: 65 | # registry: ghcr.io 66 | # username: ${{ github.repository_owner }} 67 | # password: ${{ secrets.GITHUB_TOKEN }} 68 | 69 | - name: Login to DockerHub 70 | uses: docker/login-action@v1 71 | with: 72 | registry: docker.io 73 | username: ${{ secrets.DOCKER_USERNAME }} 74 | password: ${{ secrets.DOCKER_PASSWORD }} 75 | 76 | #- name: Login to RED HAT Quay.io Container Registry 77 | # uses: docker/login-action@v1 78 | # with: 79 | # registry: quay.io 80 | # username: ${{ secrets.REDHAT_QUAY_USERNAME }} 81 | # password: ${{ secrets.REDHAT_QUAY_PASSWORD }} 82 | 83 | - name: Build-slim 84 | uses: docker/build-push-action@v2 85 | with: 86 | builder: ${{ steps.buildx.outputs.name }} 87 | context: . 88 | file: ./debian.apache.slim.Dockerfile 89 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6 90 | #pull: true 91 | push: true 92 | build-args: | 93 | BUILD_DATE=${{steps.script.outputs.build_date}} 94 | VCS_REF=${{steps.script.outputs.commit_hash}} 95 | PHP_VERSION=${{steps.script.outputs.php_version}} 96 | tags: | 97 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-apache-slim 98 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-apache-slim-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 99 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-apache-slim 100 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-apache-slim 101 | 102 | - name: Build 103 | uses: docker/build-push-action@v2 104 | with: 105 | builder: ${{ steps.buildx.outputs.name }} 106 | context: . 107 | file: ./debian.apache.Dockerfile 108 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 109 | pull: true 110 | push: true 111 | build-args: | 112 | BUILD_DATE=${{steps.script.outputs.build_date}} 113 | VCS_REF=${{steps.script.outputs.commit_hash}} 114 | PHP_VERSION=${{steps.script.outputs.php_version}} 115 | tags: | 116 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-apache 117 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-apache-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 118 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-apache 119 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-apache 120 | 121 | - name: Docker Hub Description 122 | uses: peter-evans/dockerhub-description@v3 123 | with: 124 | username: ${{ secrets.DOCKER_USERNAME }} 125 | password: ${{ secrets.DOCKER_PASSWORD }} 126 | repository: ${{steps.script.outputs.docker_repo}} 127 | short-description: ${{ github.event.repository.description }} 128 | readme-filepath: README.md -------------------------------------------------------------------------------- /.github/workflows/build_docker_images-php8_3-debian_fpm.yaml: -------------------------------------------------------------------------------- 1 | name: 'build docker images: Debian + 8.3 PHP-FPM' 2 | 3 | on: 4 | #push: 5 | # branches: 6 | # - 'main' 7 | # - 'master' 8 | # paths: 9 | # - 'debian.fpm.slim.Dockerfile' 10 | # - 'debian.fpm.Dockerfile' 11 | # - '.github/workflows/build_docker_images-php8_3-debian_fpm.yaml' 12 | workflow_dispatch: 13 | schedule: 14 | - cron: '45 2 23 * *' # At 02:45 on day-of-month 23. 15 | 16 | defaults: 17 | run: 18 | shell: bash 19 | 20 | jobs: 21 | docker: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - name: Checkout 25 | uses: actions/checkout@v2 26 | 27 | - name: Shell-Script 28 | id: script 29 | run: | 30 | BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" 31 | BUILD_DATE_NUMERIC="${BUILD_DATE//[^[:digit:]]/}" 32 | COMMIT_HASH=${GITHUB_SHA::8} 33 | GITHUB_REPO=${GITHUB_REPOSITORY,,} 34 | GITHUB_REPO_SHORT=${GITHUB_REPO#*/} 35 | GITHUB_REPO_SHORT=${GITHUB_REPO_SHORT#"docker-"} 36 | DOCKER_REPO=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPO_SHORT} 37 | REDHAT_QUAY_REPO=${{ secrets.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT} 38 | 39 | PHP_VERSION="8.3" 40 | 41 | # Set output parameters to github action. 42 | echo ::set-output name=build_date::${BUILD_DATE} 43 | echo ::set-output name=build_date_numeric::${BUILD_DATE_NUMERIC} 44 | echo ::set-output name=commit_hash::${COMMIT_HASH} 45 | echo ::set-output name=github_repo::${GITHUB_REPO} 46 | echo ::set-output name=docker_repo::${DOCKER_REPO} 47 | echo ::set-output name=redhat_quay_repo::${REDHAT_QUAY_REPO} 48 | 49 | echo ::set-output name=php_version::${PHP_VERSION} 50 | 51 | - name: Set up QEMU 52 | id: qemu 53 | uses: docker/setup-qemu-action@v1 54 | with: 55 | image: tonistiigi/binfmt:latest 56 | platforms: all 57 | 58 | - name: Set up Docker Buildx 59 | id: buildx 60 | uses: docker/setup-buildx-action@master 61 | 62 | #- name: Login to GitHub Container Registry 63 | # uses: docker/login-action@v1 64 | # with: 65 | # registry: ghcr.io 66 | # username: ${{ github.repository_owner }} 67 | # password: ${{ secrets.GITHUB_TOKEN }} 68 | 69 | - name: Login to DockerHub 70 | uses: docker/login-action@v1 71 | with: 72 | registry: docker.io 73 | username: ${{ secrets.DOCKER_USERNAME }} 74 | password: ${{ secrets.DOCKER_PASSWORD }} 75 | 76 | #- name: Login to RED HAT Quay.io Container Registry 77 | # uses: docker/login-action@v1 78 | # with: 79 | # registry: quay.io 80 | # username: ${{ secrets.REDHAT_QUAY_USERNAME }} 81 | # password: ${{ secrets.REDHAT_QUAY_PASSWORD }} 82 | 83 | - name: Build-slim 84 | uses: docker/build-push-action@v2 85 | with: 86 | builder: ${{ steps.buildx.outputs.name }} 87 | context: . 88 | file: ./debian.fpm.slim.Dockerfile 89 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6 90 | #pull: true 91 | push: true 92 | build-args: | 93 | BUILD_DATE=${{steps.script.outputs.build_date}} 94 | VCS_REF=${{steps.script.outputs.commit_hash}} 95 | PHP_VERSION=${{steps.script.outputs.php_version}} 96 | tags: | 97 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-slim 98 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-slim-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 99 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-slim 100 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-slim 101 | 102 | - name: Build 103 | uses: docker/build-push-action@v2 104 | with: 105 | builder: ${{ steps.buildx.outputs.name }} 106 | context: . 107 | file: ./debian.fpm.Dockerfile 108 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 109 | pull: true 110 | push: true 111 | build-args: | 112 | BUILD_DATE=${{steps.script.outputs.build_date}} 113 | VCS_REF=${{steps.script.outputs.commit_hash}} 114 | PHP_VERSION=${{steps.script.outputs.php_version}} 115 | tags: | 116 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm 117 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 118 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm 119 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm 120 | 121 | - name: Docker Hub Description 122 | uses: peter-evans/dockerhub-description@v3 123 | with: 124 | username: ${{ secrets.DOCKER_USERNAME }} 125 | password: ${{ secrets.DOCKER_PASSWORD }} 126 | repository: ${{steps.script.outputs.docker_repo}} 127 | short-description: ${{ github.event.repository.description }} 128 | readme-filepath: README.md -------------------------------------------------------------------------------- /.github/workflows/build_docker_images-php8_4-alpine_fpm.yaml: -------------------------------------------------------------------------------- 1 | name: 'build docker images: Alpine + 8.4 PHP-FPM' 2 | 3 | on: 4 | #push: 5 | # branches: 6 | # - 'main' 7 | # - 'master' 8 | # paths: 9 | # - 'alpine.fpm.slim.Dockerfile' 10 | # - 'alpine.fpm.Dockerfile' 11 | # - '.github/workflows/build_docker_images-php8_4-alpine_fpm.yaml' 12 | workflow_dispatch: 13 | schedule: 14 | - cron: '45 2 24 * *' # At 02:45 on day-of-month 24. 15 | 16 | defaults: 17 | run: 18 | shell: bash 19 | 20 | jobs: 21 | docker: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - name: Checkout 25 | uses: actions/checkout@v2 26 | 27 | - name: Shell-Script 28 | id: script 29 | run: | 30 | BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" 31 | BUILD_DATE_NUMERIC="${BUILD_DATE//[^[:digit:]]/}" 32 | COMMIT_HASH=${GITHUB_SHA::8} 33 | GITHUB_REPO=${GITHUB_REPOSITORY,,} 34 | GITHUB_REPO_SHORT=${GITHUB_REPO#*/} 35 | GITHUB_REPO_SHORT=${GITHUB_REPO_SHORT#"docker-"} 36 | DOCKER_REPO=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPO_SHORT} 37 | REDHAT_QUAY_REPO=${{ secrets.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT} 38 | 39 | PHP_VERSION="8.4" 40 | 41 | # Set output parameters to github action. 42 | echo ::set-output name=build_date::${BUILD_DATE} 43 | echo ::set-output name=build_date_numeric::${BUILD_DATE_NUMERIC} 44 | echo ::set-output name=commit_hash::${COMMIT_HASH} 45 | echo ::set-output name=github_repo::${GITHUB_REPO} 46 | echo ::set-output name=docker_repo::${DOCKER_REPO} 47 | echo ::set-output name=redhat_quay_repo::${REDHAT_QUAY_REPO} 48 | 49 | echo ::set-output name=php_version::${PHP_VERSION} 50 | 51 | - name: Set up QEMU 52 | id: qemu 53 | uses: docker/setup-qemu-action@v1 54 | with: 55 | image: tonistiigi/binfmt:latest 56 | platforms: all 57 | 58 | - name: Set up Docker Buildx 59 | id: buildx 60 | uses: docker/setup-buildx-action@master 61 | 62 | #- name: Login to GitHub Container Registry 63 | # uses: docker/login-action@v1 64 | # with: 65 | # registry: ghcr.io 66 | # username: ${{ github.repository_owner }} 67 | # password: ${{ secrets.GITHUB_TOKEN }} 68 | 69 | - name: Login to DockerHub 70 | uses: docker/login-action@v1 71 | with: 72 | registry: docker.io 73 | username: ${{ secrets.DOCKER_USERNAME }} 74 | password: ${{ secrets.DOCKER_PASSWORD }} 75 | 76 | #- name: Login to RED HAT Quay.io Container Registry 77 | # uses: docker/login-action@v1 78 | # with: 79 | # registry: quay.io 80 | # username: ${{ secrets.REDHAT_QUAY_USERNAME }} 81 | # password: ${{ secrets.REDHAT_QUAY_PASSWORD }} 82 | 83 | - name: Build-slim 84 | uses: docker/build-push-action@v2 85 | with: 86 | builder: ${{ steps.buildx.outputs.name }} 87 | context: . 88 | file: ./alpine.fpm.slim.Dockerfile 89 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6 90 | #pull: true 91 | push: true 92 | build-args: | 93 | BUILD_DATE=${{steps.script.outputs.build_date}} 94 | VCS_REF=${{steps.script.outputs.commit_hash}} 95 | PHP_VERSION=${{steps.script.outputs.php_version}} 96 | tags: | 97 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-slim 98 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-slim-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 99 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-slim 100 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-slim 101 | 102 | - name: Build 103 | uses: docker/build-push-action@v2 104 | with: 105 | builder: ${{ steps.buildx.outputs.name }} 106 | context: . 107 | file: ./alpine.fpm.Dockerfile 108 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 109 | pull: true 110 | push: true 111 | build-args: | 112 | BUILD_DATE=${{steps.script.outputs.build_date}} 113 | VCS_REF=${{steps.script.outputs.commit_hash}} 114 | PHP_VERSION=${{steps.script.outputs.php_version}} 115 | tags: | 116 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine 117 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 118 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine 119 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine 120 | 121 | - name: Docker Hub Description 122 | uses: peter-evans/dockerhub-description@v3 123 | with: 124 | username: ${{ secrets.DOCKER_USERNAME }} 125 | password: ${{ secrets.DOCKER_PASSWORD }} 126 | repository: ${{steps.script.outputs.docker_repo}} 127 | short-description: ${{ github.event.repository.description }} 128 | readme-filepath: README.md -------------------------------------------------------------------------------- /.github/workflows/build_docker_images-php8_4-alpine_fpm_nginx.yaml: -------------------------------------------------------------------------------- 1 | name: 'build docker images: Alpine + 8.4 PHP-FPM + NGINX' 2 | 3 | on: 4 | #push: 5 | # branches: 6 | # - 'main' 7 | # - 'master' 8 | # paths: 9 | # - 'alpine.fpm_nginx.slim.Dockerfile' 10 | # - 'alpine.fpm_nginx.Dockerfile' 11 | # - 'alpine.fpm_nginx.extended.Dockerfile' 12 | # - '.github/workflows/build_docker_images-php8_4-alpine_fpm_nginx.yaml' 13 | workflow_dispatch: 14 | schedule: 15 | - cron: '45 5 24 * *' # At 05:45 on day-of-month 24. 16 | 17 | defaults: 18 | run: 19 | shell: bash 20 | 21 | jobs: 22 | docker: 23 | runs-on: ubuntu-latest 24 | steps: 25 | - name: Checkout 26 | uses: actions/checkout@v2 27 | 28 | - name: Shell-Script 29 | id: script 30 | run: | 31 | BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" 32 | BUILD_DATE_NUMERIC="${BUILD_DATE//[^[:digit:]]/}" 33 | COMMIT_HASH=${GITHUB_SHA::8} 34 | GITHUB_REPO=${GITHUB_REPOSITORY,,} 35 | GITHUB_REPO_SHORT=${GITHUB_REPO#*/} 36 | GITHUB_REPO_SHORT=${GITHUB_REPO_SHORT#"docker-"} 37 | DOCKER_REPO=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPO_SHORT} 38 | REDHAT_QUAY_REPO=${{ secrets.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT} 39 | 40 | PHP_VERSION="8.4" 41 | 42 | # Set output parameters to github action. 43 | echo ::set-output name=build_date::${BUILD_DATE} 44 | echo ::set-output name=build_date_numeric::${BUILD_DATE_NUMERIC} 45 | echo ::set-output name=commit_hash::${COMMIT_HASH} 46 | echo ::set-output name=github_repo::${GITHUB_REPO} 47 | echo ::set-output name=docker_repo::${DOCKER_REPO} 48 | echo ::set-output name=redhat_quay_repo::${REDHAT_QUAY_REPO} 49 | 50 | echo ::set-output name=php_version::${PHP_VERSION} 51 | 52 | - name: Set up QEMU 53 | id: qemu 54 | uses: docker/setup-qemu-action@v1 55 | with: 56 | image: tonistiigi/binfmt:latest 57 | platforms: all 58 | 59 | - name: Set up Docker Buildx 60 | id: buildx 61 | uses: docker/setup-buildx-action@master 62 | 63 | #- name: Login to GitHub Container Registry 64 | # uses: docker/login-action@v1 65 | # with: 66 | # registry: ghcr.io 67 | # username: ${{ github.repository_owner }} 68 | # password: ${{ secrets.GITHUB_TOKEN }} 69 | 70 | - name: Login to DockerHub 71 | uses: docker/login-action@v1 72 | with: 73 | registry: docker.io 74 | username: ${{ secrets.DOCKER_USERNAME }} 75 | password: ${{ secrets.DOCKER_PASSWORD }} 76 | 77 | #- name: Login to RED HAT Quay.io Container Registry 78 | # uses: docker/login-action@v1 79 | # with: 80 | # registry: quay.io 81 | # username: ${{ secrets.REDHAT_QUAY_USERNAME }} 82 | # password: ${{ secrets.REDHAT_QUAY_PASSWORD }} 83 | 84 | - name: Build-slim 85 | uses: docker/build-push-action@v2 86 | with: 87 | builder: ${{ steps.buildx.outputs.name }} 88 | context: . 89 | file: ./alpine.fpm_nginx.slim.Dockerfile 90 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6 91 | pull: true 92 | push: true 93 | build-args: | 94 | BUILD_DATE=${{steps.script.outputs.build_date}} 95 | VCS_REF=${{steps.script.outputs.commit_hash}} 96 | PHP_VERSION=${{steps.script.outputs.php_version}} 97 | tags: | 98 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-slim 99 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-slim-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 100 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-slim 101 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-slim 102 | 103 | - name: Build 104 | uses: docker/build-push-action@v2 105 | with: 106 | builder: ${{ steps.buildx.outputs.name }} 107 | context: . 108 | file: ./alpine.fpm_nginx.Dockerfile 109 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 110 | pull: true 111 | push: true 112 | build-args: | 113 | BUILD_DATE=${{steps.script.outputs.build_date}} 114 | VCS_REF=${{steps.script.outputs.commit_hash}} 115 | PHP_VERSION=${{steps.script.outputs.php_version}} 116 | tags: | 117 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine 118 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 119 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine 120 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine 121 | 122 | - name: Build-extended 123 | uses: docker/build-push-action@v2 124 | with: 125 | builder: ${{ steps.buildx.outputs.name }} 126 | context: . 127 | file: ./alpine.fpm_nginx.extended.Dockerfile 128 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 129 | pull: true 130 | push: true 131 | build-args: | 132 | BUILD_DATE=${{steps.script.outputs.build_date}} 133 | VCS_REF=${{steps.script.outputs.commit_hash}} 134 | PHP_VERSION=${{steps.script.outputs.php_version}} 135 | tags: | 136 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 137 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 138 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 139 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 140 | 141 | - name: Docker Hub Description 142 | uses: peter-evans/dockerhub-description@v3 143 | with: 144 | username: ${{ secrets.DOCKER_USERNAME }} 145 | password: ${{ secrets.DOCKER_PASSWORD }} 146 | repository: ${{steps.script.outputs.docker_repo}} 147 | short-description: ${{ github.event.repository.description }} 148 | readme-filepath: README.md -------------------------------------------------------------------------------- /.github/workflows/build_docker_images-php8_4-debian_apache.yaml: -------------------------------------------------------------------------------- 1 | name: 'build docker images: Debian + 8.4 PHP + Apache2' 2 | 3 | on: 4 | #push: 5 | # branches: 6 | # - 'main' 7 | # - 'master' 8 | # paths: 9 | # - 'debian.apache.slim.Dockerfile' 10 | # - 'debian.apache.Dockerfile' 11 | # - '.github/workflows/build_docker_images-php8_4-debian_apache.yaml' 12 | workflow_dispatch: 13 | schedule: 14 | - cron: '45 5 24 * *' # At 05:45 on day-of-month 24. 15 | 16 | defaults: 17 | run: 18 | shell: bash 19 | 20 | jobs: 21 | docker: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - name: Checkout 25 | uses: actions/checkout@v2 26 | 27 | - name: Shell-Script 28 | id: script 29 | run: | 30 | BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" 31 | BUILD_DATE_NUMERIC="${BUILD_DATE//[^[:digit:]]/}" 32 | COMMIT_HASH=${GITHUB_SHA::8} 33 | GITHUB_REPO=${GITHUB_REPOSITORY,,} 34 | GITHUB_REPO_SHORT=${GITHUB_REPO#*/} 35 | GITHUB_REPO_SHORT=${GITHUB_REPO_SHORT#"docker-"} 36 | DOCKER_REPO=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPO_SHORT} 37 | REDHAT_QUAY_REPO=${{ secrets.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT} 38 | 39 | PHP_VERSION="8.4" 40 | 41 | # Set output parameters to github action. 42 | echo ::set-output name=build_date::${BUILD_DATE} 43 | echo ::set-output name=build_date_numeric::${BUILD_DATE_NUMERIC} 44 | echo ::set-output name=commit_hash::${COMMIT_HASH} 45 | echo ::set-output name=github_repo::${GITHUB_REPO} 46 | echo ::set-output name=docker_repo::${DOCKER_REPO} 47 | echo ::set-output name=redhat_quay_repo::${REDHAT_QUAY_REPO} 48 | 49 | echo ::set-output name=php_version::${PHP_VERSION} 50 | 51 | - name: Set up QEMU 52 | id: qemu 53 | uses: docker/setup-qemu-action@v1 54 | with: 55 | image: tonistiigi/binfmt:latest 56 | platforms: all 57 | 58 | - name: Set up Docker Buildx 59 | id: buildx 60 | uses: docker/setup-buildx-action@master 61 | 62 | #- name: Login to GitHub Container Registry 63 | # uses: docker/login-action@v1 64 | # with: 65 | # registry: ghcr.io 66 | # username: ${{ github.repository_owner }} 67 | # password: ${{ secrets.GITHUB_TOKEN }} 68 | 69 | - name: Login to DockerHub 70 | uses: docker/login-action@v1 71 | with: 72 | registry: docker.io 73 | username: ${{ secrets.DOCKER_USERNAME }} 74 | password: ${{ secrets.DOCKER_PASSWORD }} 75 | 76 | #- name: Login to RED HAT Quay.io Container Registry 77 | # uses: docker/login-action@v1 78 | # with: 79 | # registry: quay.io 80 | # username: ${{ secrets.REDHAT_QUAY_USERNAME }} 81 | # password: ${{ secrets.REDHAT_QUAY_PASSWORD }} 82 | 83 | - name: Build-slim 84 | uses: docker/build-push-action@v2 85 | with: 86 | builder: ${{ steps.buildx.outputs.name }} 87 | context: . 88 | file: ./debian.apache.slim.Dockerfile 89 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6 90 | #pull: true 91 | push: true 92 | build-args: | 93 | BUILD_DATE=${{steps.script.outputs.build_date}} 94 | VCS_REF=${{steps.script.outputs.commit_hash}} 95 | PHP_VERSION=${{steps.script.outputs.php_version}} 96 | tags: | 97 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-apache-slim 98 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-apache-slim-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 99 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-apache-slim 100 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-apache-slim 101 | 102 | - name: Build 103 | uses: docker/build-push-action@v2 104 | with: 105 | builder: ${{ steps.buildx.outputs.name }} 106 | context: . 107 | file: ./debian.apache.Dockerfile 108 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 109 | pull: true 110 | push: true 111 | build-args: | 112 | BUILD_DATE=${{steps.script.outputs.build_date}} 113 | VCS_REF=${{steps.script.outputs.commit_hash}} 114 | PHP_VERSION=${{steps.script.outputs.php_version}} 115 | tags: | 116 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-apache 117 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-apache-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 118 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-apache 119 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-apache 120 | 121 | - name: Docker Hub Description 122 | uses: peter-evans/dockerhub-description@v3 123 | with: 124 | username: ${{ secrets.DOCKER_USERNAME }} 125 | password: ${{ secrets.DOCKER_PASSWORD }} 126 | repository: ${{steps.script.outputs.docker_repo}} 127 | short-description: ${{ github.event.repository.description }} 128 | readme-filepath: README.md -------------------------------------------------------------------------------- /.github/workflows/build_docker_images-php8_4-debian_fpm.yaml: -------------------------------------------------------------------------------- 1 | name: 'build docker images: Debian + 8.4 PHP-FPM' 2 | 3 | on: 4 | #push: 5 | # branches: 6 | # - 'main' 7 | # - 'master' 8 | # paths: 9 | # - 'debian.fpm.slim.Dockerfile' 10 | # - 'debian.fpm.Dockerfile' 11 | # - '.github/workflows/build_docker_images-php8_4-debian_fpm.yaml' 12 | workflow_dispatch: 13 | schedule: 14 | - cron: '45 2 24 * *' # At 02:45 on day-of-month 24. 15 | 16 | defaults: 17 | run: 18 | shell: bash 19 | 20 | jobs: 21 | docker: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - name: Checkout 25 | uses: actions/checkout@v2 26 | 27 | - name: Shell-Script 28 | id: script 29 | run: | 30 | BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" 31 | BUILD_DATE_NUMERIC="${BUILD_DATE//[^[:digit:]]/}" 32 | COMMIT_HASH=${GITHUB_SHA::8} 33 | GITHUB_REPO=${GITHUB_REPOSITORY,,} 34 | GITHUB_REPO_SHORT=${GITHUB_REPO#*/} 35 | GITHUB_REPO_SHORT=${GITHUB_REPO_SHORT#"docker-"} 36 | DOCKER_REPO=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPO_SHORT} 37 | REDHAT_QUAY_REPO=${{ secrets.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT} 38 | 39 | PHP_VERSION="8.4" 40 | 41 | # Set output parameters to github action. 42 | echo ::set-output name=build_date::${BUILD_DATE} 43 | echo ::set-output name=build_date_numeric::${BUILD_DATE_NUMERIC} 44 | echo ::set-output name=commit_hash::${COMMIT_HASH} 45 | echo ::set-output name=github_repo::${GITHUB_REPO} 46 | echo ::set-output name=docker_repo::${DOCKER_REPO} 47 | echo ::set-output name=redhat_quay_repo::${REDHAT_QUAY_REPO} 48 | 49 | echo ::set-output name=php_version::${PHP_VERSION} 50 | 51 | - name: Set up QEMU 52 | id: qemu 53 | uses: docker/setup-qemu-action@v1 54 | with: 55 | image: tonistiigi/binfmt:latest 56 | platforms: all 57 | 58 | - name: Set up Docker Buildx 59 | id: buildx 60 | uses: docker/setup-buildx-action@master 61 | 62 | #- name: Login to GitHub Container Registry 63 | # uses: docker/login-action@v1 64 | # with: 65 | # registry: ghcr.io 66 | # username: ${{ github.repository_owner }} 67 | # password: ${{ secrets.GITHUB_TOKEN }} 68 | 69 | - name: Login to DockerHub 70 | uses: docker/login-action@v1 71 | with: 72 | registry: docker.io 73 | username: ${{ secrets.DOCKER_USERNAME }} 74 | password: ${{ secrets.DOCKER_PASSWORD }} 75 | 76 | #- name: Login to RED HAT Quay.io Container Registry 77 | # uses: docker/login-action@v1 78 | # with: 79 | # registry: quay.io 80 | # username: ${{ secrets.REDHAT_QUAY_USERNAME }} 81 | # password: ${{ secrets.REDHAT_QUAY_PASSWORD }} 82 | 83 | - name: Build-slim 84 | uses: docker/build-push-action@v2 85 | with: 86 | builder: ${{ steps.buildx.outputs.name }} 87 | context: . 88 | file: ./debian.fpm.slim.Dockerfile 89 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6 90 | #pull: true 91 | push: true 92 | build-args: | 93 | BUILD_DATE=${{steps.script.outputs.build_date}} 94 | VCS_REF=${{steps.script.outputs.commit_hash}} 95 | PHP_VERSION=${{steps.script.outputs.php_version}} 96 | tags: | 97 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-slim 98 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-slim-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 99 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-slim 100 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-slim 101 | 102 | - name: Build 103 | uses: docker/build-push-action@v2 104 | with: 105 | builder: ${{ steps.buildx.outputs.name }} 106 | context: . 107 | file: ./debian.fpm.Dockerfile 108 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 109 | pull: true 110 | push: true 111 | build-args: | 112 | BUILD_DATE=${{steps.script.outputs.build_date}} 113 | VCS_REF=${{steps.script.outputs.commit_hash}} 114 | PHP_VERSION=${{steps.script.outputs.php_version}} 115 | tags: | 116 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm 117 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 118 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm 119 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm 120 | 121 | - name: Docker Hub Description 122 | uses: peter-evans/dockerhub-description@v3 123 | with: 124 | username: ${{ secrets.DOCKER_USERNAME }} 125 | password: ${{ secrets.DOCKER_PASSWORD }} 126 | repository: ${{steps.script.outputs.docker_repo}} 127 | short-description: ${{ github.event.repository.description }} 128 | readme-filepath: README.md -------------------------------------------------------------------------------- /.github/workflows/build_docker_images-php8_x-alpine_fpm_nginx_extended.yaml: -------------------------------------------------------------------------------- 1 | name: 'build docker images: Alpine + 8.x PHP-FPM + NGINX - Extended' 2 | 3 | on: 4 | #push: 5 | # branches: 6 | # - 'main' 7 | # - 'master' 8 | # paths: 9 | # - 'alpine.fpm_nginx.extended.Dockerfile' 10 | # - '.github/workflows/build_docker_images-php8_x-alpine_fpm_nginx_extended.yaml' 11 | workflow_dispatch: 12 | #schedule: 13 | # - cron: '45 8 22 * *' # At 08:45 on day-of-month 22. 14 | 15 | defaults: 16 | run: 17 | shell: bash 18 | 19 | jobs: 20 | php8_1_nginx_extended: 21 | runs-on: ubuntu-latest 22 | steps: 23 | - name: Checkout 24 | uses: actions/checkout@v2 25 | 26 | - name: Shell-Script 27 | id: script 28 | run: | 29 | BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" 30 | BUILD_DATE_NUMERIC="${BUILD_DATE//[^[:digit:]]/}" 31 | COMMIT_HASH=${GITHUB_SHA::8} 32 | GITHUB_REPO=${GITHUB_REPOSITORY,,} 33 | GITHUB_REPO_SHORT=${GITHUB_REPO#*/} 34 | GITHUB_REPO_SHORT=${GITHUB_REPO_SHORT#"docker-"} 35 | DOCKER_REPO=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPO_SHORT} 36 | REDHAT_QUAY_REPO=${{ secrets.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT} 37 | 38 | PHP_VERSION="8.1" 39 | 40 | # Set output parameters to github action. 41 | echo ::set-output name=build_date::${BUILD_DATE} 42 | echo ::set-output name=build_date_numeric::${BUILD_DATE_NUMERIC} 43 | echo ::set-output name=commit_hash::${COMMIT_HASH} 44 | echo ::set-output name=github_repo::${GITHUB_REPO} 45 | echo ::set-output name=docker_repo::${DOCKER_REPO} 46 | echo ::set-output name=redhat_quay_repo::${REDHAT_QUAY_REPO} 47 | 48 | echo ::set-output name=php_version::${PHP_VERSION} 49 | 50 | - name: Set up QEMU 51 | id: qemu 52 | uses: docker/setup-qemu-action@v1 53 | with: 54 | image: tonistiigi/binfmt:latest 55 | platforms: all 56 | 57 | - name: Set up Docker Buildx 58 | id: buildx 59 | uses: docker/setup-buildx-action@master 60 | 61 | #- name: Login to GitHub Container Registry 62 | # uses: docker/login-action@v1 63 | # with: 64 | # registry: ghcr.io 65 | # username: ${{ github.repository_owner }} 66 | # password: ${{ secrets.GITHUB_TOKEN }} 67 | 68 | - name: Login to DockerHub 69 | uses: docker/login-action@v1 70 | with: 71 | registry: docker.io 72 | username: ${{ secrets.DOCKER_USERNAME }} 73 | password: ${{ secrets.DOCKER_PASSWORD }} 74 | 75 | #- name: Login to RED HAT Quay.io Container Registry 76 | # uses: docker/login-action@v1 77 | # with: 78 | # registry: quay.io 79 | # username: ${{ secrets.REDHAT_QUAY_USERNAME }} 80 | # password: ${{ secrets.REDHAT_QUAY_PASSWORD }} 81 | 82 | - name: Build-extended 83 | uses: docker/build-push-action@v2 84 | with: 85 | builder: ${{ steps.buildx.outputs.name }} 86 | context: . 87 | file: ./alpine.fpm_nginx.extended.Dockerfile 88 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 89 | pull: true 90 | push: true 91 | build-args: | 92 | BUILD_DATE=${{steps.script.outputs.build_date}} 93 | VCS_REF=${{steps.script.outputs.commit_hash}} 94 | PHP_VERSION=${{steps.script.outputs.php_version}} 95 | tags: | 96 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 97 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 98 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 99 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 100 | 101 | php8_2_nginx_extended: 102 | runs-on: ubuntu-latest 103 | steps: 104 | - name: Checkout 105 | uses: actions/checkout@v2 106 | 107 | - name: Shell-Script 108 | id: script 109 | run: | 110 | BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" 111 | BUILD_DATE_NUMERIC="${BUILD_DATE//[^[:digit:]]/}" 112 | COMMIT_HASH=${GITHUB_SHA::8} 113 | GITHUB_REPO=${GITHUB_REPOSITORY,,} 114 | GITHUB_REPO_SHORT=${GITHUB_REPO#*/} 115 | GITHUB_REPO_SHORT=${GITHUB_REPO_SHORT#"docker-"} 116 | DOCKER_REPO=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPO_SHORT} 117 | REDHAT_QUAY_REPO=${{ secrets.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT} 118 | 119 | PHP_VERSION="8.2" 120 | 121 | # Set output parameters to github action. 122 | echo ::set-output name=build_date::${BUILD_DATE} 123 | echo ::set-output name=build_date_numeric::${BUILD_DATE_NUMERIC} 124 | echo ::set-output name=commit_hash::${COMMIT_HASH} 125 | echo ::set-output name=github_repo::${GITHUB_REPO} 126 | echo ::set-output name=docker_repo::${DOCKER_REPO} 127 | echo ::set-output name=redhat_quay_repo::${REDHAT_QUAY_REPO} 128 | 129 | echo ::set-output name=php_version::${PHP_VERSION} 130 | 131 | - name: Set up QEMU 132 | id: qemu 133 | uses: docker/setup-qemu-action@v1 134 | with: 135 | image: tonistiigi/binfmt:latest 136 | platforms: all 137 | 138 | - name: Set up Docker Buildx 139 | id: buildx 140 | uses: docker/setup-buildx-action@master 141 | 142 | #- name: Login to GitHub Container Registry 143 | # uses: docker/login-action@v1 144 | # with: 145 | # registry: ghcr.io 146 | # username: ${{ github.repository_owner }} 147 | # password: ${{ secrets.GITHUB_TOKEN }} 148 | 149 | - name: Login to DockerHub 150 | uses: docker/login-action@v1 151 | with: 152 | registry: docker.io 153 | username: ${{ secrets.DOCKER_USERNAME }} 154 | password: ${{ secrets.DOCKER_PASSWORD }} 155 | 156 | #- name: Login to RED HAT Quay.io Container Registry 157 | # uses: docker/login-action@v1 158 | # with: 159 | # registry: quay.io 160 | # username: ${{ secrets.REDHAT_QUAY_USERNAME }} 161 | # password: ${{ secrets.REDHAT_QUAY_PASSWORD }} 162 | 163 | - name: Build-extended 164 | uses: docker/build-push-action@v2 165 | with: 166 | builder: ${{ steps.buildx.outputs.name }} 167 | context: . 168 | file: ./alpine.fpm_nginx.extended.Dockerfile 169 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 170 | pull: true 171 | push: true 172 | build-args: | 173 | BUILD_DATE=${{steps.script.outputs.build_date}} 174 | VCS_REF=${{steps.script.outputs.commit_hash}} 175 | PHP_VERSION=${{steps.script.outputs.php_version}} 176 | tags: | 177 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 178 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 179 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 180 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 181 | 182 | php8_3_nginx_extended: 183 | runs-on: ubuntu-latest 184 | steps: 185 | - name: Checkout 186 | uses: actions/checkout@v2 187 | 188 | - name: Shell-Script 189 | id: script 190 | run: | 191 | BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" 192 | BUILD_DATE_NUMERIC="${BUILD_DATE//[^[:digit:]]/}" 193 | COMMIT_HASH=${GITHUB_SHA::8} 194 | GITHUB_REPO=${GITHUB_REPOSITORY,,} 195 | GITHUB_REPO_SHORT=${GITHUB_REPO#*/} 196 | GITHUB_REPO_SHORT=${GITHUB_REPO_SHORT#"docker-"} 197 | DOCKER_REPO=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPO_SHORT} 198 | REDHAT_QUAY_REPO=${{ secrets.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT} 199 | 200 | PHP_VERSION="8.3" 201 | 202 | # Set output parameters to github action. 203 | echo ::set-output name=build_date::${BUILD_DATE} 204 | echo ::set-output name=build_date_numeric::${BUILD_DATE_NUMERIC} 205 | echo ::set-output name=commit_hash::${COMMIT_HASH} 206 | echo ::set-output name=github_repo::${GITHUB_REPO} 207 | echo ::set-output name=docker_repo::${DOCKER_REPO} 208 | echo ::set-output name=redhat_quay_repo::${REDHAT_QUAY_REPO} 209 | 210 | echo ::set-output name=php_version::${PHP_VERSION} 211 | 212 | - name: Set up QEMU 213 | id: qemu 214 | uses: docker/setup-qemu-action@v1 215 | with: 216 | image: tonistiigi/binfmt:latest 217 | platforms: all 218 | 219 | - name: Set up Docker Buildx 220 | id: buildx 221 | uses: docker/setup-buildx-action@master 222 | 223 | #- name: Login to GitHub Container Registry 224 | # uses: docker/login-action@v1 225 | # with: 226 | # registry: ghcr.io 227 | # username: ${{ github.repository_owner }} 228 | # password: ${{ secrets.GITHUB_TOKEN }} 229 | 230 | - name: Login to DockerHub 231 | uses: docker/login-action@v1 232 | with: 233 | registry: docker.io 234 | username: ${{ secrets.DOCKER_USERNAME }} 235 | password: ${{ secrets.DOCKER_PASSWORD }} 236 | 237 | #- name: Login to RED HAT Quay.io Container Registry 238 | # uses: docker/login-action@v1 239 | # with: 240 | # registry: quay.io 241 | # username: ${{ secrets.REDHAT_QUAY_USERNAME }} 242 | # password: ${{ secrets.REDHAT_QUAY_PASSWORD }} 243 | 244 | - name: Build-extended 245 | uses: docker/build-push-action@v2 246 | with: 247 | builder: ${{ steps.buildx.outputs.name }} 248 | context: . 249 | file: ./alpine.fpm_nginx.extended.Dockerfile 250 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 251 | pull: true 252 | push: true 253 | build-args: | 254 | BUILD_DATE=${{steps.script.outputs.build_date}} 255 | VCS_REF=${{steps.script.outputs.commit_hash}} 256 | PHP_VERSION=${{steps.script.outputs.php_version}} 257 | tags: | 258 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 259 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 260 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 261 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 262 | 263 | php8_4_nginx_extended: 264 | runs-on: ubuntu-latest 265 | steps: 266 | - name: Checkout 267 | uses: actions/checkout@v2 268 | 269 | - name: Shell-Script 270 | id: script 271 | run: | 272 | BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" 273 | BUILD_DATE_NUMERIC="${BUILD_DATE//[^[:digit:]]/}" 274 | COMMIT_HASH=${GITHUB_SHA::8} 275 | GITHUB_REPO=${GITHUB_REPOSITORY,,} 276 | GITHUB_REPO_SHORT=${GITHUB_REPO#*/} 277 | GITHUB_REPO_SHORT=${GITHUB_REPO_SHORT#"docker-"} 278 | DOCKER_REPO=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPO_SHORT} 279 | REDHAT_QUAY_REPO=${{ secrets.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT} 280 | 281 | PHP_VERSION="8.4" 282 | 283 | # Set output parameters to github action. 284 | echo ::set-output name=build_date::${BUILD_DATE} 285 | echo ::set-output name=build_date_numeric::${BUILD_DATE_NUMERIC} 286 | echo ::set-output name=commit_hash::${COMMIT_HASH} 287 | echo ::set-output name=github_repo::${GITHUB_REPO} 288 | echo ::set-output name=docker_repo::${DOCKER_REPO} 289 | echo ::set-output name=redhat_quay_repo::${REDHAT_QUAY_REPO} 290 | 291 | echo ::set-output name=php_version::${PHP_VERSION} 292 | 293 | - name: Set up QEMU 294 | id: qemu 295 | uses: docker/setup-qemu-action@v1 296 | with: 297 | image: tonistiigi/binfmt:latest 298 | platforms: all 299 | 300 | - name: Set up Docker Buildx 301 | id: buildx 302 | uses: docker/setup-buildx-action@master 303 | 304 | #- name: Login to GitHub Container Registry 305 | # uses: docker/login-action@v1 306 | # with: 307 | # registry: ghcr.io 308 | # username: ${{ github.repository_owner }} 309 | # password: ${{ secrets.GITHUB_TOKEN }} 310 | 311 | - name: Login to DockerHub 312 | uses: docker/login-action@v1 313 | with: 314 | registry: docker.io 315 | username: ${{ secrets.DOCKER_USERNAME }} 316 | password: ${{ secrets.DOCKER_PASSWORD }} 317 | 318 | #- name: Login to RED HAT Quay.io Container Registry 319 | # uses: docker/login-action@v1 320 | # with: 321 | # registry: quay.io 322 | # username: ${{ secrets.REDHAT_QUAY_USERNAME }} 323 | # password: ${{ secrets.REDHAT_QUAY_PASSWORD }} 324 | 325 | - name: Build-extended 326 | uses: docker/build-push-action@v2 327 | with: 328 | builder: ${{ steps.buildx.outputs.name }} 329 | context: . 330 | file: ./alpine.fpm_nginx.extended.Dockerfile 331 | platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 332 | pull: true 333 | push: true 334 | build-args: | 335 | BUILD_DATE=${{steps.script.outputs.build_date}} 336 | VCS_REF=${{steps.script.outputs.commit_hash}} 337 | PHP_VERSION=${{steps.script.outputs.php_version}} 338 | tags: | 339 | docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 340 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}} 341 | # ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 342 | # quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended 343 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | temp/ 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020-2021 Tobias Hargesheimer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PHP (with Apache2 or FPM or NGINX) on x86_64 and ARM 2 | 3 | ### Supported tags and respective `Dockerfile` links 4 | - [`8.X-fpm-alpine-slim` (*Dockerfile*)](https://github.com/Tob1as/docker-php/blob/master/alpine.fpm.slim.Dockerfile) 5 | - [`8.X-fpm-alpine` (*Dockerfile*)](https://github.com/Tob1as/docker-php/blob/master/alpine.fpm.Dockerfile) 6 | - [`8.X-fpm-nginx-alpine-slim` (*Dockerfile*)](https://github.com/Tob1as/docker-php/blob/master/alpine.fpm_nginx.slim.Dockerfile) 7 | - [`8.X-fpm-nginx-alpine` (*Dockerfile*)](https://github.com/Tob1as/docker-php/blob/master/alpine.fpm_nginx.Dockerfile) 8 | - [`8.X-fpm-nginx-alpine-extended` (*Dockerfile*)](https://github.com/Tob1as/docker-php/blob/master/alpine.fpm_nginx.extended.Dockerfile) 9 | - [`8.X-apache-slim` (*Dockerfile*)](https://github.com/Tob1as/docker-php/blob/master/debian.apache.slim.Dockerfile) 10 | - [`8.X-apache` (*Dockerfile*)](https://github.com/Tob1as/docker-php/blob/master/debian.apache.Dockerfile) 11 | - [`8.X-fpm-slim` (*Dockerfile*)](https://github.com/Tob1as/docker-php/blob/master/debian.fpm.slim.Dockerfile) 12 | - [`8.X-fpm` (*Dockerfile*)](https://github.com/Tob1as/docker-php/blob/master/debian.fpm.Dockerfile) 13 | 14 | **All container images are available in versions 8.1, 8.2, 8.3 and 8.4.** ;-) 15 | 16 | *How long php versions are supported (End of Life): [https://www.php.net/supported-versions.php](https://www.php.net/supported-versions.php) 17 | Do not use an container image which php version is no longer supported!* 18 | 19 | ### What is PHP? 20 | 21 | PHP is a server-side scripting language designed for web development, but which can also be used as a general-purpose programming language. PHP can be added to straight HTML or it can be used with a variety of templating engines and web frameworks. PHP code is usually processed by an interpreter, which is either implemented as a native module on the web-server or as a common gateway interface (CGI). 22 | 23 | > [wikipedia.org/wiki/PHP](https://en.wikipedia.org/wiki/PHP) 24 | 25 | ![logo](https://raw.githubusercontent.com/docker-library/docs/master/php/logo.png) 26 | 27 | ### About these images: 28 | * based on official images: [DockerHub](https://hub.docker.com/_/php/) / [GitHub](https://github.com/docker-library/php) 29 | * The official base Images have the following PHP extensions enabled by default (check with: ```php -m```): ```Core ctype curl date dom fileinfo filter ftp hash iconv json libxml mbstring mysqlnd openssl pcre PDO pdo_sqlite Phar posix readline Reflection session SimpleXML sodium SPL sqlite3 standard tokenizer xml xmlreader xmlwriter zlib``` 30 | * These images extend the basic images with additional PHP extensions, for example: SQL-Databases, gd, imagick, ldap and more. For details see in dockerfiles. 31 | * For easy install the extensions and get a smaller images it use [php-extension-installer](https://github.com/mlocati/docker-php-extension-installer). 32 | * For information about PHP and extensions see here: [php.net](https://php.net) and [pecl.php.net](https://pecl.php.net). 33 | 34 | ### How to use these images: 35 | * ``` $ docker run --name phpcontainer -v $(pwd)/html:/var/www/html:rw -p PORT:80 -e PHP_ERRORS=1 -e PHP_UPLOAD_MAX_FILESIZE=250 -d tobi312/php:8.1-apache``` 36 | 37 | * Environment Variables: 38 | * `TZ` (set timezone, example: "Europe/Berlin") 39 | * `PHP_ERRORS` (set 1 to enable) 40 | * `PHP_MEM_LIMIT` (set Value in MB, example: 128) 41 | * `PHP_POST_MAX_SIZE` (set Value in MB, example: 250) 42 | * `PHP_UPLOAD_MAX_FILESIZE` (set Value in MB, example: 250) 43 | * `PHP_MAX_FILE_UPLOADS` (set number, example: 20) 44 | * `CREATE_PHPINFO_FILE` (set 1 to enable, for dev and testing) 45 | * `CREATE_INDEX_FILE` (set 1 to enable, for dev and testing) 46 | * PHP-FPM (only): 47 | * `ENABLE_PHP_FPM_STATUS` (set 1 to enable on `/php_fpm_status`) 48 | * Apache2 (only): 49 | * `ENABLE_APACHE_REWRITE` (set 1 to enable) 50 | * `ENABLE_APACHE_ACTIONS` (set 1 to enable) 51 | * `ENABLE_APACHE_SSL` (set 1 to enable) 52 | * `ENABLE_APACHE_HEADERS` (set 1 to enable) 53 | * `ENABLE_APACHE_ALLOWOVERRIDE` (set 1 to enable) 54 | * `ENABLE_APACHE_REMOTEIP` (set 1 to enable (X-Forwarded-For), use this only behind a proxy/loadbalancer!) 55 | * `ENABLE_APACHE_STATUS` (set 1 to enable) 56 | * `ENABLE_APACHE_SSL_REDIRECT` (set 1 to enable, required enable ssl and rewrite) 57 | * `APACHE_SERVER_NAME` (set server name, example: example.com) 58 | * `APACHE_SERVER_ALIAS` (set server name, example: 'www.example.com *.example.com') 59 | * `APACHE_SERVER_ADMIN` (set server admin, example: admin@example.com) 60 | * `DISABLE_APACHE_DEFAULTSITES` (set 1 to disable default sites, then add or mount your own conf in /etc/apache2/sites-enabled) 61 | * NGINX (only): 62 | * `ENABLE_NGINX_REMOTEIP` (set 1 to enable (X-Forwarded-For), use this only behind a proxy/loadbalancer!) 63 | * `ENABLE_NGINX_STATUS` (set 1 to enable) 64 | * or mount own config to `/etc/nginx/conf.d/default.conf` 65 | 66 | * Ports: 67 | * php with apache/nginx: `80` (http), optional: `443` (https) 68 | * php with fpm: `9000` 69 | 70 | * An own Dockerfile?, then here an example with copy additional own entrypoint-file(s) in apache image: 71 | ``` $ echo -e "FROM tobi312/php:8.1-apache\nCOPY *.sh /entrypoint.d/" > Dockerfile``` 72 | 73 | #### Docker-Compose 74 | 75 | ```yaml 76 | version: "2.4" 77 | services: 78 | php: 79 | image: tobi312/php:8.1-apache 80 | container_name: phpcontainer 81 | restart: unless-stopped 82 | ## ports ONLY with apache/nginx: 83 | ports: 84 | - "80:80" 85 | - "443:443" 86 | volumes: 87 | - ./html:/var/www/html:rw 88 | ## optional: folder with own entrypoint-file(s) mount: 89 | #- ./entrypoint.d:/entrypoint.d:ro 90 | ## optional for apache: own ssl-cert and -key: 91 | #- ./ssl/mySSL.crt:/etc/ssl/certs/ssl-cert-snakeoil.pem:ro 92 | #- ./ssl/mySSL.key:/etc/ssl/private/ssl-cert-snakeoil.key:ro 93 | ## optional for nginx: own nginx default.conf: 94 | #- ./nginx_default.conf:/etc/nginx/conf.d/default.conf:ro 95 | environment: 96 | TZ: "Europe/Berlin" 97 | PHP_ERRORS: 1 98 | PHP_MEM_LIMIT: 128 99 | PHP_POST_MAX_SIZE: 250 100 | PHP_UPLOAD_MAX_FILESIZE: 250 101 | PHP_MAX_FILE_UPLOADS: 20 102 | CREATE_PHPINFO_FILE: 0 103 | CREATE_INDEX_FILE: 0 104 | ## next env only with apache 105 | ENABLE_APACHE_REWRITE: 1 106 | ENABLE_APACHE_ACTIONS: 0 107 | ENABLE_APACHE_SSL: 0 108 | ENABLE_APACHE_HEADERS: 0 109 | ENABLE_APACHE_ALLOWOVERRIDE: 1 110 | ENABLE_APACHE_REMOTEIP: 0 111 | ENABLE_APACHE_STATUS: 0 112 | #ENABLE_APACHE_SSL_REDIRECT: 0 113 | #APACHE_SERVER_NAME: "" 114 | #APACHE_SERVER_ALIAS: "" 115 | #APACHE_SERVER_ADMIN: "" 116 | #DISABLE_APACHE_DEFAULTSITES: 0 117 | ## next env only with nginx 118 | #ENABLE_NGINX_REMOTEIP: 0 119 | #ENABLE_NGINX_STATUS: 0 120 | ``` 121 | 122 | ### This Image on 123 | * [DockerHub](https://hub.docker.com/r/tobi312/php/) 124 | * [GitHub](https://github.com/Tob1as/docker-php) 125 | -------------------------------------------------------------------------------- /alpine.fpm.Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PHP_VERSION=8.1 2 | FROM tobi312/php:${PHP_VERSION}-fpm-alpine-slim 3 | ARG PHP_VERSION 4 | 5 | SHELL ["/bin/sh", "-euxo", "pipefail", "-c"] 6 | 7 | LABEL org.opencontainers.image.authors="Tobias Hargesheimer " \ 8 | org.opencontainers.image.title="PHP-FPM" \ 9 | org.opencontainers.image.description="Alpine with PHP-FPM ${PHP_VERSION}" \ 10 | org.opencontainers.image.licenses="MIT" \ 11 | org.opencontainers.image.url="https://hub.docker.com/r/tobi312/php" \ 12 | org.opencontainers.image.source="https://github.com/Tob1as/docker-php" 13 | 14 | # PHP 15 | RUN \ 16 | PHP_EXTENSIONS_LIST=" \ 17 | @composer \ 18 | apcu \ 19 | bcmath \ 20 | bz2 \ 21 | calendar \ 22 | dba \ 23 | enchant \ 24 | exif \ 25 | ffi \ 26 | gd \ 27 | gettext \ 28 | gmp \ 29 | imagick \ 30 | imap \ 31 | intl \ 32 | ldap \ 33 | memcached \ 34 | mongodb \ 35 | mysqli \ 36 | opcache \ 37 | pdo_dblib \ 38 | pdo_mysql \ 39 | pdo_pgsql \ 40 | pgsql \ 41 | pspell \ 42 | redis \ 43 | shmop \ 44 | snmp \ 45 | tidy \ 46 | xsl \ 47 | yaml \ 48 | zip \ 49 | " \ 50 | ; \ 51 | \ 52 | ARCH=`uname -m` ; \ 53 | echo "ARCH=$ARCH" ; \ 54 | install-php-extensions $PHP_EXTENSIONS_LIST ; \ 55 | php -m 56 | -------------------------------------------------------------------------------- /alpine.fpm.slim.Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PHP_VERSION=8.1 2 | FROM php:${PHP_VERSION}-fpm-alpine 3 | ARG PHP_VERSION 4 | 5 | SHELL ["/bin/sh", "-euxo", "pipefail", "-c"] 6 | 7 | LABEL org.opencontainers.image.authors="Tobias Hargesheimer " \ 8 | org.opencontainers.image.title="PHP-FPM" \ 9 | org.opencontainers.image.description="Alpine with PHP-FPM ${PHP_VERSION}" \ 10 | org.opencontainers.image.licenses="MIT" \ 11 | org.opencontainers.image.url="https://hub.docker.com/r/tobi312/php" \ 12 | org.opencontainers.image.source="https://github.com/Tob1as/docker-php" 13 | 14 | ENV LANG C.UTF-8 15 | ENV TERM=xterm 16 | ENV CFLAGS="-I/usr/src/php" 17 | 18 | # tzdata to set the timezones through the environment variables 19 | RUN apk --no-cache add \ 20 | tzdata 21 | 22 | # PHP-EXTENSION-INSTALLER 23 | RUN \ 24 | PHP_EXTENSION_INSTALLER_VERSION=$(curl -s https://api.github.com/repos/mlocati/docker-php-extension-installer/releases/latest | grep 'tag_name' | cut -d '"' -f4) ; \ 25 | echo "install-php-extensions Version: ${PHP_EXTENSION_INSTALLER_VERSION}" ; \ 26 | curl -sSL https://github.com/mlocati/docker-php-extension-installer/releases/download/${PHP_EXTENSION_INSTALLER_VERSION}/install-php-extensions -o /usr/local/bin/install-php-extensions ; \ 27 | chmod +x /usr/local/bin/install-php-extensions 28 | 29 | # PHP 30 | RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini 31 | 32 | # ENTRYPOINT 33 | COPY entrypoint.sh /usr/local/bin/entrypoint.sh 34 | RUN chmod +x /usr/local/bin/entrypoint.sh ; \ 35 | #sed -i -e 's/\r$//' /usr/local/bin/entrypoint.sh ; \ 36 | mkdir /entrypoint.d 37 | 38 | #WORKDIR /var/www/html 39 | VOLUME /var/www/html 40 | 41 | EXPOSE 9000 42 | 43 | ENTRYPOINT ["entrypoint.sh"] 44 | CMD ["php-fpm"] 45 | -------------------------------------------------------------------------------- /alpine.fpm_nginx.Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PHP_VERSION=8.1 2 | FROM tobi312/php:${PHP_VERSION}-fpm-nginx-alpine-slim 3 | ARG PHP_VERSION 4 | 5 | SHELL ["/bin/sh", "-euxo", "pipefail", "-c"] 6 | 7 | LABEL org.opencontainers.image.authors="Tobias Hargesheimer " \ 8 | org.opencontainers.image.title="PHP-FPM+NGINX" \ 9 | org.opencontainers.image.description="Alpine with PHP-FPM ${PHP_VERSION} and NGINX" \ 10 | org.opencontainers.image.licenses="MIT" \ 11 | org.opencontainers.image.url="https://hub.docker.com/r/tobi312/php" \ 12 | org.opencontainers.image.source="https://github.com/Tob1as/docker-php" 13 | 14 | # PHP 15 | RUN \ 16 | PHP_EXTENSIONS_LIST=" \ 17 | @composer \ 18 | apcu \ 19 | bcmath \ 20 | bz2 \ 21 | calendar \ 22 | dba \ 23 | enchant \ 24 | exif \ 25 | ffi \ 26 | gd \ 27 | gettext \ 28 | gmp \ 29 | imagick \ 30 | imap \ 31 | intl \ 32 | ldap \ 33 | memcached \ 34 | mongodb \ 35 | mysqli \ 36 | opcache \ 37 | pdo_dblib \ 38 | pdo_mysql \ 39 | pdo_pgsql \ 40 | pgsql \ 41 | pspell \ 42 | redis \ 43 | shmop \ 44 | snmp \ 45 | tidy \ 46 | xsl \ 47 | yaml \ 48 | zip \ 49 | " \ 50 | ; \ 51 | \ 52 | ARCH=`uname -m` ; \ 53 | echo "ARCH=$ARCH" ; \ 54 | install-php-extensions $PHP_EXTENSIONS_LIST ; \ 55 | php -m 56 | -------------------------------------------------------------------------------- /alpine.fpm_nginx.extended.Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PHP_VERSION=8.1 2 | FROM tobi312/php:${PHP_VERSION}-fpm-nginx-alpine 3 | ARG PHP_VERSION 4 | 5 | ## example build command: docker build -t tobi312/php:8.1-fpm-nginx-alpine-extended --build-arg PHP_VERSION=8.1 -f alpine.fpm_nginx.extended.Dockerfile . 6 | 7 | # set environment variable 8 | ENV ENABLE_NGINX_STATUS=1 \ 9 | ENABLE_PHP_FPM_STATUS=1 \ 10 | WWW_USER=www-data \ 11 | NGINX_EXPORTER="--nginx.scrape-uri='http://localhost/nginx_status' --web.listen-address=':9113' --web.telemetry-path='/metrics' --no-nginx.ssl-verify" \ 12 | PHP_FPM_EXPORTER="server --phpfpm.scrape-uri='tcp://127.0.0.1:9000/php_fpm_status' --web.listen-address=':9253' --web.telemetry-path='/metrics' --log.level=info --phpfpm.fix-process-count=false" 13 | 14 | # install tools 15 | #RUN apk --no-cache add \ 16 | # curl \ 17 | # unzip \ 18 | # ca-certificates \ 19 | # tzdata 20 | 21 | # install Nginx Exporter (latest release version) 22 | RUN \ 23 | ARCH=`uname -m` ; \ 24 | echo "ARCH=$ARCH" ; \ 25 | if [ "$ARCH" == "x86_64" ]; then \ 26 | TARGETARCH="amd64"; \ 27 | INSTALL="1" ; \ 28 | elif [ "$ARCH" == "aarch64" ]; then \ 29 | TARGETARCH="arm64"; \ 30 | INSTALL="1" ; \ 31 | else \ 32 | #echo "unsupported arch" ; \ 33 | TARGETARCH="" ; \ 34 | INSTALL="0" ; \ 35 | fi ; \ 36 | if [ "$INSTALL" -eq "1" ]; then \ 37 | NGINX_EXPORTER_VERSION=$(curl -s https://api.github.com/repos/nginxinc/nginx-prometheus-exporter/releases/latest | grep 'tag_name' | cut -d '"' -f4) ; \ 38 | echo "NGINX_EXPORTER_VERSION=${NGINX_EXPORTER_VERSION}" ; \ 39 | curl -sSL https://github.com/nginxinc/nginx-prometheus-exporter/releases/download/${NGINX_EXPORTER_VERSION}/nginx-prometheus-exporter_$(echo ${NGINX_EXPORTER_VERSION} | sed 's/[^.0-9][^.0-9]*//g')_linux_${TARGETARCH}.tar.gz | tar xvz -C /usr/local/bin ; \ 40 | chmod +x /usr/local/bin/nginx-prometheus-exporter \ 41 | ; \ 42 | { \ 43 | echo ''; \ 44 | echo '[program:exporter-nginx]'; \ 45 | echo 'command=sh -c "sleep 5 && /usr/local/bin/nginx-prometheus-exporter %(ENV_NGINX_EXPORTER)s"'; \ 46 | echo "user=%(ENV_WWW_USER)s"; \ 47 | echo 'stdout_logfile=/dev/stdout'; \ 48 | echo 'stdout_logfile_maxbytes=0'; \ 49 | echo 'stderr_logfile=/dev/stderr'; \ 50 | echo 'stderr_logfile_maxbytes=0'; \ 51 | echo 'priority=30'; \ 52 | echo 'autorestart=unexpected'; \ 53 | } >> /etc/supervisor.d/supervisord.ini ; \ 54 | fi 55 | 56 | # install PHP-FPM Exporter (latest release version) (or https://github.com/bakins/php-fpm-exporter ?) 57 | RUN \ 58 | ARCH=`uname -m` ; \ 59 | echo "ARCH=$ARCH" ; \ 60 | if [ "$ARCH" == "x86_64" ]; then \ 61 | TARGETARCH="amd64"; \ 62 | INSTALL="1" ; \ 63 | elif [ "$ARCH" == "aarch64" ]; then \ 64 | TARGETARCH="arm64"; \ 65 | INSTALL="1" ; \ 66 | else \ 67 | #echo "unsupported arch" ; \ 68 | TARGETARCH="" ; \ 69 | INSTALL="0" ; \ 70 | fi ; \ 71 | if [ "$INSTALL" -eq "1" ]; then \ 72 | PHP_FPM_EXPORTER_VERSION=$(curl -s https://api.github.com/repos/hipages/php-fpm_exporter/releases/latest | grep 'tag_name' | cut -d '"' -f4) ; \ 73 | echo "PHP_FPM_EXPORTER_VERSION=${PHP_FPM_EXPORTER_VERSION}" ; \ 74 | curl -sSL https://github.com/hipages/php-fpm_exporter/releases/download/${PHP_FPM_EXPORTER_VERSION}/php-fpm_exporter_$(echo ${PHP_FPM_EXPORTER_VERSION} | sed 's/[^.0-9][^.0-9]*//g')_linux_${TARGETARCH} -o /usr/local/bin/php-fpm-exporter ; \ 75 | chmod +x /usr/local/bin/php-fpm-exporter \ 76 | ; \ 77 | { \ 78 | echo ''; \ 79 | echo '[program:exporter-phpfpm]'; \ 80 | echo 'command=sh -c "sleep 5 && /usr/local/bin/php-fpm-exporter %(ENV_PHP_FPM_EXPORTER)s"'; \ 81 | echo "user=%(ENV_WWW_USER)s"; \ 82 | echo 'stdout_logfile=/dev/stdout'; \ 83 | echo 'stdout_logfile_maxbytes=0'; \ 84 | echo 'stderr_logfile=/dev/stderr'; \ 85 | echo 'stderr_logfile_maxbytes=0'; \ 86 | echo 'priority=30'; \ 87 | echo 'autorestart=unexpected'; \ 88 | } >> /etc/supervisor.d/supervisord.ini ; \ 89 | fi 90 | 91 | # envsubst for templating 92 | RUN apk add --no-cache --virtual .gettext gettext ; \ 93 | mv /usr/bin/envsubst /tmp/ \ 94 | ; \ 95 | runDeps="$( \ 96 | scanelf --needed --nobanner /tmp/envsubst \ 97 | | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ 98 | | sort -u \ 99 | | xargs -r apk info --installed \ 100 | | sort -u \ 101 | )" \ 102 | ; \ 103 | apk add --no-cache $runDeps ; \ 104 | apk del .gettext ; \ 105 | mv /tmp/envsubst /usr/local/bin/ \ 106 | ; \ 107 | curl -sSL https://github.com/nginxinc/docker-nginx/raw/master/entrypoint/20-envsubst-on-templates.sh -o /entrypoint.d/20-envsubst-on-templates.sh ; \ 108 | chmod +x /entrypoint.d/20-envsubst-on-templates.sh ; \ 109 | mkdir /etc/nginx/templates 110 | 111 | EXPOSE 80 443 9113 9253 112 | -------------------------------------------------------------------------------- /alpine.fpm_nginx.extended.git.Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PHP_VERSION=8.1 2 | ARG ARCH="amd64" 3 | 4 | FROM golang:alpine AS builder 5 | ARG ARCH 6 | 7 | ENV GOPATH /go 8 | ENV CGO_ENABLED 0 9 | ENV GO111MODULE on 10 | ENV GOOS linux 11 | ENV GOARCH ${ARCH} 12 | 13 | RUN \ 14 | apk add --no-cache git ; \ 15 | cd /go ; \ 16 | PHP_FPM_EXPORTER_VERSION=$(wget -qO- https://api.github.com/repos/hipages/php-fpm_exporter/releases/latest | grep 'tag_name' | cut -d '"' -f4) ; \ 17 | echo "PHP_FPM_EXPORTER_VERSION=${PHP_FPM_EXPORTER_VERSION}" ; \ 18 | git clone --branch ${PHP_FPM_EXPORTER_VERSION} https://github.com/hipages/php-fpm_exporter.git ; \ 19 | cd php-fpm_exporter/ ; \ 20 | BUILD_VERSION=$(echo ${PHP_FPM_EXPORTER_VERSION} | sed 's/[^.0-9][^.0-9]*//g') ; \ 21 | VCS_REF=$(git rev-parse HEAD) ; \ 22 | BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') ; \ 23 | #go get -d -v ; \ 24 | go build -trimpath -a -v -ldflags "-X main.version=${BUILD_VERSION} -X main.commit=${VCS_REF} -X main.date=${BUILD_DATE}" -o "/go/bin/php-fpm-exporter" ; \ 25 | echo "php-fpm_exporter build finished!" 26 | 27 | FROM tobi312/php:${PHP_VERSION}-fpm-nginx-alpine 28 | ARG PHP_VERSION 29 | ARG ARCH 30 | 31 | # set environment variable 32 | ENV ENABLE_NGINX_STATUS=1 \ 33 | ENABLE_PHP_FPM_STATUS=1 \ 34 | WWW_USER=www-data \ 35 | ARCH="${ARCH}" \ 36 | TARGETARCH="${ARCH}" \ 37 | NGINX_EXPORTER="--nginx.scrape-uri='http://localhost/nginx_status' --web.listen-address=':9113' --web.telemetry-path='/metrics' --no-nginx.ssl-verify" \ 38 | PHP_FPM_EXPORTER="server --phpfpm.scrape-uri='tcp://127.0.0.1:9000/php_fpm_status' --web.listen-address=':9253' --web.telemetry-path='/metrics' --log.level=info --phpfpm.fix-process-count=false" 39 | 40 | # install tools 41 | #RUN apk --no-cache add \ 42 | # curl \ 43 | # unzip \ 44 | # ca-certificates \ 45 | # tzdata 46 | 47 | # install Nginx Exporter (latest release version) 48 | RUN \ 49 | NGINX_EXPORTER_VERSION=$(curl -s https://api.github.com/repos/nginxinc/nginx-prometheus-exporter/releases/latest | grep 'tag_name' | cut -d '"' -f4) ; \ 50 | echo "NGINX_EXPORTER_VERSION=${NGINX_EXPORTER_VERSION}" ; \ 51 | curl -sSL https://github.com/nginxinc/nginx-prometheus-exporter/releases/download/${NGINX_EXPORTER_VERSION}/nginx-prometheus-exporter_$(echo ${NGINX_EXPORTER_VERSION} | sed 's/[^.0-9][^.0-9]*//g')_linux_${TARGETARCH}.tar.gz | tar xvz -C /usr/local/bin ; \ 52 | chmod +x /usr/local/bin/nginx-prometheus-exporter \ 53 | ; \ 54 | { \ 55 | echo ''; \ 56 | echo '[program:exporter-nginx]'; \ 57 | echo 'command=sh -c "sleep 5 && /usr/local/bin/nginx-prometheus-exporter %(ENV_NGINX_EXPORTER)s"'; \ 58 | echo "user=%(ENV_WWW_USER)s"; \ 59 | echo 'stdout_logfile=/dev/stdout'; \ 60 | echo 'stdout_logfile_maxbytes=0'; \ 61 | echo 'stderr_logfile=/dev/stderr'; \ 62 | echo 'stderr_logfile_maxbytes=0'; \ 63 | echo 'priority=30'; \ 64 | echo 'autorestart=unexpected'; \ 65 | } >> /etc/supervisor.d/supervisord.ini 66 | 67 | # install PHP-FPM Exporter (latest release version) 68 | COPY --from=builder /go/bin/php-fpm-exporter /usr/local/bin/php-fpm-exporter 69 | RUN \ 70 | chmod +x /usr/local/bin/php-fpm-exporter \ 71 | ; \ 72 | { \ 73 | echo ''; \ 74 | echo '[program:exporter-phpfpm]'; \ 75 | echo 'command=sh -c "sleep 5 && /usr/local/bin/php-fpm-exporter %(ENV_PHP_FPM_EXPORTER)s"'; \ 76 | echo "user=%(ENV_WWW_USER)s"; \ 77 | echo 'stdout_logfile=/dev/stdout'; \ 78 | echo 'stdout_logfile_maxbytes=0'; \ 79 | echo 'stderr_logfile=/dev/stderr'; \ 80 | echo 'stderr_logfile_maxbytes=0'; \ 81 | echo 'priority=30'; \ 82 | echo 'autorestart=unexpected'; \ 83 | } >> /etc/supervisor.d/supervisord.ini 84 | 85 | # envsubst for templating 86 | RUN apk add --no-cache --virtual .gettext gettext ; \ 87 | mv /usr/bin/envsubst /tmp/ \ 88 | ; \ 89 | runDeps="$( \ 90 | scanelf --needed --nobanner /tmp/envsubst \ 91 | | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ 92 | | sort -u \ 93 | | xargs -r apk info --installed \ 94 | | sort -u \ 95 | )" \ 96 | ; \ 97 | apk add --no-cache $runDeps ; \ 98 | apk del .gettext ; \ 99 | mv /tmp/envsubst /usr/local/bin/ \ 100 | ; \ 101 | curl -sSL https://github.com/nginxinc/docker-nginx/raw/master/entrypoint/20-envsubst-on-templates.sh -o /entrypoint.d/20-envsubst-on-templates.sh ; \ 102 | chmod +x /entrypoint.d/20-envsubst-on-templates.sh ; \ 103 | mkdir /etc/nginx/templates 104 | 105 | EXPOSE 80 443 9113 9253 -------------------------------------------------------------------------------- /alpine.fpm_nginx.slim.Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PHP_VERSION=8.1 2 | FROM php:${PHP_VERSION}-fpm-alpine 3 | ARG PHP_VERSION 4 | 5 | SHELL ["/bin/sh", "-euxo", "pipefail", "-c"] 6 | 7 | LABEL org.opencontainers.image.authors="Tobias Hargesheimer " \ 8 | org.opencontainers.image.title="PHP-FPM+NGINX" \ 9 | org.opencontainers.image.description="Alpine with PHP-FPM ${PHP_VERSION} and NGINX" \ 10 | org.opencontainers.image.licenses="MIT" \ 11 | org.opencontainers.image.url="https://hub.docker.com/r/tobi312/php" \ 12 | org.opencontainers.image.source="https://github.com/Tob1as/docker-php" 13 | 14 | ENV LANG C.UTF-8 15 | ENV TERM=xterm 16 | ENV CFLAGS="-I/usr/src/php" 17 | #ENV WWW_USER=www-data 18 | 19 | # NGINX + Supervisor 20 | RUN apk --no-cache add \ 21 | tzdata \ 22 | supervisor \ 23 | nginx \ 24 | ; \ 25 | #mkdir -p /run/nginx ; \ 26 | mkdir -p /etc/ssl/nginx ; \ 27 | mkdir /etc/supervisor.d/ ; \ 28 | chown -R www-data:www-data /var/lib/nginx/ ; \ 29 | mv /etc/nginx/http.d /etc/nginx/conf.d ; \ 30 | ln -sf /dev/stdout /var/log/nginx/access.log ; \ 31 | ln -sf /dev/stderr /var/log/nginx/error.log ; \ 32 | #ln -s /etc/nginx/conf.d /etc/nginx/http.d ; \ 33 | #sed -i "s+/etc/nginx/http.d+/etc/nginx/conf.d+g" /etc/nginx/nginx.conf ; \ 34 | #sed -i "s/user nginx;/user www-data;/g" /etc/nginx/nginx.conf ; \ 35 | #sed -i "s/ssl_session_cache shared:SSL:2m;/#ssl_session_cache shared:SSL:2m;/g" /etc/nginx/nginx.conf ; \ 36 | #sed -i "s/client_max_body_size .*/client_max_body_size 0;/" /etc/nginx/nginx.conf ; \ 37 | \ 38 | { \ 39 | echo '[supervisord]'; \ 40 | echo 'nodaemon=true'; \ 41 | echo 'user=root'; \ 42 | echo 'directory=/tmp'; \ 43 | echo 'pidfile=/tmp/supervisord.pid'; \ 44 | echo 'logfile=/tmp/supervisord.log'; \ 45 | echo 'logfile_maxbytes=50MB'; \ 46 | echo 'logfile_backups=0'; \ 47 | echo 'loglevel=info'; \ 48 | echo ''; \ 49 | echo '[program:php-fpm]'; \ 50 | echo 'command=/usr/local/sbin/php-fpm -F'; \ 51 | #echo "user=%(ENV_WWW_USER)s"; \ 52 | echo 'stdout_logfile=/dev/stdout'; \ 53 | echo 'stdout_logfile_maxbytes=0'; \ 54 | echo 'stderr_logfile=/dev/stderr'; \ 55 | echo 'stderr_logfile_maxbytes=0'; \ 56 | echo 'priority=10'; \ 57 | echo 'autorestart=unexpected'; \ 58 | echo ''; \ 59 | echo '[program:nginx]'; \ 60 | echo "command=/usr/sbin/nginx -g 'daemon off;'"; \ 61 | #echo "user=%(ENV_WWW_USER)s"; \ 62 | echo 'stdout_logfile=/dev/stdout'; \ 63 | echo 'stdout_logfile_maxbytes=0'; \ 64 | echo 'stderr_logfile=/dev/stderr'; \ 65 | echo 'stderr_logfile_maxbytes=0'; \ 66 | echo 'priority=20'; \ 67 | echo 'autorestart=unexpected'; \ 68 | } > /etc/supervisor.d/supervisord.ini \ 69 | ; \ 70 | { \ 71 | echo ''; \ 72 | echo 'user www-data;'; \ 73 | echo 'worker_processes auto;'; \ 74 | echo ''; \ 75 | echo 'error_log /var/log/nginx/error.log notice;'; \ 76 | echo 'pid /var/run/nginx.pid;'; \ 77 | echo ''; \ 78 | echo ''; \ 79 | echo 'events {'; \ 80 | echo ' worker_connections 1024;'; \ 81 | echo '}'; \ 82 | echo ''; \ 83 | echo ''; \ 84 | echo 'http {'; \ 85 | echo ' include /etc/nginx/mime.types;'; \ 86 | echo ' default_type application/octet-stream;'; \ 87 | echo $' log_format main \'$remote_addr - $remote_user [$time_local] "$request" \''; \ 88 | echo $' \'$status $body_bytes_sent "$http_referer" \''; \ 89 | echo $' \'"$http_user_agent" "$http_x_forwarded_for"\';'; \ 90 | echo ''; \ 91 | echo ' access_log /var/log/nginx/access.log main;'; \ 92 | echo ''; \ 93 | echo ' sendfile on;'; \ 94 | echo ' #tcp_nopush on;'; \ 95 | echo ''; \ 96 | echo ' keepalive_timeout 65;'; \ 97 | echo ''; \ 98 | echo ' #gzip on;'; \ 99 | echo ''; \ 100 | echo ' include /etc/nginx/conf.d/*.conf;'; \ 101 | echo '}'; \ 102 | echo ''; \ 103 | } > /etc/nginx/nginx.conf \ 104 | ; \ 105 | { \ 106 | echo 'server {'; \ 107 | echo ' listen 80 default_server;'; \ 108 | echo ' listen [::]:80 default_server;'; \ 109 | echo ' #server_name _;'; \ 110 | echo ' '; \ 111 | echo ' ##REPLACE_WITH_REMOTEIP_CONFIG##'; \ 112 | echo ' '; \ 113 | echo ' #client_max_body_size 64M;'; \ 114 | echo ' '; \ 115 | echo ' ##REPLACE_WITH_NGINXSTATUS_CONFIG##'; \ 116 | echo ' '; \ 117 | echo ' ##REPLACE_WITH_PHPFPMSTATUS_CONFIG##'; \ 118 | echo ' '; \ 119 | echo ' root /var/www/html;'; \ 120 | echo ' index index.html index.htm index.php;'; \ 121 | echo ' '; \ 122 | echo ' location / {'; \ 123 | echo ' try_files $uri $uri/ =404;'; \ 124 | echo ' }'; \ 125 | echo ' '; \ 126 | echo ' # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000'; \ 127 | echo ' location ~ \.php$ {'; \ 128 | echo ' try_files $uri =404;'; \ 129 | echo ' fastcgi_pass 127.0.0.1:9000;'; \ 130 | echo ' fastcgi_split_path_info ^(.+\.php)(/.+)$;'; \ 131 | echo ' fastcgi_index index.php;'; \ 132 | echo ' fastcgi_param SCRIPT_NAME $fastcgi_script_name;'; \ 133 | echo ' fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;'; \ 134 | echo ' #fastcgi_param REMOTE_ADDR $http_x_forwarded_for;'; \ 135 | echo ' include fastcgi_params;'; \ 136 | echo ' }'; \ 137 | echo ' '; \ 138 | echo ' '; \ 139 | echo ' location = /favicon.ico { log_not_found off; access_log off; }'; \ 140 | echo ' location = /robots.txt { log_not_found off; access_log off; }'; \ 141 | echo ' '; \ 142 | echo '}'; \ 143 | } > /etc/nginx/conf.d/default.conf 144 | 145 | # PHP-EXTENSION-INSTALLER 146 | RUN \ 147 | PHP_EXTENSION_INSTALLER_VERSION=$(curl -s https://api.github.com/repos/mlocati/docker-php-extension-installer/releases/latest | grep 'tag_name' | cut -d '"' -f4) ; \ 148 | echo "install-php-extensions Version: ${PHP_EXTENSION_INSTALLER_VERSION}" ; \ 149 | curl -sSL https://github.com/mlocati/docker-php-extension-installer/releases/download/${PHP_EXTENSION_INSTALLER_VERSION}/install-php-extensions -o /usr/local/bin/install-php-extensions ; \ 150 | chmod +x /usr/local/bin/install-php-extensions 151 | 152 | # PHP 153 | RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini 154 | 155 | # ENTRYPOINT 156 | COPY entrypoint.sh /usr/local/bin/entrypoint.sh 157 | RUN chmod +x /usr/local/bin/entrypoint.sh ; \ 158 | #sed -i -e 's/\r$//' /usr/local/bin/entrypoint.sh ; \ 159 | mkdir /entrypoint.d 160 | 161 | #WORKDIR /var/www/html 162 | VOLUME /var/www/html 163 | 164 | EXPOSE 80 443 165 | 166 | #STOPSIGNAL SIGQUIT 167 | 168 | ENTRYPOINT ["entrypoint.sh"] 169 | CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor.d/supervisord.ini"] 170 | -------------------------------------------------------------------------------- /conf/default.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server; 4 | #server_name _; 5 | 6 | ##REPLACE_WITH_REMOTEIP_CONFIG## 7 | 8 | #client_max_body_size 64M; 9 | 10 | ##REPLACE_WITH_NGINXSTATUS_CONFIG## 11 | 12 | ##REPLACE_WITH_PHPFPMSTATUS_CONFIG## 13 | 14 | root /var/www/html; 15 | index index.html index.htm index.php; 16 | 17 | location / { 18 | try_files $uri $uri/ =404; 19 | } 20 | 21 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 22 | location ~ \.php$ { 23 | try_files $uri =404; 24 | fastcgi_pass 127.0.0.1:9000; 25 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 26 | fastcgi_index index.php; 27 | fastcgi_param SCRIPT_NAME $fastcgi_script_name; 28 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 29 | #fastcgi_param REMOTE_ADDR $http_x_forwarded_for; 30 | include fastcgi_params; 31 | } 32 | 33 | 34 | location = /favicon.ico { log_not_found off; access_log off; } 35 | location = /robots.txt { log_not_found off; access_log off; } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /conf/nginx.conf: -------------------------------------------------------------------------------- 1 | 2 | user www-data; 3 | worker_processes auto; 4 | 5 | error_log /var/log/nginx/error.log notice; 6 | pid /var/run/nginx.pid; 7 | 8 | 9 | events { 10 | worker_connections 1024; 11 | } 12 | 13 | 14 | http { 15 | include /etc/nginx/mime.types; 16 | default_type application/octet-stream; 17 | 18 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 19 | '$status $body_bytes_sent "$http_referer" ' 20 | '"$http_user_agent" "$http_x_forwarded_for"'; 21 | 22 | access_log /var/log/nginx/access.log main; 23 | 24 | sendfile on; 25 | #tcp_nopush on; 26 | 27 | keepalive_timeout 65; 28 | 29 | #gzip on; 30 | 31 | include /etc/nginx/conf.d/*.conf; 32 | } 33 | -------------------------------------------------------------------------------- /conf/supervisord.ini: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | user=root 4 | directory=/tmp 5 | pidfile=/tmp/supervisord.pid 6 | logfile=/dev/stdout 7 | logfile_maxbytes=0 8 | logfile_backups=0 9 | loglevel=info 10 | #loglevel=%(ENV_LOGLEVEL)s 11 | 12 | [program:php-fpm] 13 | command=/usr/local/sbin/php-fpm -F 14 | #user=%(ENV_WWW_USER)s 15 | stdout_logfile=/dev/stdout 16 | stdout_logfile_maxbytes=0 17 | stderr_logfile=/dev/stderr 18 | stderr_logfile_maxbytes=0 19 | priority=10 20 | autostart=true 21 | autorestart=unexpected 22 | 23 | [program:nginx] 24 | command=/usr/sbin/nginx -g 'daemon off;' 25 | #user=%(ENV_WWW_USER)s 26 | stdout_logfile=/dev/stdout 27 | stdout_logfile_maxbytes=0 28 | stderr_logfile=/dev/stderr 29 | stderr_logfile_maxbytes=0 30 | priority=20 31 | autostart=true 32 | autorestart=unexpected 33 | -------------------------------------------------------------------------------- /debian.apache.Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PHP_VERSION=8.1 2 | FROM tobi312/php:${PHP_VERSION}-apache-slim 3 | ARG PHP_VERSION 4 | 5 | ARG DEBIAN_FRONTEND=noninteractive 6 | 7 | SHELL ["/bin/bash", "-euxo", "pipefail", "-c"] 8 | 9 | LABEL org.opencontainers.image.authors="Tobias Hargesheimer " \ 10 | org.opencontainers.image.title="PHP+Apache2" \ 11 | org.opencontainers.image.description="Debian with PHP ${PHP_VERSION} and Apache2" \ 12 | org.opencontainers.image.licenses="MIT" \ 13 | org.opencontainers.image.url="https://hub.docker.com/r/tobi312/php" \ 14 | org.opencontainers.image.source="https://github.com/Tob1as/docker-php" 15 | 16 | # PHP 17 | RUN \ 18 | PHP_EXTENSIONS_LIST=" \ 19 | @composer \ 20 | apcu \ 21 | bcmath \ 22 | bz2 \ 23 | calendar \ 24 | dba \ 25 | enchant \ 26 | exif \ 27 | ffi \ 28 | # gd \ 29 | gettext \ 30 | gmp \ 31 | imagick \ 32 | imap \ 33 | intl \ 34 | ldap \ 35 | memcached \ 36 | mongodb \ 37 | mysqli \ 38 | opcache \ 39 | pdo_dblib \ 40 | pdo_mysql \ 41 | pdo_pgsql \ 42 | pgsql \ 43 | pspell \ 44 | redis \ 45 | shmop \ 46 | snmp \ 47 | tidy \ 48 | xsl \ 49 | yaml \ 50 | zip \ 51 | " \ 52 | ; \ 53 | \ 54 | ARCH=`uname -m` ; \ 55 | echo "ARCH=$ARCH" ; \ 56 | if [[ "$ARCH" == "armv"* ]]; then \ 57 | # fix: /usr/lib/gcc/arm-linux-gnueabihf/10/include/arm_neon.h:10403:1: error: inlining failed in call to ‘always_inline’ ‘vld1q_u8’: target specific option mismatch 58 | apt-get update ; \ 59 | apt-get install -y --no-install-recommends libfreetype6 libjpeg62-turbo ^libpng[0-9]+-[0-9]+$ libxpm4 ^libwebp[0-9]+$ ; \ 60 | temp_package="libfreetype6-dev libjpeg62-turbo-dev libpng-dev libxpm-dev libwebp-dev" ; \ 61 | apt-get install -y --no-install-recommends $temp_package ; \ 62 | docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype ; \ 63 | docker-php-ext-install -j$(nproc) gd ; \ 64 | apt-get purge -y $temp_package ; apt-get autoremove -y ; \ 65 | rm -rf /var/lib/apt/lists/* ; \ 66 | #php -i | grep 'GD' ; \ 67 | else \ 68 | PHP_EXTENSIONS_LIST="$PHP_EXTENSIONS_LIST gd" ; \ 69 | fi ; \ 70 | install-php-extensions $PHP_EXTENSIONS_LIST ; \ 71 | php -m 72 | 73 | -------------------------------------------------------------------------------- /debian.apache.slim.Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PHP_VERSION=8.1 2 | FROM php:${PHP_VERSION}-apache 3 | ARG PHP_VERSION 4 | 5 | ARG DEBIAN_FRONTEND=noninteractive 6 | 7 | SHELL ["/bin/bash", "-euxo", "pipefail", "-c"] 8 | 9 | LABEL org.opencontainers.image.authors="Tobias Hargesheimer " \ 10 | org.opencontainers.image.title="PHP+Apache2" \ 11 | org.opencontainers.image.description="Debian with PHP ${PHP_VERSION} and Apache2" \ 12 | org.opencontainers.image.licenses="MIT" \ 13 | org.opencontainers.image.url="https://hub.docker.com/r/tobi312/php" \ 14 | org.opencontainers.image.source="https://github.com/Tob1as/docker-php" 15 | 16 | ENV LANG C.UTF-8 17 | ENV TERM=xterm 18 | ENV CFLAGS="-I/usr/src/php" 19 | 20 | # TOOLS 21 | #RUN apt-get update; \ 22 | # apt-get install -y --no-install-recommends \ 23 | # curl \ 24 | # wget \ 25 | # #git \ 26 | # #zip unzip \ 27 | # #patch \ 28 | # ; \ 29 | # rm -rf /var/lib/apt/lists/* 30 | 31 | # PHP-EXTENSION-INSTALLER 32 | RUN \ 33 | PHP_EXTENSION_INSTALLER_VERSION=$(curl -s https://api.github.com/repos/mlocati/docker-php-extension-installer/releases/latest | grep 'tag_name' | cut -d '"' -f4) ; \ 34 | echo "install-php-extensions Version: ${PHP_EXTENSION_INSTALLER_VERSION}" ; \ 35 | curl -sSL https://github.com/mlocati/docker-php-extension-installer/releases/download/${PHP_EXTENSION_INSTALLER_VERSION}/install-php-extensions -o /usr/local/bin/install-php-extensions ; \ 36 | chmod +x /usr/local/bin/install-php-extensions 37 | 38 | # PHP 39 | RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini 40 | 41 | # ENTRYPOINT 42 | COPY entrypoint.sh /usr/local/bin/entrypoint.sh 43 | RUN chmod +x /usr/local/bin/entrypoint.sh ; \ 44 | #sed -i -e 's/\r$//' /usr/local/bin/entrypoint.sh ; \ 45 | mkdir /entrypoint.d 46 | 47 | #WORKDIR /var/www/html 48 | VOLUME /var/www/html 49 | 50 | EXPOSE 80 443 51 | 52 | ENTRYPOINT ["entrypoint.sh"] 53 | CMD ["apache2-foreground"] 54 | -------------------------------------------------------------------------------- /debian.fpm.Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PHP_VERSION=8.1 2 | FROM tobi312/php:${PHP_VERSION}-fpm-slim 3 | ARG PHP_VERSION 4 | 5 | ARG DEBIAN_FRONTEND=noninteractive 6 | 7 | SHELL ["/bin/bash", "-euxo", "pipefail", "-c"] 8 | 9 | LABEL org.opencontainers.image.authors="Tobias Hargesheimer " \ 10 | org.opencontainers.image.title="PHP+FPM" \ 11 | org.opencontainers.image.description="Debian with PHP ${PHP_VERSION} with FPM" \ 12 | org.opencontainers.image.licenses="MIT" \ 13 | org.opencontainers.image.url="https://hub.docker.com/r/tobi312/php" \ 14 | org.opencontainers.image.source="https://github.com/Tob1as/docker-php" 15 | 16 | # PHP 17 | RUN \ 18 | PHP_EXTENSIONS_LIST=" \ 19 | @composer \ 20 | apcu \ 21 | bcmath \ 22 | bz2 \ 23 | calendar \ 24 | dba \ 25 | enchant \ 26 | exif \ 27 | ffi \ 28 | # gd \ 29 | gettext \ 30 | gmp \ 31 | imagick \ 32 | imap \ 33 | intl \ 34 | ldap \ 35 | memcached \ 36 | mongodb \ 37 | mysqli \ 38 | opcache \ 39 | pdo_dblib \ 40 | pdo_mysql \ 41 | pdo_pgsql \ 42 | pgsql \ 43 | pspell \ 44 | redis \ 45 | shmop \ 46 | snmp \ 47 | tidy \ 48 | xsl \ 49 | yaml \ 50 | zip \ 51 | " \ 52 | ; \ 53 | \ 54 | ARCH=`uname -m` ; \ 55 | echo "ARCH=$ARCH" ; \ 56 | if [[ "$ARCH" == "armv"* ]]; then \ 57 | # fix: /usr/lib/gcc/arm-linux-gnueabihf/10/include/arm_neon.h:10403:1: error: inlining failed in call to ‘always_inline’ ‘vld1q_u8’: target specific option mismatch 58 | apt-get update ; \ 59 | apt-get install -y --no-install-recommends libfreetype6 libjpeg62-turbo ^libpng[0-9]+-[0-9]+$ libxpm4 ^libwebp[0-9]+$ ; \ 60 | temp_package="libfreetype6-dev libjpeg62-turbo-dev libpng-dev libxpm-dev libwebp-dev" ; \ 61 | apt-get install -y --no-install-recommends $temp_package ; \ 62 | docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype ; \ 63 | docker-php-ext-install -j$(nproc) gd ; \ 64 | apt-get purge -y $temp_package ; apt-get autoremove -y ; \ 65 | rm -rf /var/lib/apt/lists/* ; \ 66 | #php -i | grep 'GD' ; \ 67 | else \ 68 | PHP_EXTENSIONS_LIST="$PHP_EXTENSIONS_LIST gd" ; \ 69 | fi ; \ 70 | install-php-extensions $PHP_EXTENSIONS_LIST ; \ 71 | php -m 72 | 73 | -------------------------------------------------------------------------------- /debian.fpm.slim.Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PHP_VERSION=8.1 2 | FROM php:${PHP_VERSION}-fpm 3 | ARG PHP_VERSION 4 | 5 | ARG DEBIAN_FRONTEND=noninteractive 6 | 7 | SHELL ["/bin/bash", "-euxo", "pipefail", "-c"] 8 | 9 | LABEL org.opencontainers.image.authors="Tobias Hargesheimer " \ 10 | org.opencontainers.image.title="PHP-FPM" \ 11 | org.opencontainers.image.description="Debian with PHP ${PHP_VERSION} with FPM" \ 12 | org.opencontainers.image.licenses="MIT" \ 13 | org.opencontainers.image.url="https://hub.docker.com/r/tobi312/php" \ 14 | org.opencontainers.image.source="https://github.com/Tob1as/docker-php" 15 | 16 | ENV LANG C.UTF-8 17 | ENV TERM=xterm 18 | ENV CFLAGS="-I/usr/src/php" 19 | 20 | # TOOLS 21 | #RUN apt-get update; \ 22 | # apt-get install -y --no-install-recommends \ 23 | # curl \ 24 | # wget \ 25 | # #git \ 26 | # #zip unzip \ 27 | # #patch \ 28 | # ; \ 29 | # rm -rf /var/lib/apt/lists/* 30 | 31 | # PHP-EXTENSION-INSTALLER 32 | RUN \ 33 | PHP_EXTENSION_INSTALLER_VERSION=$(curl -s https://api.github.com/repos/mlocati/docker-php-extension-installer/releases/latest | grep 'tag_name' | cut -d '"' -f4) ; \ 34 | echo "install-php-extensions Version: ${PHP_EXTENSION_INSTALLER_VERSION}" ; \ 35 | curl -sSL https://github.com/mlocati/docker-php-extension-installer/releases/download/${PHP_EXTENSION_INSTALLER_VERSION}/install-php-extensions -o /usr/local/bin/install-php-extensions ; \ 36 | chmod +x /usr/local/bin/install-php-extensions 37 | 38 | # PHP 39 | RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini 40 | 41 | # ENTRYPOINT 42 | COPY entrypoint.sh /usr/local/bin/entrypoint.sh 43 | RUN chmod +x /usr/local/bin/entrypoint.sh ; \ 44 | #sed -i -e 's/\r$//' /usr/local/bin/entrypoint.sh ; \ 45 | mkdir /entrypoint.d 46 | 47 | #WORKDIR /var/www/html 48 | VOLUME /var/www/html 49 | 50 | EXPOSE 9000 51 | 52 | ENTRYPOINT ["entrypoint.sh"] 53 | CMD ["php-fpm"] 54 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "2.4" 2 | 3 | services: 4 | 5 | php: # or: website 6 | #build: 7 | # context: ./ 8 | # dockerfile: debian.apache.Dockerfile 9 | image: tobi312/php:8.1-apache 10 | #image: tobi312/php:8.1-fpm-nginx-alpine 11 | container_name: phpcontainer # or: website 12 | #restart: unless-stopped 13 | ## ports ONLY with apache/nginx: 14 | ports: 15 | - "80:80" 16 | - "443:443" 17 | volumes: 18 | #- apache-data:/var/www/html:rw 19 | - ./html:/var/www/html:rw 20 | ## optional: folder with own entrypoint-file(s) mount: 21 | #- ./entrypoint.d:/entrypoint.d:ro 22 | ## optional for apache: own ssl-cert and -key: 23 | #- ./ssl/mySSL.crt:/etc/ssl/certs/ssl-cert-snakeoil.pem:ro 24 | #- ./ssl/mySSL.key:/etc/ssl/private/ssl-cert-snakeoil.key:ro 25 | ## optional for nginx: own nginx.conf: 26 | #- ./nginx_default.conf:/etc/nginx/http.d/default.conf:ro 27 | environment: 28 | TZ: "Europe/Berlin" 29 | PHP_ERRORS: 1 30 | PHP_MEM_LIMIT: 128 31 | PHP_POST_MAX_SIZE: 250 32 | PHP_UPLOAD_MAX_FILESIZE: 250 33 | PHP_MAX_FILE_UPLOADS: 20 34 | CREATE_PHPINFO_FILE: 0 35 | CREATE_INDEX_FILE: 0 36 | ## next env only with php-fpm 37 | #ENABLE_PHP_FPM_STATUS: 1 38 | ## next env only with apache 39 | ENABLE_APACHE_REWRITE: 1 40 | ENABLE_APACHE_ACTIONS: 0 41 | ENABLE_APACHE_SSL: 0 42 | ENABLE_APACHE_HEADERS: 0 43 | ENABLE_APACHE_ALLOWOVERRIDE: 1 44 | ENABLE_APACHE_REMOTEIP: 0 45 | ENABLE_APACHE_STATUS: 1 46 | ENABLE_APACHE_SSL_REDIRECT: 0 47 | APACHE_SERVER_NAME: "" 48 | APACHE_SERVER_ALIAS: "" 49 | APACHE_SERVER_ADMIN: "" 50 | DISABLE_APACHE_DEFAULTSITES: 0 51 | ## next env only with nginx 52 | #ENABLE_NGINX_REMOTEIP: 0 53 | #ENABLE_NGINX_STATUS: 1 54 | healthcheck: 55 | test: curl --fail http://127.0.0.1:80/server-status || exit 1 56 | #test: curl --fail --insecure https://127.0.0.1:443/server-status || exit 1 57 | #test: curl --fail http://127.0.0.1:80/nginx_status || exit 1 58 | #test: curl --fail --insecure https://127.0.0.1:443/nginx_status || exit 1 59 | # need installed "wget": 60 | #test: wget --quiet --tries=1 --spider http://127.0.0.1:80/server-status || exit 1 61 | #test: wget --quiet --tries=1 --spider --no-check-certificate https://127.0.0.1:443/server-status || exit 1 62 | #test: wget --quiet --tries=1 --spider http://127.0.0.1:80/nginx_status || exit 1 63 | #test: wget --quiet --tries=1 --spider --no-check-certificate https://127.0.0.1:443/nginx_status || exit 1 64 | interval: 60s 65 | timeout: 10s 66 | retries: 3 67 | networks: 68 | website: 69 | #labels: 70 | # # for Traefik "docker-compose" example see: https://github.com/Tob1as/docker-kubernetes-collection/blob/master/examples_docker-compose/traefik.yml 71 | # - "traefik.enable=true" 72 | # #- "traefik.docker.network=website" 73 | # - "traefik.http.services.website.loadbalancer.server.port=80" 74 | # # http 75 | # - "traefik.http.routers.website-http.rule=Host(`example.com`)" 76 | # - "traefik.http.routers.website-http.entrypoints=web" 77 | # - "traefik.http.routers.website-http.service=website" 78 | # # https 79 | # - "traefik.http.routers.website-https.tls=true" 80 | # - "traefik.http.routers.website-https.rule=Host(`example.com`)" 81 | # - "traefik.http.routers.website-https.entrypoints=websecure" 82 | # - "traefik.http.routers.website-https.service=website" 83 | # # http to https redirect 84 | # - "traefik.http.routers.website-http.middlewares=website-https" 85 | # - "traefik.http.middlewares.website-https.redirectscheme.scheme=https" 86 | # #- "traefik.http.middlewares.website-https.redirectscheme.permanent=false" 87 | # #- "traefik.http.middlewares.website-https.redirectscheme.port=443" 88 | 89 | # https://github.com/robbertkl/docker-ipv6nat/issues/65#issuecomment-754600212 90 | networks: 91 | website: 92 | name: website 93 | # driver: bridge 94 | # enable_ipv6: true 95 | # ipam: 96 | # driver: default 97 | # config: 98 | # - subnet: 172.20.0.0/24 99 | # - subnet: fd00:dead:beef::/48 100 | 101 | 102 | #volumes: 103 | # apache-data: 104 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -eu 4 | #set -euo pipefail 5 | #IFS=$'\n\t' 6 | 7 | ## Variables 8 | ## https://stackoverflow.com/a/32343069/3441436 9 | : "${TZ:=""}" # set timezone, example: "Europe/Berlin" 10 | : "${PHP_ERRORS:="0"}" # set 1 to enable 11 | : "${PHP_MEM_LIMIT:=""}" # set Value in MB, example: 128 12 | : "${PHP_POST_MAX_SIZE:=""}" # set Value in MB, example: 250 13 | : "${PHP_UPLOAD_MAX_FILESIZE:=""}" # set Value in MB, example: 250 14 | : "${PHP_MAX_FILE_UPLOADS:=""}" # set number, example: 20 15 | : "${PHP_FPM_STATUS_PATH:="/php_fpm_status"}" # (default: /status but here use /php_fpm_status) 16 | : "${ENABLE_PHP_FPM_STATUS:="0"}" # set 1 to enable 17 | : "${CREATE_PHPINFO_FILE:="0"}" # set 1 to enable 18 | : "${CREATE_INDEX_FILE:="0"}" # set 1 to enable 19 | : "${ENABLE_APACHE_REWRITE:="0"}" # set 1 to enable 20 | : "${ENABLE_APACHE_ACTIONS:="0"}" # set 1 to enable 21 | : "${ENABLE_APACHE_SSL:="0"}" # set 1 to enable 22 | : "${ENABLE_APACHE_HEADERS:="0"}" # set 1 to enable 23 | : "${ENABLE_APACHE_ALLOWOVERRIDE:="0"}" # set 1 to enable 24 | : "${ENABLE_APACHE_REMOTEIP:="0"}" # set 1 to enable (use this only behind a proxy/loadbalancer) 25 | : "${ENABLE_APACHE_STATUS:="0"}" # set 1 to enable 26 | : "${ENABLE_APACHE_SSL_REDIRECT:="0"}" # set 1 to enable (required enable ssl and rewrite) 27 | : "${APACHE_SERVER_NAME:=""}" # set server name, example: example.com 28 | : "${APACHE_SERVER_ALIAS:=""}" # set server name, example: 'www.example.com *.example.com' 29 | : "${APACHE_SERVER_ADMIN:=""}" # set server admin, example: admin@example.com 30 | : "${DISABLE_APACHE_DEFAULTSITES:="0"}" # set 1 to disable default sites (add or mount your own conf in /etc/apache2/sites-enabled) 31 | : "${ENABLE_NGINX_REMOTEIP:="0"}" # set 1 to enable (use this only behind a proxy/loadbalancer) 32 | : "${ENABLE_NGINX_STATUS:="0"}" # set 1 to enable 33 | 34 | PHP_INI_FILE_NAME="50-php.ini" 35 | lsb_dist="$(. /etc/os-release && echo "$ID")" # get os (example: debian or alpine) - do not change! 36 | 37 | ## check if php-fpm in this container image exists 38 | if [ -d "/usr/local/etc/php-fpm.d" -a -f "/usr/local/etc/php-fpm.d/www.conf" ]; then 39 | PHP_FPM_IS_EXISTS="1" 40 | else 41 | PHP_FPM_IS_EXISTS="0" 42 | fi 43 | 44 | ## check if apache in this container image exists 45 | if [ -d "/etc/apache2" -a -f "/etc/apache2/apache2.conf" ]; then 46 | APACHE_IS_EXISTS="1" 47 | else 48 | APACHE_IS_EXISTS="0" 49 | fi 50 | 51 | ## check if nginx in this container image exists 52 | if [ -d "/etc/nginx" -a -f "/etc/nginx/nginx.conf" ]; then 53 | NGINX_IS_EXISTS="1" 54 | else 55 | NGINX_IS_EXISTS="0" 56 | fi 57 | 58 | ## print versions 59 | echo ">> print versions ..." 60 | php -v | head -1 61 | if [ "$APACHE_IS_EXISTS" -eq "1" ]; then 62 | #httpd -v 63 | apache2 -v | head -1 64 | fi 65 | if [ "$NGINX_IS_EXISTS" -eq "1" ]; then 66 | nginx -v | head -1 67 | fi 68 | 69 | #################################################### 70 | ##################### PHP ########################## 71 | #################################################### 72 | 73 | ## create php ini file with comment 74 | echo "; ${PHP_INI_FILE_NAME} create by entrypoint.sh in container image" > /usr/local/etc/php/conf.d/${PHP_INI_FILE_NAME} 75 | 76 | ## set TimeZone 77 | if [ -n "$TZ" ]; then 78 | echo ">> set timezone to ${TZ} ..." 79 | #if [ "$lsb_dist" = "alpine" ]; then apk add --no-cache --virtual .fetch-tmp tzdata; fi 80 | #ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime 81 | cp /usr/share/zoneinfo/${TZ} /etc/localtime 82 | echo ${TZ} > /etc/timezone 83 | echo "date.timezone=${TZ}" >> /usr/local/etc/php/conf.d/${PHP_INI_FILE_NAME} 84 | #if [ "$lsb_dist" = "alpine" ]; then apk del --no-network .fetch-tmp; fi 85 | date 86 | fi 87 | 88 | ## display PHP error's 89 | if [ "$PHP_ERRORS" -eq "1" ] ; then 90 | echo ">> set display_errors" 91 | echo "display_errors = On" >> /usr/local/etc/php/conf.d/${PHP_INI_FILE_NAME} 92 | fi 93 | 94 | ## changes the memory_limit 95 | if [ -n "$PHP_MEM_LIMIT" ]; then 96 | echo ">> set memory_limit" 97 | echo "memory_limit = ${PHP_MEM_LIMIT}M" >> /usr/local/etc/php/conf.d/${PHP_INI_FILE_NAME} 98 | fi 99 | 100 | ## changes the post_max_size 101 | if [ -n "$PHP_POST_MAX_SIZE" ]; then 102 | echo ">> set post_max_size" 103 | echo "post_max_size = ${PHP_POST_MAX_SIZE}M" >> /usr/local/etc/php/conf.d/${PHP_INI_FILE_NAME} 104 | fi 105 | 106 | ## changes the upload_max_filesize 107 | if [ -n "$PHP_UPLOAD_MAX_FILESIZE" ]; then 108 | echo ">> set upload_max_filesize" 109 | echo "upload_max_filesize = ${PHP_UPLOAD_MAX_FILESIZE}M" >> /usr/local/etc/php/conf.d/${PHP_INI_FILE_NAME} 110 | fi 111 | 112 | ## changes the max_file_uploads 113 | if [ -n "$PHP_MAX_FILE_UPLOADS" ]; then 114 | echo ">> set max_file_uploads" 115 | echo "max_file_uploads = ${PHP_MAX_FILE_UPLOADS}" >> /usr/local/etc/php/conf.d/${PHP_INI_FILE_NAME} 116 | fi 117 | 118 | #################################################### 119 | ##################### PHP-FPM ###################### 120 | #################################################### 121 | 122 | PHP_FPM_CONF_FILE="/usr/local/etc/php-fpm.d/www.conf" 123 | 124 | if [ "$PHP_FPM_IS_EXISTS" -eq "1" -a "$ENABLE_PHP_FPM_STATUS" -eq "1" ]; then 125 | echo ">> enabling php-fpm status!" 126 | #echo -e "[www]\npm.status_path = /status\nping.path = /ping" > /usr/local/etc/php-fpm.d/y-status.conf 127 | #echo -e "[www]\npm.status_path = ${PHP_FPM_STATUS_PATH}\nping.path = /ping" > /usr/local/etc/php-fpm.d/y-status.conf 128 | #sed -i "s|;pm.status_path.*|pm.status_path = /status|g" ${PHP_FPM_CONF_FILE} 129 | sed -i "s|;pm.status_path.*|pm.status_path = ${PHP_FPM_STATUS_PATH}|g" ${PHP_FPM_CONF_FILE} 130 | sed -i "s|;ping.path.*|ping.path = /ping|g" ${PHP_FPM_CONF_FILE} 131 | fi 132 | 133 | #################################################### 134 | ############ for dev and testing ################### 135 | #################################################### 136 | 137 | ## create phpinfo-file 138 | if [ "$CREATE_PHPINFO_FILE" -eq "1" -a ! -e "/var/www/html/phpinfo.php" ]; then 139 | echo ">> create phpinfo-file" 140 | echo "" > /var/www/html/phpinfo.php 141 | fi 142 | 143 | ## create index file 144 | #if [ \( "$NGINX_IS_EXISTS" -eq "1" -o "$APACHE_IS_EXISTS" -eq "1" \) -a "$CREATE_INDEX_FILE" -eq "1" -a ! -e "/var/www/html/index.php" ]; then 145 | if [ "$CREATE_INDEX_FILE" -eq "1" -a ! -e "/var/www/html/index.php" ]; then 146 | echo ">> create index file" 147 | 148 | cat > /var/www/html/index.php < 150 | 151 | 152 | 153 | 154 | Site 155 | 156 | 157 | 158 |

Hello!

159 |

160 | This is a simple website. Time:
161 | 164 |

165 | 166 | 167 | 168 | EOF 169 | 170 | fi 171 | 172 | #################################################### 173 | #################### APACHE2 ####################### 174 | #################################################### 175 | 176 | ## enable apache2 rewrite 177 | if [ "$APACHE_IS_EXISTS" -eq "1" -a "$ENABLE_APACHE_REWRITE" -eq "1" ]; then 178 | echo ">> enabling rewrite support" 179 | /usr/sbin/a2enmod rewrite 180 | 181 | fi 182 | 183 | ## enable apache2 actions 184 | if [ "$APACHE_IS_EXISTS" -eq "1" -a "$ENABLE_APACHE_ACTIONS" -eq "1" ]; then 185 | echo ">> enabling actions support" 186 | /usr/sbin/a2enmod actions 187 | fi 188 | 189 | ## enable apache2 ssl and generating self-sign ssl files 190 | if [ "$APACHE_IS_EXISTS" -eq "1" -a "$ENABLE_APACHE_SSL" -eq "1" ]; then 191 | echo ">> enabling SSL support" 192 | /usr/sbin/a2ensite default-ssl 193 | /usr/sbin/a2enmod ssl 194 | 195 | if [ ! -e "/etc/ssl/private/ssl-cert-snakeoil.key" ] || [ ! -e "/etc/ssl/certs/ssl-cert-snakeoil.pem" ]; then 196 | echo ">> generating self signed cert ; optional: later you can mount a own certs in container" 197 | openssl req -x509 -newkey rsa:4086 -subj "/C=no/ST=none/L=none/O=none/CN=none" -keyout "/etc/ssl/private/ssl-cert-snakeoil.key" -out "/etc/ssl/certs/ssl-cert-snakeoil.pem" -days 3650 -nodes -sha256 198 | fi 199 | fi 200 | 201 | ## enable apache2 headers 202 | if [ "$APACHE_IS_EXISTS" -eq "1" -a "$ENABLE_APACHE_HEADERS" -eq "1" ]; then 203 | echo ">> enabling headers support" 204 | /usr/sbin/a2enmod headers 205 | fi 206 | 207 | ## set AllowOverride to all 208 | #if [ "$APACHE_IS_EXISTS" -eq "1" -a "$ENABLE_APACHE_ALLOWOVERRIDE" == "1" ]; then 209 | # echo ">> set AllowOverride form none to all" 210 | # ## diff -uNr /etc/apache2/apache2.conf /etc/apache2/apache2.conf.txt > /etc/apache2/apache2.conf.diff 211 | # 212 | # cat > /etc/apache2/apache2.conf.diff < 217 | # 218 | # 219 | #- Options Indexes FollowSymLinks 220 | #- AllowOverride None 221 | #+ Options FollowSymLinks 222 | #+ AllowOverride all 223 | # Require all granted 224 | # 225 | # 226 | # 227 | #EOF 228 | # 229 | # patch /etc/apache2/apache2.conf < /etc/apache2/apache2.conf.diff 230 | #fi 231 | 232 | ## set AllowOverride to all 233 | if [ "$APACHE_IS_EXISTS" -eq "1" -a "$ENABLE_APACHE_ALLOWOVERRIDE" -eq "1" ]; then 234 | echo ">> set AllowOverride form none to all" 235 | sed -i '//,/<\/Directory>/ s/AllowOverride None/AllowOverride all/' /etc/apache2/apache2.conf 236 | sed -i '//,/<\/Directory>/ s/Options Indexes FollowSymLinks/Options FollowSymLinks/' /etc/apache2/apache2.conf 237 | fi 238 | 239 | ## enable remote ip (X-Forwarded-For), use this only behind a proxy/loadbalancer! 240 | ## https://gist.github.com/patrocle/43f688e8cfef1a48c66f22825e9e0678 241 | ## https://www.globo.tech/learning-center/x-forwarded-for-ip-apache-web-server/ 242 | ## https://www.digitalocean.com/community/questions/get-client-public-ip-on-apache-server-used-behind-load-balancer 243 | if [ "$APACHE_IS_EXISTS" -eq "1" -a "$ENABLE_APACHE_REMOTEIP" -eq "1" ]; then 244 | echo ">> enabling remoteip support, use this only behind a proxy!" 245 | 246 | cat > /etc/apache2/conf-available/remoteip.conf < 248 | RemoteIPHeader X-Forwarded-For 249 | 250 | 251 | EOF 252 | 253 | /usr/sbin/a2enmod remoteip 254 | /usr/sbin/a2enconf remoteip 255 | 256 | sed -i -e 's/LogFormat "%h /LogFormat "%a (%{X-Forwarded-For}i) /g' /etc/apache2/apache2.conf 257 | 258 | fi 259 | 260 | if [ "$APACHE_IS_EXISTS" -eq "1" -a "$ENABLE_APACHE_STATUS" -eq "1" ]; then 261 | echo ">> enabling apache status!" 262 | 263 | [ -d "/etc/apache2/docker" ] || mkdir /etc/apache2/docker 264 | 265 | cat > /etc/apache2/docker/status.conf < 267 | #ExtendedStatus on 268 | 269 | SetHandler server-status 270 | Order deny,allow 271 | Require all denied 272 | Require local 273 | Require ip 10.0.0.0/8 274 | Require ip 172.16.0.0/12 275 | Require ip 192.168.0.0/16 276 | #Require ip fd00::/7 277 | 278 | 279 | 280 | EOF 281 | 282 | /usr/sbin/a2enmod status 283 | 284 | sed -i "/^ \ \ \ \ \ \ \ Include docker\/status.conf/d" /etc/apache2/sites-available/000-default.conf 285 | sed -i "/#Include conf-available/a \ \ \ \ \ \ \ \ Include docker/status.conf" /etc/apache2/sites-available/000-default.conf 286 | sed -i "/^ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Include docker\/status.conf/d" /etc/apache2/sites-available/default-ssl.conf 287 | sed -i "/#Include conf-available/a \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Include docker/status.conf" /etc/apache2/sites-available/default-ssl.conf 288 | fi 289 | 290 | if [ "$APACHE_IS_EXISTS" -eq "1" -a "$ENABLE_APACHE_SSL_REDIRECT" -eq "1" ]; then 291 | echo ">> enabling ssl redirect! (required enable ssl and rewrite)" 292 | 293 | [ -d "/etc/apache2/docker" ] || mkdir /etc/apache2/docker 294 | 295 | cat > /etc/apache2/docker/redirect_http_to_https.conf < 297 | 298 | RewriteEngine on 299 | #RewriteBase / 300 | RewriteCond %{HTTPS} off 301 | RewriteCond %{REQUEST_URI} !^/.well-known/ 302 | RewriteCond %{REQUEST_URI} !=/server-status 303 | RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] 304 | 305 | #Redirect permanent / https://%{HTTP_HOST}/ 306 | 307 | 308 | EOF 309 | 310 | sed -i "/^ \ \ \ \ \ \ \ Include docker\/redirect_http_to_https.conf/d" /etc/apache2/sites-available/000-default.conf 311 | sed -i "/#Include conf-available/a \ \ \ \ \ \ \ \ Include docker\/redirect_http_to_https.conf" /etc/apache2/sites-available/000-default.conf 312 | fi 313 | 314 | if [ "$APACHE_IS_EXISTS" -eq "1" -a -n "$APACHE_SERVER_NAME" ]; then 315 | #APACHE_SERVER_NAME=$(hostname) ## only for debug 316 | echo ">> set ServerName to ${APACHE_SERVER_NAME}" 317 | sed -i "s/#ServerName .*/ServerName ${APACHE_SERVER_NAME}/" /etc/apache2/sites-available/000-default.conf 318 | sed -i "/^ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ServerName /d" /etc/apache2/sites-available/default-ssl.conf 319 | sed -i "/ServerAdmin /i \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ServerName ${APACHE_SERVER_NAME}" /etc/apache2/sites-available/default-ssl.conf 320 | fi 321 | 322 | if [ "$APACHE_IS_EXISTS" -eq "1" -a -n "$APACHE_SERVER_ALIAS" ]; then 323 | echo ">> set ServerAlias to ${APACHE_SERVER_ALIAS}" 324 | sed -i "/^ \ \ \ \ \ \ \ ServerAlias /d" /etc/apache2/sites-available/000-default.conf 325 | #sed -i "/ServerName .*/a \ \ \ \ \ \ \ \ ServerAlias ${APACHE_SERVER_ALIAS}" /etc/apache2/sites-available/000-default.conf 326 | sed -i "/ServerAdmin /i \ \ \ \ \ \ \ \ ServerAlias ${APACHE_SERVER_ALIAS}" /etc/apache2/sites-available/000-default.conf 327 | sed -i "/^ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ServerAlias /d" /etc/apache2/sites-available/default-ssl.conf 328 | #sed -i "/ServerName .*/a \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ServerAlias ${APACHE_SERVER_ALIAS}" /etc/apache2/sites-available/default-ssl.conf 329 | sed -i "/ServerAdmin /i \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ServerAlias ${APACHE_SERVER_ALIAS}" /etc/apache2/sites-available/default-ssl.conf 330 | fi 331 | 332 | if [ "$APACHE_IS_EXISTS" -eq "1" -a -n "$APACHE_SERVER_ADMIN" ]; then 333 | echo ">> set ServerAdmin to ${APACHE_SERVER_ADMIN}" 334 | sed -i "s/ServerAdmin .*/ServerAdmin ${APACHE_SERVER_ADMIN}/" /etc/apache2/sites-available/000-default.conf 335 | sed -i "s/ServerAdmin .*/ServerAdmin ${APACHE_SERVER_ADMIN}/" /etc/apache2/sites-available/default-ssl.conf 336 | fi 337 | 338 | if [ "$APACHE_IS_EXISTS" -eq "1" -a "$DISABLE_APACHE_DEFAULTSITES" -eq "1" ]; then 339 | echo ">> disable default sites (add or mount your own conf in /etc/apache2/sites-enabled)" 340 | if [ -f "/etc/apache2/sites-available/000-default.conf" ]; then 341 | /usr/sbin/a2dissite 000-default 342 | fi 343 | if [ -f "/etc/apache2/sites-available/default-ssl.conf" ]; then 344 | /usr/sbin/a2dissite default-ssl 345 | fi 346 | fi 347 | 348 | #################################################### 349 | ##################### NGINX ######################## 350 | #################################################### 351 | 352 | NGINX_CONF_FILE="/etc/nginx/conf.d/default.conf" 353 | 354 | if [ "$NGINX_IS_EXISTS" -eq "1" -a "$ENABLE_NGINX_STATUS" -eq "1" ]; then 355 | echo ">> enabling nginx status!" 356 | nginx_status_string="location /nginx_status {\n stub_status on;\n access_log off;\n allow 127.0.0.1;\n allow ::1;\n allow 10.0.0.0/8;\n allow 172.16.0.0/12;\n allow 192.168.0.0/16;\n deny all;\n }" 357 | sed -i "s|##REPLACE_WITH_NGINXSTATUS_CONFIG##|${nginx_status_string}|g" ${NGINX_CONF_FILE} 358 | fi 359 | 360 | if [ "$NGINX_IS_EXISTS" -eq "1" -a "$ENABLE_PHP_FPM_STATUS" -eq "1" ]; then 361 | echo ">> enabling php-fpm status in nginx!" 362 | php_fpm_status_string="location ${PHP_FPM_STATUS_PATH} {\n access_log off;\n allow 127.0.0.1;\n allow ::1;\n allow 10.0.0.0/8;\n allow 172.16.0.0/12;\n allow 192.168.0.0/16;\n deny all;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n include fastcgi_params;\n fastcgi_pass 127.0.0.1:9000;\n }\n\n location /ping {\n access_log off;\n allow 127.0.0.1;\n allow ::1;\n allow 10.0.0.0/8;\n allow 172.16.0.0/12;\n allow 192.168.0.0/16;\n deny all;\n fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n include fastcgi_params;\n fastcgi_pass 127.0.0.1:9000;\n }" ; \ 363 | sed -i "s|##REPLACE_WITH_PHPFPMSTATUS_CONFIG##|${php_fpm_status_string}|g" ${NGINX_CONF_FILE} 364 | fi 365 | 366 | if [ "$NGINX_IS_EXISTS" -eq "1" -a "$ENABLE_NGINX_REMOTEIP" -eq "1" ]; then 367 | # https://nginx.org/en/docs/http/ngx_http_realip_module.html 368 | echo ">> enabling remoteip support, use this only behind a proxy!" 369 | nginx_remoteip_string="set_real_ip_from 172.20.0.0/8;\n #set_real_ip_from fd00:dead:beef::/48;\n set_real_ip_from fd00::/8;\n ##REPLACE_WITH_MORE_REAL_IP##\n real_ip_header X-Forwarded-For;\n #real_ip_recursive on;\n" 370 | sed -i "s|##REPLACE_WITH_REMOTEIP_CONFIG##|${nginx_remoteip_string}|g" ${NGINX_CONF_FILE} 371 | fi 372 | 373 | #################################################### 374 | 375 | ## more entrypoint-files 376 | find "/entrypoint.d/" -follow -type f -print | sort -n | while read -r f; do 377 | case "$f" in 378 | *.sh) 379 | if [ ! -x "$f" ] ; then 380 | echo ">> $f is not executable! Set +x ..." 381 | chmod +x $f 382 | fi 383 | echo ">> $f is executed ..." 384 | /bin/sh $f 385 | ;; 386 | *) echo ">> $f is no *.sh-file!" ;; 387 | esac 388 | done 389 | 390 | # exec CMD 391 | echo ">> exec docker CMD" 392 | echo "$@" 393 | exec "$@" 394 | -------------------------------------------------------------------------------- /k8s.yaml: -------------------------------------------------------------------------------- 1 | ##__ __ _ ____ _ _ ____ ____ _ _ ______ _____ _____ ____ 2 | ##\ \ / /__| |__/ ___|(_) |_ ___ _ / ___/ ___|| | | | / / ___|| ___|_ _| _ \ 3 | ## \ \ /\ / / _ \ '_ \___ \| | __/ _ \ _| |_ \___ \___ \| |_| | / /\___ \| |_ | | | |_) | 4 | ## \ V V / __/ |_) |__) | | || __/ |_ _| ___) |__) | _ |/ / ___) | _| | | | __/ 5 | ## \_/\_/ \___|_.__/____/|_|\__\___| |_| |____/____/|_| |_/_/ |____/|_| |_| |_| 6 | ## 7 | 8 | ## https://github.com/Tob1as/docker-php + https://hub.docker.com/r/tobi312/php 9 | ## https://github.com/linuxserver/docker-openssh-server + https://hub.docker.com/r/linuxserver/openssh-server 10 | 11 | ## https://kubernetes.io/docs/reference/kubectl/cheatsheet/ 12 | ## kubectl apply -f k8s.yaml 13 | 14 | --- 15 | 16 | apiVersion: v1 17 | kind: ConfigMap 18 | metadata: 19 | name: openssh-env-config 20 | namespace: default 21 | labels: 22 | app: openssh 23 | data: 24 | PUID: "33" # default: 1000 ; set it like in website image: (www-data) 33 for debian and 82 for alpine (path: /var/www/html), (nginx) 101 for offical nginx image (path: /usr/share/nginx/html)! 25 | PGID: "33" # (see above) 26 | TZ: "Europe/Berlin" 27 | #SUDO_ACCESS: "false" 28 | PASSWORD_ACCESS: "true" 29 | 30 | --- 31 | 32 | ## convert string to base64 in Linux: "echo -n 'value' | base64" 33 | ## example generator for Password: https://passwordsgenerator.net/ 34 | ## example command for ssk-key: "ssh-keygen -t rsa -b 4096 -C 'your_email@example.com' -f $HOME/.ssh/id_rsa" 35 | 36 | apiVersion: v1 37 | kind: Secret 38 | metadata: 39 | name: openssh-env-secret 40 | namespace: default 41 | labels: 42 | app: openssh 43 | data: 44 | #PUBLIC_KEY: < ~/.ssh/key_rsa.pub in base64 > 45 | USER_NAME: c3NodXNlcg== # Username in base64, example: sshuser 46 | USER_PASSWORD: Nk55NG5IdzRueUhmWmZTRQ== # Password in base64, example: 6Ny4nHw4nyHfZfSE 47 | 48 | --- 49 | 50 | apiVersion: v1 51 | kind: ConfigMap 52 | metadata: 53 | name: website-env-config 54 | namespace: default 55 | labels: 56 | app: website 57 | data: 58 | TZ: "Europe/Berlin" 59 | PHP_ERRORS: "1" 60 | PHP_MEM_LIMIT: "128" 61 | PHP_POST_MAX_SIZE: "250" 62 | PHP_UPLOAD_MAX_FILESIZE: "250" 63 | PHP_MAX_FILE_UPLOADS: "20" 64 | CREATE_PHPINFO_FILE: "0" 65 | CREATE_INDEX_FILE: "0" 66 | ## next env only with php-fpm 67 | #ENABLE_PHP_FPM_STATUS: "1" 68 | ## next env only with apache 69 | ENABLE_APACHE_REWRITE: "1" 70 | ENABLE_APACHE_ACTIONS: "0" 71 | ENABLE_APACHE_SSL: "0" 72 | ENABLE_APACHE_HEADERS: "0" 73 | ENABLE_APACHE_ALLOWOVERRIDE: "1" 74 | ENABLE_APACHE_REMOTEIP: "1" 75 | ENABLE_APACHE_STATUS: "1" 76 | #ENABLE_APACHE_SSL_REDIRECT: "0" 77 | #APACHE_SERVER_NAME: "" 78 | #APACHE_SERVER_ALIAS: "" 79 | #APACHE_SERVER_ADMIN: "" 80 | DISABLE_APACHE_DEFAULTSITES: "0" 81 | ## next env only with nginx 82 | #ENABLE_NGINX_REMOTEIP: "1" 83 | #ENABLE_NGINX_STATUS: "1" 84 | 85 | --- 86 | 87 | apiVersion: apps/v1 88 | kind: Deployment 89 | metadata: 90 | name: website 91 | namespace: default 92 | spec: 93 | replicas: 1 94 | strategy: 95 | type: Recreate 96 | selector: 97 | matchLabels: 98 | app: website 99 | template: 100 | metadata: 101 | labels: 102 | app: website 103 | annotations: {} 104 | spec: 105 | #hostname: website 106 | containers: 107 | - name: website 108 | #image: tobi312/php:8.1-fpm-nginx-alpine 109 | image: tobi312/php:8.1-apache 110 | imagePullPolicy: Always 111 | envFrom: 112 | - configMapRef: 113 | name: website-env-config 114 | ports: 115 | - containerPort: 80 116 | - containerPort: 443 117 | resources: 118 | requests: 119 | memory: "128Mi" 120 | cpu: "0.1" 121 | limits: 122 | memory: "1Gi" 123 | cpu: "1.0" 124 | volumeMounts: 125 | - mountPath: /var/www/html 126 | name: website-data 127 | #- name: website-php-file-config 128 | # mountPath: /usr/share/nginx/html/test.php 129 | # subPath: test.php 130 | - name: openssh-server 131 | #image: ghcr.io/linuxserver/openssh-server:latest 132 | image: linuxserver/openssh-server:latest 133 | imagePullPolicy: Always 134 | envFrom: 135 | - configMapRef: 136 | name: openssh-env-config 137 | - secretRef: 138 | name: openssh-env-secret 139 | ports: 140 | - containerPort: 2222 141 | resources: 142 | requests: 143 | memory: "128Mi" 144 | cpu: "0.1" 145 | limits: 146 | memory: "512Mi" 147 | cpu: "0.5" 148 | volumeMounts: 149 | - mountPath: /var/www/html 150 | name: website-data 151 | - mountPath: /config 152 | name: openssh-data 153 | #- name: openssh-file-config 154 | # mountPath: /config/custom-cont-init.d/10-sshd_portforwarding.sh 155 | # subPath: 10-sshd_portforwarding.sh 156 | - name: openssh-bashprofile-config 157 | mountPath: /config/.bash_profile 158 | subPath: .bash_profile 159 | initContainers: 160 | - name: volume-mount-chmod 161 | image: busybox 162 | command: ["sh", "-c", "mkdir -p /var/www/html; chmod 777 /var/www/html; mkdir -p /config; chmod 777 /config; exit"] 163 | volumeMounts: 164 | - mountPath: /var/www/html 165 | name: website-data 166 | - mountPath: /config 167 | name: openssh-data 168 | resources: 169 | requests: 170 | memory: "128Mi" 171 | cpu: "0.1" 172 | limits: 173 | memory: "256Mi" 174 | cpu: "0.5" 175 | restartPolicy: Always 176 | volumes: 177 | - name: website-data 178 | persistentVolumeClaim: 179 | claimName: website-data 180 | - name: openssh-data 181 | persistentVolumeClaim: 182 | claimName: openssh-data 183 | - name: website-php-file-config 184 | configMap: 185 | name: website-php-file-config 186 | - name: openssh-file-config 187 | configMap: 188 | name: openssh-file-config 189 | - name: openssh-bashprofile-config 190 | configMap: 191 | name: openssh-bashprofile-config 192 | 193 | --- 194 | 195 | apiVersion: v1 196 | kind: Service 197 | metadata: 198 | name: website 199 | namespace: default 200 | labels: 201 | app: website 202 | spec: 203 | type: ClusterIP # default 204 | ports: 205 | - name: website 206 | protocol: TCP 207 | port: 80 208 | targetPort: 80 209 | #- name: website-ssl 210 | # protocol: TCP 211 | # port: 443 212 | # targetPort: 443 213 | selector: 214 | app: website 215 | 216 | --- 217 | 218 | apiVersion: v1 219 | kind: Service 220 | metadata: 221 | name: openssh-server 222 | namespace: default 223 | labels: 224 | app: openssh 225 | spec: 226 | type: NodePort # for external access 227 | ports: 228 | - name: openssh-server 229 | protocol: TCP 230 | port: 2222 231 | targetPort: 2222 232 | #nodePort: 2222 # use this, when not random 233 | selector: 234 | app: website 235 | 236 | --- 237 | 238 | ## CertManager for Ingress (if use this then comment out "Secret for Ingress"): 239 | ## https://cert-manager.io/docs/ (https://github.com/jetstack/cert-manager) 240 | ## Installation needed: kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v1.3.1/cert-manager.yaml 241 | 242 | #apiVersion: cert-manager.io/v1 243 | ##kind: ClusterIssuer 244 | #kind: Issuer 245 | #metadata: 246 | # name: certmanager-ingress-nginx 247 | # namespace: default 248 | #spec: 249 | # acme: 250 | # email: email@example.com 251 | # server: https://acme-v02.api.letsencrypt.org/directory 252 | # privateKeySecretRef: 253 | # name: ingress-tls-secret 254 | # solvers: 255 | # - http01: 256 | # ingress: 257 | # class: nginx 258 | 259 | --- 260 | 261 | ## Secret for Ingress (if use this then comment out "CertManager for Ingress"): 262 | 263 | ## convert ssl files to base64, linux examples: 264 | ## example command: for i in $(find . -type f -regex ".*/.*\.\(crt\|key\|pem\)"); do echo -e "\nEncode-File $i:" ; cat $i | base64 -w0 ; done > ssl_convertinbase64.txt 265 | 266 | apiVersion: v1 267 | kind: Secret 268 | metadata: 269 | name: ingress-tls-secret 270 | namespace: default 271 | labels: 272 | app: website 273 | data: 274 | tls.crt: 275 | tls.key: 276 | type: kubernetes.io/tls 277 | 278 | --- 279 | 280 | apiVersion: networking.k8s.io/v1 281 | kind: Ingress 282 | metadata: 283 | name: ingress-website 284 | namespace: default 285 | annotations: 286 | kubernetes.io/ingress.class: nginx 287 | #nginx.ingress.kubernetes.io/ssl-redirect: "false" 288 | # CertManager: 289 | #cert-manager.io/cluster-issuer: certmanager-ingress-nginx 290 | #cert-manager.io/acme-challenge-type: http01 291 | ## oAuth2: https://kubernetes.github.io/ingress-nginx/examples/auth/oauth-external-auth/ 292 | #nginx.ingress.kubernetes.io/auth-url: "https://$host/oauth2/auth" 293 | #nginx.ingress.kubernetes.io/auth-signin: "https://$host/oauth2/start?rd=$escaped_request_uri" 294 | spec: 295 | tls: 296 | - hosts: 297 | - example.com 298 | secretName: ingress-tls-secret 299 | rules: 300 | - host: example.com 301 | http: 302 | paths: 303 | - path: / 304 | pathType: Prefix 305 | backend: 306 | service: 307 | name: website 308 | port: 309 | number: 80 310 | 311 | --- 312 | 313 | # test.php in /usr/share/nginx/html for website 314 | 315 | apiVersion: v1 316 | kind: ConfigMap 317 | metadata: 318 | name: website-php-file-config 319 | namespace: default 320 | labels: 321 | app: website 322 | data: 323 | test.php: |- 324 | 325 | 326 | 327 | 328 | 329 | Site 330 | 331 | 332 | 333 |

Hello!

334 |

335 | This is a simple website. Time:
336 | 339 |

340 | 341 | 342 | 343 | --- 344 | 345 | ## 10-sshd_portforwarding.sh in /config/custom-cont-init.d/ for openssh (enable PortForwarding) 346 | ## https://www.ssh.com/academy/ssh/tunneling/example 347 | 348 | apiVersion: v1 349 | kind: ConfigMap 350 | metadata: 351 | name: openssh-file-config 352 | namespace: default 353 | labels: 354 | app: openssh 355 | data: 356 | 10-sshd_portforwarding.sh: |- 357 | #!/bin/sh 358 | set -eu 359 | SSHD_CONF_FILE="/etc/ssh/sshd_config" 360 | echo ">> Enable PortForwarding" 361 | sed -i "s|AllowTcpForwarding.*|AllowTcpForwarding yes|g" ${SSHD_CONF_FILE} 362 | sed -i "s|GatewayPorts.*|GatewayPorts yes|g" ${SSHD_CONF_FILE} 363 | 364 | --- 365 | 366 | ## .bash_profile in /config/ for openssh user (change dir to html when login) 367 | ## https://serverfault.com/a/499566/479163 368 | 369 | apiVersion: v1 370 | kind: ConfigMap 371 | metadata: 372 | name: openssh-bashprofile-config 373 | namespace: default 374 | labels: 375 | app: openssh 376 | data: 377 | .bash_profile: |- 378 | cd /var/www/html/ 379 | 380 | --- 381 | 382 | apiVersion: v1 383 | kind: PersistentVolumeClaim 384 | metadata: 385 | name: website-data 386 | namespace: default 387 | labels: 388 | app: website 389 | spec: 390 | accessModes: 391 | - ReadWriteOnce 392 | volumeMode: Filesystem 393 | resources: 394 | requests: 395 | storage: 25Gi 396 | storageClassName: manual 397 | 398 | --- 399 | 400 | apiVersion: v1 401 | kind: PersistentVolumeClaim 402 | metadata: 403 | name: openssh-data 404 | namespace: default 405 | labels: 406 | app: openssh 407 | spec: 408 | accessModes: 409 | - ReadWriteOnce 410 | volumeMode: Filesystem 411 | resources: 412 | requests: 413 | storage: 256Mi 414 | storageClassName: manual 415 | 416 | --- 417 | 418 | apiVersion: v1 419 | kind: PersistentVolume 420 | metadata: 421 | name: pv-volume 422 | labels: 423 | type: local 424 | spec: 425 | storageClassName: manual 426 | persistentVolumeReclaimPolicy: Delete 427 | capacity: 428 | storage: 100Gi 429 | accessModes: 430 | - ReadWriteOnce 431 | hostPath: 432 | path: "/mnt/k8sdata" 433 | --------------------------------------------------------------------------------