web-base/docker/php/Dockerfile

45 lines
1.7 KiB
Docker
Raw Permalink Normal View History

2022-02-21 00:32:40 +01:00
FROM composer:latest AS composer
2024-04-22 10:59:31 +02:00
FROM php:8.2-fpm
2021-04-07 19:43:22 +02:00
WORKDIR "/application"
2023-01-11 22:05:02 +01:00
ARG ADDITIONAL_PACKAGES
ARG ADDITIONAL_SCRIPT
2024-03-25 17:03:46 +01:00
RUN mkdir -p /application/Core/Configuration /var/www/.gnupg && \
2022-11-19 01:15:34 +01:00
chown -R www-data:www-data /application /var/www/ && \
chmod 700 /var/www/.gnupg
2022-06-01 12:28:50 +02:00
2023-01-11 22:05:02 +01:00
# YAML + dev dependencies + additional packages
2022-11-19 01:15:34 +01:00
RUN apt-get update -y && \
apt-get install -y libyaml-dev libzip-dev libgmp-dev libpng-dev libmagickwand-dev gnupg2 git $ADDITIONAL_PACKAGES && \
2024-04-23 20:14:32 +02:00
printf "\n" | pecl install yaml imagick redis && docker-php-ext-enable yaml imagick redis && \
2023-01-09 15:59:53 +01:00
docker-php-ext-install gd
2023-03-05 15:30:06 +01:00
# Browscap
RUN mkdir -p /usr/local/etc/php/extra/ && \
curl -s "https://browscap.org/stream?q=Full_PHP_BrowsCapINI" -o /usr/local/etc/php/extra/browscap.ini
2023-01-09 15:59:53 +01:00
# NodeJS
2024-04-10 19:04:37 +02:00
RUN curl -sL https://deb.nodesource.com/setup_21.x | bash - && \
2023-01-09 15:59:53 +01:00
apt-get update && \
apt-get -y install nodejs && \
2024-03-24 17:36:16 +01:00
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarnkey.gpg >/dev/null && \
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && apt-get -y install yarn
2022-06-01 12:28:50 +02:00
2022-12-04 13:21:40 +01:00
# Runkit for unit testing (no stable release available)
RUN pecl install runkit7-4.0.0a6 && docker-php-ext-enable runkit7 && \
2022-06-01 12:28:50 +02:00
echo "runkit.internal_override=1" >> /usr/local/etc/php/conf.d/docker-php-ext-runkit7.ini
# mysqli, zip, gmp
RUN docker-php-ext-install mysqli zip gmp
2023-01-09 15:59:53 +01:00
# clean cache
RUN apt-get clean
2023-01-11 22:05:02 +01:00
# run additional scripts
RUN if [[ ! -z "$ADDITIONAL_SCRIPT" ]]; then $ADDITIONAL_SCRIPT; fi
2022-02-21 00:32:40 +01:00
COPY --from=composer /usr/bin/composer /usr/bin/composer
2024-04-10 19:04:37 +02:00
USER www-data