Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim committed Jun 13, 2024
0 parents commit 46f836c
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build
on:
schedule:
- cron: '5 0 * * *'
workflow_dispatch:
push:
branches:
- main
paths:
- Dockerfile.php

env:
DOCKER_BUILDKIT: 1

permissions:
contents: read
packages: write
id-token: write

jobs:
php:
name: "${{ matrix.version }}"
runs-on: ubuntu-latest
strategy:
matrix:
version:
- 8.2
- 8.3
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login into Github Docker Registery
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Install and configure Namespace CLI
uses: namespacelabs/nscloud-setup@v0

- name: Configure Namespace powered Buildx
uses: namespacelabs/nscloud-setup-buildx-action@v0

- uses: docker/build-push-action@v5
with:
tags: ghcr.io/friendsofshopware/devcontainer:base-${{ matrix.version }}
platforms: linux/amd64,linux/arm64
file: Dockerfile.php
build-args: |
PHP_VERSION=${{ matrix.version }}
push: true
provenance: false
73 changes: 73 additions & 0 deletions Dockerfile.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
ARG PHP_VERSION=8.3

FROM ghcr.io/shyim/wolfi-php/nginx:${PHP_VERSION}

ARG PHP_VERSION=8.3

ENV DATABASE_URL=mysql://root:root@localhost/shopware \
LOCK_DSN=flock \
PHP_MEMORY_LIMIT=512M \
COMPOSER_ROOT_VERSION=1.0.0 \
APP_URL=http://localhost:8000 \
NPM_CONFIG_ENGINE_STRICT=false

RUN <<EOF
set -e

apk add --no-cache \
libstdc++ \
bash \
valkey \
valkey-cli \
curl \
nodejs-22 \
npm \
git \
composer \
php-${PHP_VERSION} \
php-${PHP_VERSION}-fileinfo \
php-${PHP_VERSION}-openssl \
php-${PHP_VERSION}-ctype \
php-${PHP_VERSION}-curl \
php-${PHP_VERSION}-xml \
php-${PHP_VERSION}-dom \
php-${PHP_VERSION}-phar \
php-${PHP_VERSION}-simplexml \
php-${PHP_VERSION}-xmlreader \
php-${PHP_VERSION}-xmlwriter \
php-${PHP_VERSION}-bcmath \
php-${PHP_VERSION}-iconv \
php-${PHP_VERSION}-mbstring \
php-${PHP_VERSION}-gd \
php-${PHP_VERSION}-intl \
php-${PHP_VERSION}-pdo \
php-${PHP_VERSION}-pdo_mysql \
php-${PHP_VERSION}-mysqlnd \
php-${PHP_VERSION}-pcntl \
php-${PHP_VERSION}-sockets \
php-${PHP_VERSION}-bz2 \
php-${PHP_VERSION}-gmp \
php-${PHP_VERSION}-soap \
php-${PHP_VERSION}-zip \
php-${PHP_VERSION}-sodium \
php-${PHP_VERSION}-opcache \
php-${PHP_VERSION}-zstd \
php-${PHP_VERSION}-redis \
php-${PHP_VERSION}-imagick \
openssl-config \
mariadb-11.2 \
jq

mkdir -p /var/tmp /run/mysqld
mariadb-install-db --datadir=/var/lib/mariadb --user=root
/usr/bin/mariadbd --basedir=/usr --datadir=/var/lib/mariadb --plugin-dir=/usr/lib/mariadb/plugin --user=root &
sleep 2
mariadb-admin --user=root password 'root'
chown -R www-data:www-data /var/www/html /var/lib/mariadb/ /var/tmp /run/mysqld/

ldconfig
EOF

COPY rootfs /

USER www-data
4 changes: 4 additions & 0 deletions rootfs/etc/Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
nginx: /usr/sbin/nginx
php-fpm: /usr/sbin/php-fpm
mysql: /usr/bin/mariadbd --basedir=/usr --datadir=/var/lib/mariadb --plugin-dir=/usr/lib/mariadb/plugin --user=www-data
valkey: /usr/bin/valkey-server --dir /tmp/valkey.rdb
2 changes: 2 additions & 0 deletions rootfs/etc/php/conf.d/mysql-fix.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pdo_mysql.default_socket=/run/mysqld/mysqld.sock
mysqli.default_socket=/run/mysqld/mysqld.sock

0 comments on commit 46f836c

Please sign in to comment.