Compare commits

...

3 Commits

Author SHA1 Message Date
Deon George
3b0128f35d PHP 8.4 install install sockets and pcntl
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 35s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 2m24s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s
Create Docker Image / Build Docker Test Image (x86_64) (push) Successful in 41s
Create Docker Image / Final Docker Test Image Manifest (push) Successful in 8s
2025-02-14 14:52:59 +11:00
Deon George
86a905f91e PHP 8.4 install postgres module
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 43s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 2m13s
Create Docker Image / Final Docker Image Manifest (push) Successful in 9s
Create Docker Image / Build Docker Test Image (x86_64) (push) Successful in 41s
Create Docker Image / Final Docker Test Image Manifest (push) Successful in 9s
2025-02-14 14:51:46 +11:00
3abf993607 Enable creation of prepend.php and automatically disable opcache
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 3m27s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 16m48s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s
Create Docker Image / Build Docker Test Image (x86_64) (push) Successful in 55s
Create Docker Image / Final Docker Test Image Manifest (push) Successful in 11s
2025-02-13 23:52:59 +11:00
4 changed files with 14 additions and 54 deletions

View File

@ -2,7 +2,7 @@ name: Create Docker Image
run-name: ${{ gitea.actor }} Building Docker Image 🐳
on: [push]
env:
VERSION: 8.4
VERSION: 8.4-pgsql-server
DOCKER_HOST: tcp://127.0.0.1:2375
jobs:

View File

@ -1,55 +1,8 @@
# NAME docker/php
# VERSION 8.4-fpm-alpine
# VERSION 8.4-pgsql-server
FROM dunglas/frankenphp:php8.4-alpine
FROM gitea.dege.au/docker/php:8.4-pgsql
# Change to http respositories, so they we can cache the install packages
RUN if [ -n ${HTTP_PROXY} ] ; then sed -i -e s'/https/http/' /etc/apk/repositories; fi
# Base
RUN apk add --no-cache bash msmtp memcached
ENV SITE_USER=www-data
ENV PHP_DIR=/app
# Additional extensions:
RUN install-php-extensions \
opcache igbinary msgpack memcached zip bz2 zstd brotli gd intl \
&& echo opcache.memory_consumption=512 >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini \
&& echo opcache.interned_strings_buffer=64 >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini \
&& echo opcache.max_accelerated_files=32531 >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini \
&& echo opcache.fast_shutdown=1 >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini \
&& echo opcache.enable_cli=1 >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini \
&& mkdir /tmp/opcache && chown ${SITE_USER}:0 /tmp/opcache && chmod 750 /tmp/opcache && echo opcache.file_cache=/tmp/opcache >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini \
&& echo opcache.validate_timestamps=0 >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini
# Tune PHP
RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini
RUN sed -i -e 's/^memory_limit = 128M/memory_limit = 256M/' /usr/local/etc/php/php.ini
RUN sed -i -e 's/^expose_php = On/expose_php = Off/' /usr/local/etc/php/php.ini
RUN sed -i -e 's#^;sendmail_path =#sendmail_path = "/usr/bin/msmtp -t"#' /usr/local/etc/php/php.ini
# Wait for it
COPY wait-for-it /usr/local/bin/
# Add composer
RUN curl -4 https://getcomposer.org/installer|php -- --install-dir=/usr/local/bin --filename=composer
ENV COMPOSER_HOME=/var/cache/composer
# Other config
COPY msmtprc /etc/
# Startup for ${SITE_USER}
COPY docker/init-docker /sbin/init-docker
RUN chmod 550 /sbin/init-docker && chown ${SITE_USER}:0 /sbin/init-docker && chown -R ${SITE_USER}:0 ${XDG_DATA_HOME} ${XDG_CONFIG_HOME}
VOLUME [ "/var/cache/composer" ]
WORKDIR ${PHP_DIR}
USER root
RUN install-php-extensions sockets pcntl && rm -rf /tmp/opcache/*
USER ${SITE_USER}
# Control which port to open
ENV SERVER_NAME=:8080
EXPOSE 8080
ENTRYPOINT [ "/sbin/init-docker" ]
CMD [ "--config","/etc/caddy/Caddyfile","--adapter","caddyfile" ]

View File

@ -1,7 +1,7 @@
# NAME docker/php
# VERSION 8.4-fpm-test
# VERSION 8.4-pgsql-server-test
FROM gitea.dege.au/docker/php:8.4
FROM gitea.dege.au/docker/php:8.4-pgsql-server
# Add xdebug
USER root

View File

@ -46,6 +46,13 @@ if [ -x /usr/bin/memcached -a "${MEMCACHED_START}" == "TRUE" ]; then
/usr/bin/memcached -d -P /run/memcached/memcached.pid -u memcached
fi
# If we are local, then disable the opcache
if [ "${ENV}" != "production" -a ! -e ${PHP_DIR}/pprepend.php ]; then
echo "* Automatically disabling opcache as environment is not production [${ENV}]"
echo "<?php ini_set('opcache.enable',false);" > ${PHP_DIR}/prepend.php
sed -i -e s"#auto_prepend_file =#auto_prepend_file=${PHP_DIR}/prepend.php#" /usr/local/etc/php/php.ini
fi
# Laravel Specific
if [ -r artisan -a -e ${php}/.env ]; then
echo "* Laravel Setup..."