38 lines
1.1 KiB
Text
38 lines
1.1 KiB
Text
|
# syntax=docker/dockerfile:1.7-labs
|
||
|
ARG PHP_VERSION=8.3
|
||
|
ARG POSTGRESQL_VERSION=17
|
||
|
|
||
|
#
|
||
|
# Application image
|
||
|
#
|
||
|
|
||
|
FROM php:${PHP_VERSION}-fpm-alpine AS application
|
||
|
|
||
|
RUN <<EOF
|
||
|
set -e
|
||
|
apk add --no-cache fcgi unzip postgresql-dev libmemcached-dev \
|
||
|
libmemcached autoconf pkgconfig g++ zlib-dev make
|
||
|
docker-php-ext-install pgsql pdo pdo_pgsql
|
||
|
pecl install memcached
|
||
|
docker-php-ext-enable memcached
|
||
|
mkdir -p /var/www/tasks
|
||
|
echo "pm.status_path = /status" >> /usr/local/etc/php-fpm.d/zz-docker.conf
|
||
|
echo "chdir = /var/www/tasks/site" >> /usr/local/etc/php-fpm.d/zz-docker.conf
|
||
|
curl --silent --remote-name https://raw.githubusercontent.com/renatomefi/php-fpm-healthcheck/v0.5.0/php-fpm-healthcheck
|
||
|
install --owner root --group root --mode 755 php-fpm-healthcheck /usr/local/bin/php-fpm-healthcheck
|
||
|
rm -rf php-fpm-healthcheck
|
||
|
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
|
||
|
EOF
|
||
|
HEALTHCHECK --interval=5s \
|
||
|
CMD php-fpm-healthcheck || exit 1
|
||
|
|
||
|
COPY --parents site includes arse /var/www/tasks/
|
||
|
|
||
|
#
|
||
|
# Database image
|
||
|
#
|
||
|
|
||
|
FROM postgres:${POSTGRESQL_VERSION} AS database
|
||
|
RUN mkdir /opt/tasks
|
||
|
COPY --parents database.sql database /opt/tasks/
|