From 189dc975bd35cf9adc8febcea6f56e24274c1f5b Mon Sep 17 00:00:00 2001 From: Jonatan Rek Date: Wed, 28 Jan 2026 10:40:10 +0100 Subject: [PATCH 1/5] Refactor Docker setup: move Dockerfiles to respective directories and add supervisor configurations --- .gitea/workflows/docker-build.yaml | 36 +++++++- Dockerfile => apache/Dockerfile | 0 .../supervisor}/conf.d/laravel-queues.conf | 0 .../supervisor}/supervisord.conf | 0 fmp-alpine/Dockerfile | 83 +++++++++++++++++++ 5 files changed, 116 insertions(+), 3 deletions(-) rename Dockerfile => apache/Dockerfile (100%) rename {supervisor => apache/supervisor}/conf.d/laravel-queues.conf (100%) rename {supervisor => apache/supervisor}/supervisord.conf (100%) create mode 100644 fmp-alpine/Dockerfile diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index f90c93b..8dddafa 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -33,10 +33,8 @@ jobs: - uses: docker/build-push-action@v6 with: - context: . + context: ./apache/ push: true - labels: | - org.steelants.image.traffic.version=${{ env.release_version }} tags: git.steelants.cz/steelants/docker_php_base:latest # ✅ Notifikace při úspěšném deploymentu @@ -52,6 +50,38 @@ jobs: Commit: ${{ github.sha }} Version: ${{ env.release_version }} + # ❌ Notifikace při neúspěšném deploymentu + - name: Discord Webhook Failure + if: failure() + uses: tsickert/discord-webhook@v6.0.0 + with: + webhook-url: ${{ secrets.WEBHOOK_URL }} + content: | + ❌ Build failed! + Repo: ${{ github.repository }} + Branch: ${{ github.ref_name }} + Commit: ${{ github.sha }} + Version: ${{ env.release_version }} + + - uses: docker/build-push-action@v6 + with: + context: ./fmp-alpine/ + push: true + tags: git.steelants.cz/steelants/docker_php_base:fpm-alpine-latest + + # ✅ Notifikace při úspěšném deploymentu + - name: Discord Webhook Success + if: success() + uses: tsickert/discord-webhook@v6.0.0 + with: + webhook-url: ${{ secrets.WEBHOOK_URL }} + content: | + ✅ Build successful! + Repo: ${{ github.repository }} + Branch: ${{ github.ref_name }} + Commit: ${{ github.sha }} + Version: ${{ env.release_version }} + # ❌ Notifikace při neúspěšném deploymentu - name: Discord Webhook Failure if: failure() diff --git a/Dockerfile b/apache/Dockerfile similarity index 100% rename from Dockerfile rename to apache/Dockerfile diff --git a/supervisor/conf.d/laravel-queues.conf b/apache/supervisor/conf.d/laravel-queues.conf similarity index 100% rename from supervisor/conf.d/laravel-queues.conf rename to apache/supervisor/conf.d/laravel-queues.conf diff --git a/supervisor/supervisord.conf b/apache/supervisor/supervisord.conf similarity index 100% rename from supervisor/supervisord.conf rename to apache/supervisor/supervisord.conf diff --git a/fmp-alpine/Dockerfile b/fmp-alpine/Dockerfile new file mode 100644 index 0000000..a573415 --- /dev/null +++ b/fmp-alpine/Dockerfile @@ -0,0 +1,83 @@ +FROM php:8.4-fpm-alpine + +ENV TZ="Europe/Prague" \ + PHP_OPCACHE_ENABLE=1 \ + PHP_OPCACHE_VALIDATE_TIMESTAMPS=0 \ + PHP_OPCACHE_REVALIDATE_FREQ=0 \ + PHP_OPCACHE_MEMORY_CONSUMPTION=192 \ + PHP_OPCACHE_MAX_ACCELERATED_FILES=20000 \ + PHP_OPCACHE_MAX_WASTED_PERCENTAGE=10 \ + PHP_OPCACHE_INTERNED_STRINGS_BUFFER=16 \ + APP_ENV=production \ + APP_DEBUG=false + +RUN apk add --no-cache \ + tzdata \ + bash \ + ca-certificates \ + libpq \ + libzip \ + imagemagick \ + imagemagick-dev \ + librsvg \ + freetype \ + libjpeg-turbo \ + libpng \ + icu \ + oniguruma \ + libxml2 + +RUN apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + postgresql-dev \ + libzip-dev \ + freetype-dev \ + libjpeg-turbo-dev \ + libpng-dev \ + icu-dev \ + libxml2-dev + +RUN docker-php-ext-configure gd \ + --with-freetype \ + --with-jpeg \ + && docker-php-ext-install -j$(nproc) \ + pdo_mysql \ + pdo_pgsql \ + pgsql \ + zip \ + bcmath \ + soap \ + sockets \ + pcntl \ + gd \ + intl \ + opcache + +RUN pecl install imagick \ + && docker-php-ext-enable imagick + +RUN apk del .build-deps + +RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \ + && echo "date.timezone=${TZ}" > "$PHP_INI_DIR/conf.d/99-timezone.ini" + +RUN { \ + echo "memory_limit=256M"; \ + echo "upload_max_filesize=100M"; \ + echo "post_max_size=100M"; \ + echo "realpath_cache_size=4096K"; \ + echo "realpath_cache_ttl=600"; \ +} > "$PHP_INI_DIR/conf.d/99-laravel.ini" + +RUN { \ + echo "[opcache]"; \ + echo "opcache.enable=${PHP_OPCACHE_ENABLE}"; \ + echo "opcache.enable_cli=0"; \ + echo "opcache.validate_timestamps=${PHP_OPCACHE_VALIDATE_TIMESTAMPS}"; \ + echo "opcache.revalidate_freq=${PHP_OPCACHE_REVALIDATE_FREQ}"; \ + echo "opcache.memory_consumption=${PHP_OPCACHE_MEMORY_CONSUMPTION}"; \ + echo "opcache.interned_strings_buffer=${PHP_OPCACHE_INTERNED_STRINGS_BUFFER}"; \ + echo "opcache.max_accelerated_files=${PHP_OPCACHE_MAX_ACCELERATED_FILES}"; \ + echo "opcache.max_wasted_percentage=${PHP_OPCACHE_MAX_WASTED_PERCENTAGE}"; \ + echo "opcache.save_comments=1"; \ +} > "$PHP_INI_DIR/conf.d/10-opcache.ini" \ No newline at end of file From b6f8151bd4746856e2da292d0869bf8b923455a1 Mon Sep 17 00:00:00 2001 From: Jonatan Rek Date: Wed, 28 Jan 2026 10:41:13 +0100 Subject: [PATCH 2/5] Fixes --- .gitea/workflows/docker-build.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index 8dddafa..4de8997 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -44,7 +44,7 @@ jobs: with: webhook-url: ${{ secrets.WEBHOOK_URL }} content: | - ✅ Build successful! + ✅ APACHE - Build successful! Repo: ${{ github.repository }} Branch: ${{ github.ref_name }} Commit: ${{ github.sha }} @@ -57,7 +57,7 @@ jobs: with: webhook-url: ${{ secrets.WEBHOOK_URL }} content: | - ❌ Build failed! + ❌ APACHE - Build failed! Repo: ${{ github.repository }} Branch: ${{ github.ref_name }} Commit: ${{ github.sha }} @@ -76,7 +76,7 @@ jobs: with: webhook-url: ${{ secrets.WEBHOOK_URL }} content: | - ✅ Build successful! + ✅ FMP - ALPINE - Build successful! Repo: ${{ github.repository }} Branch: ${{ github.ref_name }} Commit: ${{ github.sha }} @@ -89,7 +89,7 @@ jobs: with: webhook-url: ${{ secrets.WEBHOOK_URL }} content: | - ❌ Build failed! + ❌ FMP - ALPINE - Build failed! Repo: ${{ github.repository }} Branch: ${{ github.ref_name }} Commit: ${{ github.sha }} From c498df805cd6a9bc4b6f9e6a88373037a1a8879e Mon Sep 17 00:00:00 2001 From: Jonatan Rek Date: Wed, 28 Jan 2026 11:16:03 +0100 Subject: [PATCH 3/5] Fix --- fmp-alpine/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fmp-alpine/Dockerfile b/fmp-alpine/Dockerfile index a573415..402c1cb 100644 --- a/fmp-alpine/Dockerfile +++ b/fmp-alpine/Dockerfile @@ -35,7 +35,8 @@ RUN apk add --no-cache --virtual .build-deps \ libjpeg-turbo-dev \ libpng-dev \ icu-dev \ - libxml2-dev + libxml2-dev \ + linux-headers RUN docker-php-ext-configure gd \ --with-freetype \ @@ -47,11 +48,11 @@ RUN docker-php-ext-configure gd \ zip \ bcmath \ soap \ - sockets \ - pcntl \ gd \ intl \ - opcache + opcache \ + sockets \ + pcntl RUN pecl install imagick \ && docker-php-ext-enable imagick From 34cc835f1cabb59c9f0f890ec19e6a1ff67e7178 Mon Sep 17 00:00:00 2001 From: Jonatan Rek Date: Thu, 29 Jan 2026 15:36:15 +0100 Subject: [PATCH 4/5] Fixes --- .gitea/workflows/docker-build-dev.yaml | 66 -------------------------- 1 file changed, 66 deletions(-) delete mode 100644 .gitea/workflows/docker-build-dev.yaml diff --git a/.gitea/workflows/docker-build-dev.yaml b/.gitea/workflows/docker-build-dev.yaml deleted file mode 100644 index 49f14fa..0000000 --- a/.gitea/workflows/docker-build-dev.yaml +++ /dev/null @@ -1,66 +0,0 @@ -name: "Build - Docker Image - RC" -run-name: ${{ gitea.actor }} is runs ci pipeline - -on: - push: - branches: - - dev - - schedule: - - cron: "0 1 * * *" - -concurrency: - group: docker-build-dev - cancel-in-progress: true - -jobs: - publish: - runs-on: ubuntu-latest - permissions: - packages: write - container: - image: catthehacker/ubuntu:act-latest - steps: - - uses: actions/checkout@v3 - - - uses: docker/setup-buildx-action@v1 - - - uses: docker/login-action@v3 - with: - registry: git.steelants.cz - username: ${{ secrets.GITEAUSER }} - password: ${{ secrets.GITEAPASSWD }} - - - uses: docker/build-push-action@v6 - with: - context: . - push: true - labels: | - org.steelants.image.traffic.version=${{ env.release_version }} - tags: git.steelants.cz/steelants/docker_php_base:dev - - # ✅ Notifikace při úspěšném deploymentu - - name: Discord Webhook Success - if: success() - uses: tsickert/discord-webhook@v6.0.0 - with: - webhook-url: ${{ secrets.WEBHOOK_URL }} - content: | - ✅ Build successful! - Repo: ${{ github.repository }} - Branch: ${{ github.ref_name }} - Commit: ${{ github.sha }} - Version: ${{ env.release_version }} - - # ❌ Notifikace při neúspěšném deploymentu - - name: Discord Webhook Failure - if: failure() - uses: tsickert/discord-webhook@v6.0.0 - with: - webhook-url: ${{ secrets.WEBHOOK_URL }} - content: | - ❌ Build failed! - Repo: ${{ github.repository }} - Branch: ${{ github.ref_name }} - Commit: ${{ github.sha }} - Version: ${{ env.release_version }} \ No newline at end of file From 85ed62b401c8d630bd88aae97f6adba820836fe3 Mon Sep 17 00:00:00 2001 From: Jonatan Rek Date: Thu, 29 Jan 2026 15:37:40 +0100 Subject: [PATCH 5/5] Fix context paths in Docker build configuration --- .gitea/workflows/docker-build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index 4de8997..bdf40dc 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -33,7 +33,7 @@ jobs: - uses: docker/build-push-action@v6 with: - context: ./apache/ + context: apache push: true tags: git.steelants.cz/steelants/docker_php_base:latest @@ -65,7 +65,7 @@ jobs: - uses: docker/build-push-action@v6 with: - context: ./fmp-alpine/ + context: fmp-alpine push: true tags: git.steelants.cz/steelants/docker_php_base:fpm-alpine-latest