Skip to content

Commit 0ddfb9f

Browse files
committed
Add php 8.2 node 24 container
1 parent 3629342 commit 0ddfb9f

4 files changed

Lines changed: 114 additions & 0 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
name: Build the PHP 8.2 Apache2 Node24 Composer2 container
3+
4+
on:
5+
push:
6+
paths:
7+
- "php82-apache2-node24-composer2/**"
8+
- ".github/workflows/build-php82-apache2-node24-composer2.yaml"
9+
schedule:
10+
- cron: '0 7 * * *'
11+
workflow_dispatch:
12+
13+
jobs:
14+
build-push-php82-node24:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
packages: write
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v6
21+
22+
- name: Set up QEMU
23+
uses: docker/setup-qemu-action@v4
24+
with:
25+
platforms: "linux/amd64,linux/arm64"
26+
# The latest version will lead to segmentation fault.
27+
image: "tonistiigi/binfmt:qemu-v7.0.0-28"
28+
29+
- name: Set up Docker Buildx
30+
uses: docker/setup-buildx-action@v4
31+
32+
- name: Login to GitHub Container Registry
33+
uses: docker/login-action@v4
34+
with:
35+
registry: ghcr.io
36+
username: ${{ github.repository_owner }}
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Build and push
40+
uses: docker/build-push-action@v7
41+
with:
42+
context: ./php82-apache2-node24-composer2
43+
platforms: linux/amd64,linux/arm64
44+
# only push the latest tag on the main branch
45+
push: "${{ github.ref == 'refs/heads/main' }}"
46+
tags: |
47+
ghcr.io/openconext/openconext-basecontainers/php82-apache2-node24-composer2:latest
48+
ghcr.io/openconext/openconext-basecontainers/php82-apache2-node24-composer2:${{ github.sha }}
49+
cache-from: type=gha
50+
cache-to: type=gha
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM ghcr.io/openconext/openconext-basecontainers/php82-apache2:latest
2+
3+
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
4+
COPY --from=node:24-slim /usr/local/bin /usr/local/bin
5+
COPY --from=node:24-slim /opt /opt
6+
COPY --from=node:24-slim /usr/local/lib/node_modules /usr/local/lib/node_modules
7+
8+
ENV DEBIAN_FRONTEND=noninteractive
9+
RUN \
10+
apt-get update && \
11+
apt-get -y install \
12+
git \
13+
unzip \
14+
vim \
15+
zip \
16+
&& \
17+
rm -rf /var/lib/apt/lists/* /var/cache/apt /var/log/alternatives.log /var/log/apt /var/log/dpkg.log
18+
RUN npm install -g yarn --force
19+
20+
# enable xdebug
21+
RUN docker-php-ext-enable xdebug
22+
COPY ./conf/xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
23+
24+
RUN mkdir -p /var/www/html/public
25+
26+
RUN rm -rf /etc/apache2/sites-enabled/*
27+
COPY ./conf/appconf.conf /etc/apache2/sites-enabled/
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
ServerAdmin admin@dev.openconext.local
2+
3+
DocumentRoot /var/www/html/public
4+
5+
SetEnv HTTPS on
6+
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
7+
8+
<Directory "/var/www/html/public">
9+
Require all granted
10+
11+
Options -MultiViews
12+
RewriteEngine On
13+
RewriteCond %{REQUEST_FILENAME} !-f
14+
RewriteRule ^(.*)$ index.php [QSA,L]
15+
</Directory>
16+
<Location />
17+
Require all granted
18+
</Location>
19+
20+
Header always set X-Content-Type-Options "nosniff"
21+
22+
# Set the php application handler so mod_php interpets the files
23+
<FilesMatch \.php$>
24+
SetHandler application/x-httpd-php
25+
</FilesMatch>
26+
27+
ExpiresActive on
28+
ExpiresByType font/* "access plus 1 year"
29+
ExpiresByType image/* "access plus 6 months"
30+
ExpiresByType text/css "access plus 1 year"
31+
ExpiresByType text/js "access plus 1 year"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
xdebug.mode = debug
2+
xdebug.discover_client_host = true
3+
xdebug.idekey = PHPSTORM
4+
xdebug.client_host=host.docker.internal
5+
xdebug.client_port=9003
6+
zend_extension=xdebug

0 commit comments

Comments
 (0)