Skip to content

Commit

Permalink
Merge remote-tracking branch 'openconext/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
baszoetekouw committed Oct 31, 2023
2 parents a45c753 + 6bf5202 commit f17b0ff
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 23 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/build-apache2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build the Apache2 container

on:
push:
branches:
- main
paths:
- apache2/**
schedule:
- cron: '0 7 * * *'
workflow_dispatch:


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

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

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

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: ./apache2
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/openconext/openconext-basecontainers/apache2:latest
ghcr.io/openconext/openconext-basecontainers/apache2:${{ github.sha }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- # Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Build the PHP 8.2 Apache2 Node14 Composer2 container
name: Build the PHP 8.2 Apache2 Node20 Composer2 container

on:
push:
branches:
- main
paths:
- php82-apache2-node14-composer2/**
- php82-apache2-node20-composer2/**
schedule:
- cron: '0 7 * * *'

Expand Down Expand Up @@ -42,12 +42,12 @@ jobs:
- name: Build and push
uses: docker/build-push-action@v4
with:
context: ./php82-apache2-node14-composer2
context: ./php82-apache2-node20-composer2
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/openconext/openconext-basecontainers/php82-apache2-node14-composer2:latest
ghcr.io/openconext/openconext-basecontainers/php82-apache2-node14-composer2:${{ github.sha }}
ghcr.io/openconext/openconext-basecontainers/php82-apache2-node20-composer2:latest
ghcr.io/openconext/openconext-basecontainers/php82-apache2-node20-composer2:${{ github.sha }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ We provide the following base containers which can be used in downstream project
![Build status for php82 apache2 production image](https://github.com/OpenConext/OpenConext-BaseContainers/actions/workflows/build-php82-apache2.yaml/badge.svg)

**Dev images:** </br>
![Build status for php72 apache2 node14 image](https://github.com/OpenConext/OpenConext-BaseContainers/actions/workflows/build-php82-apache2-node14-composer2.yaml/badge.svg)<br>
![Build status for php72 apache2 node16 image](https://github.com/OpenConext/OpenConext-BaseContainers/actions/workflows/build-php82-apache2-node16-composer2.yaml/badge.svg)
![Build status for php82 apache2 node16 image](https://github.com/OpenConext/OpenConext-BaseContainers/actions/workflows/build-php82-apache2-node16-composer2.yaml/badge.svg)<br>
![Build status for php82 apache2 node20 image](https://github.com/OpenConext/OpenConext-BaseContainers/actions/workflows/build-php82-apache2-node20-composer2.yaml/badge.svg)
1 change: 1 addition & 0 deletions php82-apache2-node16-composer2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM ghcr.io/openconext/openconext-basecontainers/php82-apache2:latest
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
COPY --from=node:16-slim /usr/local/bin /usr/local/bin
COPY --from=node:16-slim /opt /opt
COPY --from=node:16-slim /usr/local/lib/node_modules /usr/local/lib/node_modules
SHELL ["/bin/bash", "--login", "-c"]
RUN apt update && apt -y install git unzip
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM ghcr.io/openconext/openconext-basecontainers/php82-apache2:latest
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
SHELL ["/bin/bash", "--login", "-c"]
COPY --from=node:20-slim /usr/local/bin /usr/local/bin
COPY --from=node:20-slim /opt /opt
COPY --from=node:20-slim /usr/local/lib/node_modules /usr/local/lib/node_modules
RUN apt update && apt -y install git unzip
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
RUN nvm install 14
RUN npm install -g yarn
RUN pecl install xdebug && docker-php-ext-enable xdebug
COPY ./conf/xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN apt autoremove -y && apt clean && apt autoclean && rm -rf /var/lib/apt/lists/*

33 changes: 21 additions & 12 deletions php82-apache2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
FROM php:8.2.6-apache-bullseye

# Copy the Composer PHAR from the Composer image into the PHP image
COPY --from=composer:1.9.3 /usr/bin/composer /usr/bin/composer
RUN chmod +x /usr/bin/composer
FROM php:8.2-apache-bullseye

# Do an initial clean up and general upgrade of the distribution
ENV DEBIAN_FRONTEND noninteractive
RUN apt clean && apt autoclean && apt update
RUN apt -y upgrade && apt -y dist-upgrade

# Install the packages we need
RUN apt install -y curl \
libpng16-16 \
libjpeg62-turbo \
libfreetype6 \
libgmp-dev \
libicu-dev

# Install the PHP extensions we need
RUN docker-php-ext-install gmp \
libicu-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev &&\
docker-php-ext-configure gd --with-freetype --with-jpeg &&\
docker-php-ext-install -j$(nproc) gmp \
opcache \
intl
intl \
gd

# Clean up
RUN apt autoremove -y && apt clean && apt autoclean && rm -rf /var/lib/apt/lists/*
RUN apt -y remove libgmp-dev \
libicu-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev && \
apt autoremove -y && \
apt clean && \
apt autoclean && \
rm -rf /var/lib/apt/lists/*

# Enable the Apache2 modules we need
RUN a2enmod rewrite headers expires proxy_fcgi
Expand Down

0 comments on commit f17b0ff

Please sign in to comment.