diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c4f2fab..f8b1f3b 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,9 @@ { "image": "mcr.microsoft.com/devcontainers/javascript-node:dev-24-trixie", "features": { - "ghcr.io/devcontainers/features/docker-in-docker:2": {} + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "moby": "false" + } }, "customizations": { "vscode": { diff --git a/.github/workflows/publish-containers.yaml b/.github/workflows/publish-containers.yaml index 269d01e..9304913 100644 --- a/.github/workflows/publish-containers.yaml +++ b/.github/workflows/publish-containers.yaml @@ -41,6 +41,7 @@ jobs: strategy: matrix: folder: ${{ fromJson(needs.list-files.outputs.folders) }} + php_version: [8.5, 8.4, 8.3, 8.2] permissions: contents: read packages: write @@ -55,6 +56,15 @@ jobs: id: lowercase-repo run: echo "repo=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT + # read image tag from subdirectory propery file if exists + - uses: xom9ikk/dotenv@v2.3.0 + with: + path: "src/${{ matrix.folder }}" + mode: '' + load-mode: 'skip' + env: + PHP_VERSION: ${{ matrix.php_version }} + # Login against a Docker registry except on PR # https://github.com/docker/login-action - name: Log into registry ${{ env.REGISTRY }} @@ -70,5 +80,8 @@ jobs: with: subFolder: src/${{ matrix.folder }} imageName: ${{ env.REGISTRY }}/${{ steps.lowercase-repo.outputs.repo }}/${{ matrix.folder }} - cacheFrom: ${{ env.REGISTRY }}/${{ steps.lowercase-repo.outputs.repo }}/${{ matrix.folder }} + imageTag: ${{ env.imagetag || 'latest' }} + cacheFrom: ${{ env.REGISTRY }}/${{ steps.lowercase-repo.outputs.repo }}/${{ matrix.folder }}:${{ env.imagetag || 'latest' }} refFilterForPush: "refs/heads/main" + env: + PHP_VERSION: ${{ matrix.php_version }} diff --git a/src/typo3-frankenphp/.devcontainer/Dockerfile b/src/typo3-frankenphp/.devcontainer/Dockerfile index ae1c1c9..1ec208a 100644 --- a/src/typo3-frankenphp/.devcontainer/Dockerfile +++ b/src/typo3-frankenphp/.devcontainer/Dockerfile @@ -1,4 +1,6 @@ -FROM dunglas/frankenphp:php8.4-trixie +ARG PHP_VERSION + +FROM dunglas/frankenphp:1-php${PHP_VERSION}-trixie ARG DEVCONTAINER_SERVICE_ID ARG DEVCONTAINER_SERVICE_NAME @@ -27,6 +29,4 @@ RUN apt-get update && \ gd imagick xdebug opcache tokenizer json iconv mbstring curl phar session simplexml xml @composer && \ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -COPY php.ini /usr/local/etc/php/php.ini - -COPY typo3.caddyfile /etc/frankenphp/Caddyfile +ENTRYPOINT [ "/bin/bash" ] diff --git a/src/typo3-frankenphp/.devcontainer/devcontainer.json b/src/typo3-frankenphp/.devcontainer/devcontainer.json index 780e0cd..97b0e0b 100644 --- a/src/typo3-frankenphp/.devcontainer/devcontainer.json +++ b/src/typo3-frankenphp/.devcontainer/devcontainer.json @@ -1,13 +1,15 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile { - "name": "FrankenPHP 8.4, MariaDB (Dockerfile)", + "name": "FrankenPHP, PHP ${localEnv:PHP_VERSION}, MariaDB (Dockerfile)", "build": { "context": ".", "dockerfile": "Dockerfile", "args": { "DEVCONTAINER_SERVICE_NAME": "devcontainer", - "DEVCONTAINER_SERVICE_ID": "10000" + "DEVCONTAINER_SERVICE_ID": "10000", + "COMPOSE_PROFILES": "frankenphp", + "PHP_VERSION": "${localEnv:PHP_VERSION}" } }, "customizations": { diff --git a/src/typo3-frankenphp/.env b/src/typo3-frankenphp/.env new file mode 100644 index 0000000..619957d --- /dev/null +++ b/src/typo3-frankenphp/.env @@ -0,0 +1 @@ +imagetag=1-php${PHP_VERSION}-trixie \ No newline at end of file