Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/build-php82-apache2-node24-composer2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: Build the PHP 8.2 Apache2 Node24 Composer2 container

on:
push:
paths:
- "php82-apache2-node24-composer2/**"
- ".github/workflows/build-php82-apache2-node24-composer2.yaml"
schedule:
- cron: '0 7 * * *'
workflow_dispatch:

jobs:
build-push-php82-node24:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up QEMU
uses: docker/setup-qemu-action@v4
with:
platforms: "linux/amd64,linux/arm64"
# The latest version will lead to segmentation fault.
image: "tonistiigi/binfmt:qemu-v7.0.0-28"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v7
with:
context: ./php82-apache2-node24-composer2
platforms: linux/amd64,linux/arm64
# only push the latest tag on the main branch
push: "${{ github.ref == 'refs/heads/main' }}"
tags: |
ghcr.io/openconext/openconext-basecontainers/php82-apache2-node24-composer2:latest
ghcr.io/openconext/openconext-basecontainers/php82-apache2-node24-composer2:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha
27 changes: 27 additions & 0 deletions php82-apache2-node24-composer2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM ghcr.io/openconext/openconext-basecontainers/php82-apache2:latest

COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
COPY --from=node:24-slim /usr/local/bin /usr/local/bin
COPY --from=node:24-slim /opt /opt
COPY --from=node:24-slim /usr/local/lib/node_modules /usr/local/lib/node_modules

ENV DEBIAN_FRONTEND=noninteractive
RUN \
apt-get update && \
apt-get -y install \
git \
unzip \
vim \
zip \
&& \
rm -rf /var/lib/apt/lists/* /var/cache/apt /var/log/alternatives.log /var/log/apt /var/log/dpkg.log
RUN npm install -g yarn --force

# enable xdebug
RUN docker-php-ext-enable xdebug
COPY ./conf/xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

RUN mkdir -p /var/www/html/public

RUN rm -rf /etc/apache2/sites-enabled/*
COPY ./conf/appconf.conf /etc/apache2/sites-enabled/
31 changes: 31 additions & 0 deletions php82-apache2-node24-composer2/conf/appconf.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
ServerAdmin admin@dev.openconext.local

DocumentRoot /var/www/html/public

SetEnv HTTPS on
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

<Directory "/var/www/html/public">
Require all granted

Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</Directory>
<Location />
Require all granted
</Location>

Header always set X-Content-Type-Options "nosniff"

# Set the php application handler so mod_php interpets the files
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>

ExpiresActive on
ExpiresByType font/* "access plus 1 year"
ExpiresByType image/* "access plus 6 months"
ExpiresByType text/css "access plus 1 year"
ExpiresByType text/js "access plus 1 year"
6 changes: 6 additions & 0 deletions php82-apache2-node24-composer2/conf/xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
xdebug.mode = debug
xdebug.discover_client_host = true
xdebug.idekey = PHPSTORM
xdebug.client_host=host.docker.internal
xdebug.client_port=9003
zend_extension=xdebug