Merge branch 'main' of github.com:ClusterCockpit/cc-docker

This commit is contained in:
Jan Eitzinger 2021-09-10 14:14:11 +02:00
commit 26db768b8c
5 changed files with 26 additions and 43 deletions

5
.env
View File

@ -9,8 +9,11 @@ APP_ENVIRONMENT=dev
######################################################################## ########################################################################
# PHP # PHP
######################################################################## ########################################################################
PHP_XDEBUG_MODE=develop,debug PHP_XDEBUG_MODE=debug,develop
PHP_XDEBUG_CLIENT_PORT=9003 PHP_XDEBUG_CLIENT_PORT=9003
#> LINUX: 'docker0' interface IP of host
# PHP_XDEBUG_CLIENT_HOST=1.2.3.4
#> MAC/WIN: Docker Wildcard for host IP
PHP_XDEBUG_CLIENT_HOST=host.docker.internal PHP_XDEBUG_CLIENT_HOST=host.docker.internal
######################################################################## ########################################################################

View File

@ -59,7 +59,6 @@ services:
APP_ENVIRONMENT: ${APP_ENVIRONMENT} APP_ENVIRONMENT: ${APP_ENVIRONMENT}
ports: ports:
- "127.0.0.1:${NGINX_PORT}:80" - "127.0.0.1:${NGINX_PORT}:80"
- "127.0.0.1:${PHP_XDEBUG_CLIENT_PORT}:${PHP_XDEBUG_CLIENT_PORT}"
depends_on: depends_on:
- php - php
environment: environment:

View File

@ -1,41 +1,17 @@
FROM alpine:3.13 FROM php:8.0-fpm-alpine3.13
LABEL maintainer="Vincent Composieux <vincent.composieux@gmail.com>" RUN apk add --no-cache $PHPIZE_DEPS \
RUN apk add --no-cache \
coreutils \
gettext \
php8-fpm \
php8-ctype \
php8-curl \
php8-dom \
php8-gd \
php8-iconv \
php8-json \
php8-intl \
php8-fileinfo\
php8-mbstring \
php8-opcache \
php8-openssl \
php8-pdo \
php8-pdo_mysql \
php8-mysqli \
php8-xml \
php8-xsl \
php8-zlib \
php8-phar \
php8-tokenizer \
php8-session \
php8-simplexml \
php8-zip \
php8-xmlwriter \
php8-sodium \
php8-pecl-apcu \
php8-ldap \
bash \
make \
git \ git \
curl gettext \
bash \
ldb-dev \
libldap \
openldap-dev
RUN pecl install xdebug-3.0.4 \
&& docker-php-ext-enable xdebug
RUN docker-php-ext-install ldap mysqli pdo_mysql
# Enable php8-xdebug if $PHP_XDEBUG_MODE is not empty # Enable php8-xdebug if $PHP_XDEBUG_MODE is not empty
ARG PHP_XDEBUG_MODE=off ARG PHP_XDEBUG_MODE=off
@ -50,10 +26,13 @@ RUN if [[ "$PHP_XDEBUG_MODE" != "" ]]; then \
fi fi
RUN rm -f /etc/php8/conf.d/xdebug.ini.template RUN rm -f /etc/php8/conf.d/xdebug.ini.template
RUN cp /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini.back
RUN cp /etc/php8/conf.d/xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
COPY error_reporting.ini /usr/local/etc/php/conf.d/error_reporting.ini
RUN curl -sS https://getcomposer.org/installer | tee composer-setup.php \ RUN curl -sS https://getcomposer.org/installer | tee composer-setup.php \
&& php8 composer-setup.php && rm composer-setup.php* \ && php composer-setup.php && rm composer-setup.php* \
&& chmod +x composer.phar && mv composer.phar /usr/bin/composer \ && chmod +x composer.phar && mv composer.phar /usr/bin/composer
&& ln -s /usr/bin/php8 /usr/local/bin/php
ARG SYMFONY_CLI_VERSION ARG SYMFONY_CLI_VERSION
RUN wget https://github.com/symfony/cli/releases/download/v$SYMFONY_CLI_VERSION/symfony_linux_amd64.gz \ RUN wget https://github.com/symfony/cli/releases/download/v$SYMFONY_CLI_VERSION/symfony_linux_amd64.gz \
@ -101,6 +80,6 @@ ENV CORS_ALLOW_ORIGIN=^https?://(localhost|127\\.0\\.0\\.1)(:[0-9]+)?$
WORKDIR /var/www/symfony WORKDIR /var/www/symfony
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]
CMD ["php-fpm8", "-F"] CMD ["php-fpm", "-F", "-y/etc/php8/php-fpm.d/symfony.pool.conf"]
EXPOSE 9001 EXPOSE 9001

View File

@ -0,0 +1 @@
error_reporting=E_ALL

View File

@ -4,3 +4,4 @@ zend_extension=xdebug.so
xdebug.mode=${PHP_XDEBUG_MODE} xdebug.mode=${PHP_XDEBUG_MODE}
xdebug.client_port=${PHP_XDEBUG_CLIENT_PORT} xdebug.client_port=${PHP_XDEBUG_CLIENT_PORT}
xdebug.client_host=${PHP_XDEBUG_CLIENT_HOST} xdebug.client_host=${PHP_XDEBUG_CLIENT_HOST}
xdebug.start_with_request=yes