cc-docker/php-fpm/Dockerfile

100 lines
3.1 KiB
Docker
Raw Permalink Normal View History

2021-10-06 14:28:28 +02:00
FROM php:8.0-fpm
2021-05-19 14:27:44 +02:00
2021-10-06 14:28:28 +02:00
RUN apt-get update && apt-get install -y \
$PHPIZE_DEPS \
git \
2021-10-06 14:28:28 +02:00
wget \
2021-10-07 10:15:51 +02:00
zip \
2021-05-19 14:27:44 +02:00
gettext \
bash \
2021-10-06 14:28:28 +02:00
libldb-dev \
libldap-2.4-2 \
libldap-common \
libldap2-dev \
npm \
nodejs
RUN apt-get clean
RUN npm install --global yarn
2021-09-13 13:21:00 +02:00
RUN docker-php-ext-install ldap \
mysqli \
pdo_mysql \
opcache
# Enable php8-xdebug if $PHP_XDEBUG_INIT is true
2021-09-13 13:21:00 +02:00
ARG PHP_XDEBUG_INIT="false"
2021-09-08 09:39:22 +02:00
ARG PHP_XDEBUG_MODE=off
ARG PHP_XDEBUG_CLIENT_PORT=5902
ARG PHP_XDEBUG_CLIENT_HOST=host.docker.internal
COPY xdebug.ini /etc/php8/conf.d/xdebug.ini.template
COPY error_reporting.ini /usr/local/etc/php/conf.d/error_reporting.ini
RUN if [[ "$PHP_XDEBUG_INIT" == "true" ]]; then \
pecl install xdebug-3.0.4; \
docker-php-ext-enable xdebug; \
2021-09-08 09:39:22 +02:00
export PHP_XDEBUG_MODE=$PHP_XDEBUG_MODE; \
export PHP_XDEBUG_CLIENT_PORT=$PHP_XDEBUG_CLIENT_PORT; \
export PHP_XDEBUG_CLIENT_HOST=$PHP_XDEBUG_CLIENT_HOST; \
envsubst < /etc/php8/conf.d/xdebug.ini.template > /etc/php8/conf.d/xdebug.ini; \
cp /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini.back; \
cp /etc/php8/conf.d/xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; \
rm -f /etc/php8/conf.d/xdebug.ini.template; \
2021-09-08 09:39:22 +02:00
fi
2021-05-19 14:27:44 +02:00
RUN curl -sS https://getcomposer.org/installer | tee composer-setup.php \
&& php composer-setup.php && rm composer-setup.php* \
&& chmod +x composer.phar && mv composer.phar /usr/bin/composer
2021-05-19 14:27:44 +02:00
ARG SYMFONY_CLI_VERSION
RUN wget https://github.com/symfony/cli/releases/download/v$SYMFONY_CLI_VERSION/symfony_linux_amd64.gz \
&& gzip -d symfony_linux_amd64.gz \
&& mv symfony_linux_amd64 symfony \
&& chmod +x symfony \
&& mv symfony /usr/local/bin/
2021-06-09 09:53:35 +02:00
RUN mkdir -p /var/lib/job-archive
2021-05-20 09:22:17 +02:00
RUN mkdir -p /var/www/symfony
2021-06-09 09:53:35 +02:00
VOLUME /var/www/symfony /var/lib/job-archive
2021-05-19 15:32:22 +02:00
2021-09-13 13:21:00 +02:00
COPY php.ini /usr/local/etc/php/
COPY symfony.ini /usr/local/etc/php/conf.d/
COPY symfony.ini /usr/local/etc/php/cli/conf.d/
COPY symfony.pool.conf /usr/local/etc/php/php-fpm.d/
2021-05-19 14:27:44 +02:00
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
2021-05-19 14:27:44 +02:00
ARG APP_ENVIRONMENT
ENV APP_ENV=${APP_ENVIRONMENT}
ENV APP_SECRET=${APP_SECRET}
2021-09-21 15:07:42 +02:00
ENV APP_JWT_PUB_KEY="${APP_JWT_PUB_KEY}"
ENV APP_JWT_PRIV_KEY="${APP_JWT_PRIV_KEY}"
2021-05-21 08:08:04 +02:00
ENV APP_DEBUG=1
ENV REDIS_URL=redis://cc-redis
2021-09-10 14:13:54 +02:00
ENV LDAP_URL=ldap://cc-ldap
ARG INFLUXDB_PORT
2021-05-19 14:27:44 +02:00
ARG INFLUXDB_PASSWORD
ARG INFLUXDB_ADMIN_TOKEN
2021-09-29 16:39:21 +02:00
ARG INFLUXDB_ORG
ARG INFLUXDB_BUCKET
ARG INFLUXDB_SSL
ENV INFLUXDB_URL=http://cc-influxdb:${INFLUXDB_PORT}
ENV INFLUXDB_SSL=${INFLUXDB_SSL}
ENV INFLUXDB_TOKEN=${INFLUXDB_ADMIN_TOKEN}
2021-09-29 16:39:21 +02:00
ENV INFLUXDB_ORG=${INFLUXDB_ORG}
ENV INFLUXDB_BUCKET=${INFLUXDB_BUCKET}
2021-09-08 09:39:22 +02:00
ARG LDAP_PASSWORD
ENV LDAP_PW=${LDAP_PASSWORD}
ARG MYSQL_USER
ARG MYSQL_PASSWORD
ARG MYSQL_DATABASE
ENV DATABASE_URL=mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@cc-db:3306/${MYSQL_DATABASE}
2021-05-19 14:27:44 +02:00
ENV CORS_ALLOW_ORIGIN=^https?://(localhost|127\\.0\\.0\\.1)(:[0-9]+)?$
2021-05-21 08:08:04 +02:00
WORKDIR /var/www/symfony
2021-06-09 09:53:35 +02:00
2021-09-14 10:05:46 +02:00
ENTRYPOINT ["/entrypoint.sh"]
CMD ["php-fpm", "-F", "-y/usr/local/etc/php/php-fpm.d/symfony.pool.conf"]
2021-06-09 09:53:35 +02:00
EXPOSE 9001