Skip to content
Merged
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
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Build and push image to registry

on:
push:
branches:
- main
schedule:
- cron: "0 10 * * 1"
workflow_dispatch:
Expand All @@ -18,6 +16,7 @@ jobs:
matrix:
php-version:
- 8.2
- 8.4

steps:
- name: Checkout
Expand Down Expand Up @@ -49,4 +48,4 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
no-cache: true
push: true
push: ${{ github.ref == 'refs/heads/main' }}
59 changes: 59 additions & 0 deletions 8.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
FROM serversideup/php:8.4-fpm-nginx-alpine

COPY --chmod=755 common/ /

# PHP limits
ENV PHP_MEMORY_LIMIT=256M
ENV PHP_POST_MAX_SIZE=100M
ENV PHP_UPLOAD_MAX_FILE_SIZE=${PHP_POST_MAX_SIZE}

# OPcache settings
ENV PHP_OPCACHE_ENABLE=1
ENV PHP_OPCACHE_INTERNED_STRINGS_BUFFER=8
ENV PHP_OPCACHE_MEMORY_CONSUMPTION=128
ENV PHP_OPCACHE_REVALIDATE_FREQ=2

# PHP-FPM settings
ENV PHP_FPM_PM_CONTROL=ondemand
ENV PHP_FPM_PM_MAX_CHILDREN=20
ENV PHP_FPM_PM_START_SERVERS=2
ENV PHP_FPM_PM_MIN_SPARE_SERVERS=1
ENV PHP_FPM_PM_MAX_SPARE_SERVERS=3

# Laravel settings
ENV AUTORUN_ENABLED=true
ENV AUTORUN_LARAVEL_MIGRATION=true
ENV AUTORUN_LARAVEL_STORAGE_LINK=true
ENV AUTORUN_LARAVEL_CONFIG_CACHE=true
ENV AUTORUN_LARAVEL_EVENT_CACHE=true
ENV AUTORUN_LARAVEL_ROUTE_CACHE=true
ENV AUTORUN_LARAVEL_VIEW_CACHE=true
ENV AUTORUN_LARAVEL_FILAMENT=true

ENV HEALTHCHECK_PATH=/up

# Composer settings
ENV COMPOSER_NO_INTERACTION=1
ENV COMPOSER_FUND=0

# Switch to root so we can do root things
USER root

# Install additional PHP extensions
RUN set -ex; \
install-php-extensions \
event \
excimer \
exif \
gd \
intl;

# Drop back to our unprivileged user
USER www-data

ARG VERSION
ARG REVISION

RUN echo "$VERSION (${REVISION:0:7})" > ${APP_BASE_DIR}/.version

EXPOSE 8080 8443
34 changes: 34 additions & 0 deletions common/etc/entrypoint.d/0-container-info.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/sh
if [ "$SHOW_WELCOME_MESSAGE" = "false" ] || [ "$LOG_OUTPUT_LEVEL" = "off" ] || [ "$DISABLE_DEFAULT_CONFIG" = "true" ]; then
if [ "$LOG_OUTPUT_LEVEL" = "debug" ]; then
echo "👉 $0: Container info was display was skipped."
fi
# Skip the rest of the script
return 0
fi

PHP_OPCACHE_STATUS=$(php -r 'echo ini_get("opcache.enable");')

if [ "$PHP_OPCACHE_STATUS" = "1" ]; then
PHP_OPCACHE_MESSAGE="✅ Enabled"
else
PHP_OPCACHE_MESSAGE="❌ Disabled"
fi

echo '
-------------------------------------
ℹ️ Container Information
-------------------------------------'
echo "
OS: $(. /etc/os-release; echo "${PRETTY_NAME}")
Docker user: $(whoami)
Docker uid: $(id -u)
Docker gid: $(id -g)
OPcache: $PHP_OPCACHE_MESSAGE
PHP Version: $(php -r 'echo phpversion();')
Image Version: $(cat /etc/serversideup-php-version)
"

if [ "$PHP_OPCACHE_STATUS" = "0" ]; then
echo "👉 [NOTICE]: Improve PHP performance by setting PHP_OPCACHE_ENABLE=1 (recommended for production)."
fi
20 changes: 20 additions & 0 deletions common/etc/entrypoint.d/51-filament-automation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh
script_name="filament-automations"

if [ "$DISABLE_DEFAULT_CONFIG" = "false" ]; then
# Check to see if an Artisan file exists and assume it means Laravel is configured.
if [ -f "$APP_BASE_DIR/artisan" ]; then
echo "Checking for Filament automations..."
############################################################################
# artisan filament:optimize
############################################################################
if [ "${AUTORUN_LARAVEL_FILAMENT:=true}" = "true" ]; then
echo "🚀 Caching filament components and Blade icons.."
php "$APP_BASE_DIR/artisan" filament:optimize
fi
fi
else
if [ "$LOG_OUTPUT_LEVEL" = "debug" ]; then
echo "👉 $script_name: DISABLE_DEFAULT_CONFIG does not equal 'false', so automations will NOT be performed."
fi
fi
14 changes: 14 additions & 0 deletions common/etc/entrypoint.d/99-laravel-about.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
script_name="laravel-about"

if [ "$DISABLE_DEFAULT_CONFIG" = "false" ]; then
# Check to see if an Artisan file exists and assume it means Laravel is configured.
if [ -f "$APP_BASE_DIR/artisan" ] && [ "${AUTORUN_LARAVEL_ABOUT:=true}" = "true" ]; then
php "$APP_BASE_DIR/artisan" about
fi
else
if [ "$LOG_OUTPUT_LEVEL" = "debug" ]; then
echo "👉 $script_name: DISABLE_DEFAULT_CONFIG does not equal 'false', so automations will NOT be performed."
fi
fi

1 change: 1 addition & 0 deletions common/etc/profile.d/aliases.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alias artisan="php '$APP_BASE_DIR'/artisan"