PHP 8.4 install postgres module
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 32s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 2m10s
Create Docker Image / Final Docker Image Manifest (push) Successful in 9s
Create Docker Image / Build Docker Test Image (x86_64) (push) Successful in 38s
Create Docker Image / Final Docker Test Image Manifest (push) Successful in 9s

This commit is contained in:
Deon George 2023-02-03 18:40:31 +11:00 committed by Deon George
parent 7ad82451cb
commit 1b0c55913a
3 changed files with 9 additions and 55 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
DOCKER_HOST: tcp://127.0.0.1:2375
jobs:

View File

@ -1,56 +1,10 @@
# NAME docker/php
# VERSION 8.4-fpm-alpine
# VERSION 8.4-pgsql
FROM dunglas/frankenphp:php8.4-alpine
FROM gitea.dege.au/docker/php:8.4
# 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
ENV COMPOSER_HOME=/var/cache/composer
RUN curl -4 https://getcomposer.org/installer|php -- --install-dir=/usr/local/bin --filename=composer \
&& chown ${SITE_USER}:0 ${COMPOSER_HOME}
# 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 apk add --no-cache postgresql-client libpq \
&& install-php-extensions pdo_pgsql \
&& 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-test
FROM gitea.dege.au/docker/php:8.4
FROM gitea.dege.au/docker/php:8.4-pgsql
# Add xdebug
USER root