I'm trying to setup development environment for one PHP application but I can't solve these two things:
sending emails (I would like use MailHog which is running but it seems that I haven't correct PHP configuration)
xdebug (is installed and log is working but I can not connect it from NetBeans IDE)
Here is my configuration:
docker-compose.yml:
version: "3.1"
services:
# MySQL
database:
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: testuser
MYSQL_PASSWORD: testpass
MYSQL_DATABASE: testdb
image: mariadb
restart: always
volumes:
- "./docker/mariadb/data:/var/lib/mysql"
- "./docker/mariadb/init:/docker-entrypoint-initdb.d"
# PHP
php-fpm:
build:
context: ./docker/php-fpm
environment:
ENV_MODE: development
ENV_BRANCH: test
volumes:
- "./:/var/www/app"
# NGINX
webserver:
build:
context: ./docker/nginx
depends_on:
- php-fpm
environment:
MYSQL_DATABASE: testdb
MYSQL_USER: testuser
MYSQL_PASSWORD: testpass
MYSQL_ROOT_PASSWORD: root
links:
- database:mysql
- mailhog
ports:
- "80:80"
- "443:443"
volumes:
- "./:/var/www/inpage"
- "./docker/nginx/nginx.conf:/etc/nginx/nginx.conf"
- "./docker/nginx/inpage.inc.conf:/etc/nginx/inpage.inc.conf"
- "./docker/nginx/inpage-site.inc.conf:/etc/nginx/app-site.inc.conf"
- "./docker/nginx/sites/:/etc/nginx/sites-available"
- "./docker/nginx/conf.d/:/etc/nginx/conf.d"
# Adminer
adminer:
depends_on:
- database
environment:
ADMINER_DEFAULT_SERVER: database
image: adminer
ports:
- 8181:8080
restart: always
# MailHog
mailhog:
image: mailhog/mailhog
command: -smtp-bind-addr 127.0.0.1:1025
user: root
expose:
- 1025
- 8025
ports:
- 1025:1025
- 8025:8025
docker/php-fpm/Dockerfile:
# Customized Dockerfile from https://github.com/kporras07/docker-php.
FROM php:7.0-fpm-alpine
# Environment settings
ENV XDEBUG_VERSION 2.3.3
ENV PHP_MEMORY_LIMIT 256M
ENV PHP_MAX_EXECUTION_TIME 120
ENV PHP_POST_MAX_SIZE 100M
ENV PHP_UPLOAD_MAX_FILESIZE 100M
ENV PHP_INI_DIR /usr/local/etc/php
# Configure, build & install PHP
RUN docker-php-source extract \
&& apk --no-cache --update add \
libxml2-dev \
libpng \
libpng-dev \
libjpeg-turbo \
libjpeg-turbo-dev \
freetype-dev \
freetype \
libcurl \
curl-dev \
curl \
icu-dev \
g++ \
autoconf \
make \
libmcrypt-dev \
libmcrypt \
libintl \
openssl-dev \
re2c \
recode-dev \
sqlite-dev \
enchant-dev \
krb5-dev \
pcre-dev \
imagemagick-dev \
imagemagick \
libtool \
bzip2-dev \
freetds-dev \
freetype-dev \
gmp-dev \
imap-dev \
readline-dev \
recode-dev \
zip \
libzip \
libzip-dev \
libxslt \
libxslt-dev \
&& rm -rf /tmp/* \
&& rm -rf /var/cache/apk/* \
&& docker-php-ext-configure bcmath \
&& docker-php-ext-configure bz2 \
&& docker-php-ext-configure json \
&& docker-php-ext-configure session \
&& docker-php-ext-configure ctype \
&& docker-php-ext-configure curl \
&& docker-php-ext-configure tokenizer \
&& docker-php-ext-configure simplexml \
&& docker-php-ext-configure dom \
&& docker-php-ext-configure mbstring \
&& docker-php-ext-configure zip \
&& docker-php-ext-configure iconv \
&& docker-php-ext-configure xml \
&& docker-php-ext-configure opcache \
&& docker-php-ext-configure pdo \
&& docker-php-ext-configure pdo_mysql \
&& docker-php-ext-configure pdo_sqlite \
&& docker-php-ext-configure gettext \
&& docker-php-ext-configure gmp \
&& docker-php-ext-configure intl --enable-intl \
&& docker-php-ext-configure mcrypt \
&& docker-php-ext-configure phar \
&& docker-php-ext-configure soap \
&& docker-php-ext-configure sockets \
&& docker-php-ext-configure xml \
&& docker-php-ext-configure xsl \
&& docker-php-ext-configure gd --with-gd --with-freetype-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ \
--with-png-dir=/usr/include/ \
&& NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) \
&& docker-php-ext-install -j${NPROC} gd \
&& docker-php-source delete
RUN docker-php-ext-install bcmath \
bz2 \
json \
session \
ctype \
curl \
tokenizer \
simplexml \
dom \
mbstring \
zip \
iconv \
xml \
opcache \
pdo \
pdo_mysql \
gettext \
gmp \
intl \
mcrypt \
phar \
soap \
sockets \
xml \
xsl
RUN apk update \
&& apk add ca-certificates wget \
&& update-ca-certificates
# Blackfire.io
RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
&& curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/alpine/amd64/$version \
&& mkdir -p /tmp/blackfire \
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
&& mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \
&& printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707\n" > $PHP_INI_DIR/conf.d/blackfire.ini \
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
# Xdebug
RUN pecl install xdebug
RUN docker-php-ext-enable xdebug
COPY ./xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
## mhsendmail for MailHog (https://github.com/mailhog/mhsendmail)
RUN apk update && apk add \
go \
git
RUN mkdir /root/go
ENV GOPATH=/root/go
ENV PATH=$PATH:$GOPATH/bin
RUN go get github.com/mailhog/mhsendmail
RUN cp /root/go/bin/mhsendmail /usr/bin/mhsendmail
COPY ./php.ini /usr/local/etc/php/conf.d/docker-php.ini
# Fix iconv lib (https://github.com/docker-library/php/issues/240#issuecomment-305038173)
RUN apk add --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing gnu-libiconv
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
# Cleanup
RUN rm -rf /tmp/* \
&& rm -rf /var/cache/apk/* \
&& rm -rf tmp/*
CMD ["php-fpm"]
EXPOSE 9000
docker/php-fpm/xdebug.ini:
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so
xdebug.coverage_enable=0
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
;xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
;xdebug.remote_connect_back=1
xdebug.remote_log=/tmp/xdebug.log
;xdebug.remote_autostart=true
docker/php-fpm/php.ini:
memory_limit = ${PHP_MEMORY_LIMIT}
max_execution_time = ${PHP_MAX_EXECUTION_TIME}
post_max_size=${PHP_POST_MAX_SIZE}
upload_max_filesize=${PHP_UPLOAD_MAX_FILESIZE}
sendmail_path = /usr/bin/mhsendmail -S mailhog:1025 -t
I found a solution to the mailhog 'connection refused' part of this question on the mailhog github issues pages. You need to replace the sendmail_path statement in your
docker/php-fpm/php.ini with something like this (the -S option isn't supported, and the position of the quote marks is important):
sendmail_path = "/usr/bin/mhsendmail --smtp-addr=mailhog:1025"
Also I found that I didn't need to use the command, user or expose parts of the mailhog service section in the docker-compose file.
Related
I'm running docker-compose up to build my project and when it goes through the update of container dependencies it throws me the following error.
Dockerfile:
FROM php:7.2.17-apache-stretch
RUN mkdir /var/www/html/public /etc/apache2/ssl
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash
RUN apt-get update && \
apt-get install -y \
zip unzip git nodejs libmcrypt-dev libxml2-dev libpng-dev libzmq3-dev libzip-dev libkrb5-dev libc-client-dev \
libnotify-bin zlib1g-dev libicu-dev libmagickwand-dev libmagickcore-dev && \
rm -r /var/lib/apt/lists/* && \
pecl install dbase-7.0.0beta1 imagick
RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \
docker-php-ext-configure zip --with-libzip && \
docker-php-ext-install pdo pdo_mysql soap gd imap && \
docker-php-ext-install zip && \
docker-php-ext-enable dbase imagick
COPY --from=composer /usr/bin/composer /usr/local/bin/composer
COPY certificates/ /etc/apache2/ssl/
RUN sed -i "s|DocumentRoot /var/www/html|DocumentRoot /var/www/html/public|g" /etc/apache2/sites-available/000-default.conf && \
echo "upload_max_filesize = 20M" >> /usr/local/etc/php/conf.d/docker-php-conf.ini && \
touch /etc/apache2/sites-enabled/000-default-ssl.conf && \
echo "<VirtualHost *:443>\n \
DocumentRoot \"/var/www/html/public\"\n \
ServerName localhost\n \
SSLEngine on\n \
SSLCertificateFile \"/etc/apache2/ssl/server.pem\"\n \
SSLCertificateKeyFile \"/etc/apache2/ssl/server.key\"\n \
</VirtualHost>" >> /etc/apache2/sites-enabled/000-default-ssl.conf
RUN a2enmod rewrite headers && \
a2enmod ssl
RUN service apache2 restart
docker-compose.yaml:
version: '3.5'
services:
debito:
build:
context: '.'
container_name: debito
volumes:
- .:/var/www/html
ports:
- 32770:80
- 32990:443
networks:
backend:
aliases:
- decreditos
redis:
container_name: debito-redis
image: redis:5
ports:
- 6383:6379
networks:
backend:
aliases:
- decreditos
networks:
backend:
name: decreditos
If someone can help me I would really appreciate it since I've been wanting to find this for a long time and I can't find the solution
I have a Dockerfile in my project
FROM php:7.4-fpm-alpine
WORKDIR '/app'
RUN set -ex \
&& apk update && apk upgrade\
# Installations into virtual env so they can be deleted afterwards
# (.phpize-deps is standardized by docker-php-ext-install)
&& apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS \
&& apk add --no-cache --virtual .build-deps \
postgresql-dev \
libstdc++ \
make \
# Installations that should be kept
&& apk add --no-cache \
bash \
wget \
curl \
libbz2 \
libzip-dev \
zlib-dev \
bzip2-dev \
libxslt-dev \
libmcrypt-dev \
libxml2-dev \
libjpeg-turbo-dev \
libpng-dev \
yaml-dev \
libaio-dev \
oniguruma-dev \
php7-bz2 \
php7-pdo php7-pgsql php7-bcmath php7-zmq php7-curl php7-pear \
# unzip \
# ffmpeg \
# Install php extensions
&& docker-php-ext-configure gd --with-jpeg \
&& docker-php-ext-install bcmath bz2 exif gd json mbstring opcache pcntl pdo pdo_pgsql simplexml sockets xsl zip \
&& pecl install apcu-5.1.18 \
&& docker-php-ext-enable apcu \
# Install composer
&& EXPECTED_COMPOSER_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig) \
&& php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& php -r "if (hash_file('SHA384', 'composer-setup.php') === '${EXPECTED_COMPOSER_SIGNATURE}') { echo 'Composer.phar Installer verified'; } else { echo 'Composer.phar Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
&& php composer-setup.php --install-dir=/usr/bin --filename=composer \
&& php -r "unlink('composer-setup.php');" \
# Remove unnecessary stuff
&& apk del .phpize-deps .build-deps
# install xdebug
#RUN pecl install xdebug
#RUN wget http://xdebug.org/files/xdebug-2.6.1.tgz
#RUN tar -xvzf xdebug-2.6.1.tgz
#RUN cd xdebug-2.6.1 \
#&& phpize \
#&& ./configure --enable-xdebug \
#&& make \
#&& make install \
#&& cp modules/xdebug.so /usr/local/lib/php/extensions/no-debug-non-zts-20170718 \
#&& echo 'zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so' >> /usr/local/etc/php/php.ini \
#&& echo 'zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so' >> /etc/php7/php.ini \
#&& echo 'xdebug.remote_enable=true' >> /etc/php7/php.ini \
#&& echo 'xdebug.remote_host=127.0.0.1' >> /etc/php7/php.ini \
#&& echo 'xdebug.remote_port=9000' >> /etc/php7/php.ini \
#&& echo 'xdebug.remote_handler=dbgp' >> /etc/php7/php.ini \
#&& echo 'xdebug.max_nesting_level=512' >> /etc/php7/php.ini
#EXPOSE 22
# Install PDO_PGSQL and APCU
#RUN set -ex \
# && apk --no-cache add \
# postgresql-dev \
# libpq-dev \
# && docker-php-source extract \
# && apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS \
# && pecl install apcu-5.1.12 \
# && docker-php-ext-enable apcu \
# && docker-php-ext-install pdo pdo_pgsql \
# && apk del .phpize-deps
# && docker-php-source delete
WORKDIR /var/www/html
# Use the default PHP production configuration
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
# custom PHP adjustments
COPY .server/config/php.ini $PHP_INI_DIR/conf.d/zz-usln.ini
# custom PHP-FPM adjustments (zz to make them the last being applied)
COPY .server/config/php-fpm.conf ${PHP_INI_DIR}-fpm.d/zz-usln.conf
RUN sed -ie 's/;daemonize = yes/daemonize = no/g' ${PHP_INI_DIR}-fpm.d/zz-usln.conf
# RUN echo $(locate php-fpm.conf)
# Composer install stuff
COPY composer.* ./
RUN set -ex \
&& composer global require hirak/prestissimo \
&& composer install --prefer-dist --no-interaction --no-dev -a \
&& composer global remove hirak/prestissimo \
# Delete cache directory to reduce size of image
&& rm -rf ~/.composer/cache
# Copy Code
# Excludes etc. are handled by the .dockerignore file
COPY . .
# Generate proxies for production usage
RUN set -ex \
&& composer dump-autoload --no-dev -a \
# RUN chmod +x ./build_environment.sh
# RUN chmod +x ./vendor/bin/doctrine
# RUN bash ./build_environment.sh -g local
&& ./vendor/bin/doctrine orm:generate-proxies \
# Re-generate autoload files with all the files copies
&& composer dump-autoload --no-dev -a
# Output log to stdout (only works after container has been started, this is why this is the last command)
# && ln -sf /proc/self/fd/1 logs/app.log
RUN chown -R www-data:www-data ./logs/
RUN chown -R www-data:www-data ./tmp/
# fastcgi/php-fpm server available on port 9000, needs extra nginx to be able to serve http
EXPOSE 9000
running docker build . works 100%
When I try bring up the container, the container exits with an error code of 70.
I think it has something to do with PHP FPM because of the error code but I cannot figure out what the issue is.
EDIT
Here's the docker-compose.yml
version: '3.1'
services:
api-backend:
build: ./
ports:
- 9000:9000
volumes:
- ./:/var/www/html:rw
user: 1000:1000
environment:
- "RDS_HOST=${RDS_HOST}"
- "RDS_PORT=${RDS_PORT}"
- "RDS_USER=${RDS_USER}"
- "RDS_DB=${RDS_DB}"
- "RDS_PW=${RDS_PW}"
- "USLN_CONFIG_FILE=${USLN_CONFIG_FILE}"
command: bash -c "vendor/bin/doctrine orm:generate-proxies && php-fpm"
links:
- 'postgres-backend'
depends_on:
- 'postgres-backend'
nginx-backend:
image: nginx:latest
ports:
- 8000:80
links:
- 'api-backend'
volumes:
- ./.nginx.conf:/etc/nginx/conf.d/default.conf
depends_on:
- 'api-backend'
postgres-backend:
image: postgres:10.7
environment:
- "POSTGRES_PASSWORD=${RDS_PW}"
ports:
- 5432:5432
What is required to have docker-php-ext-... commands available? I am creating an Alpine image
FROM alpine:3.12
RUN apk update && \
# Add support for PHP7.4.
apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community \
php php7-fpm nginx composer git
....
# PHPIZE dependencies + xdebug
RUN apk add --no-cache autoconf file g++ gcc libc-dev make pkgconf re2c \
php7-pecl-xdebug \
&& docker-php-ext-install xdebug
...
But I am getting /bin/sh: docker-php-ext-install: not found.
How can I run the command?
Also, can apk add php7-pecl-xdebug replace installing pecl as a dependency and requiring the extension that way?
You are using vanilla alpine image.
docker-php-ext-* commands exist only in php-alpine image
For example, replace your FROM to something like:
FROM php:7.4-fpm-alpine
There are two problems.
As Dmitry said, you are not using the PHP image but the vanilla Alpine image.
You try to pack nginx and PHP into a single container.
When you want to orchestrate nginx and PHP, you should use docker-compose.
This is an example PHP+nginx docker-compose.yml:
version: '3.1'
services:
nginx:
restart: always
image: nginx:latest
volumes:
- ./html/:/var/www/html/:cached
ports:
- "80:80"
links:
- php
php:
restart: always
build:
dockerfile: Dockerfile
expose:
- 9000
volumes:
- ./:/var/www/:cached
And this is the PHP Dockerfile used:
FROM php:7.4-fpm-alpine
ENV COMPOSER_ALLOW_SUPERUSER 1
RUN docker-php-ext-install mysqli
RUN set -xe \
&& apk add --update \
icu \
&& apk add --no-cache --virtual .php-deps \
make \
&& apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
zlib-dev \
icu-dev \
g++ \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl \
&& docker-php-ext-enable intl \
&& { find /usr/local/lib -type f -print0 | xargs -0r strip --strip-all -p 2>/dev/null || true; } \
&& apk del .build-deps \
&& rm -rf /tmp/* /usr/local/lib/php/doc/* /var/cache/apk/*
I am using Nging+php-fpm in Docker on Mac OS.
I am trying to debug my app, but PHPStorm does not stop on breakpoints.
Here is my docker-compose.yml
version: '3'
services:
app_php:
build:
context: ./docker/php
dockerfile: Dockerfile
args:
USER_ID: 1000
GROUP_ID: 1000
restart: always
environment:
XDEBUG_CONFIG: remote_host=192.168.0.92
PHP_IDE_CONFIG: serverName=localhost
volumes:
- ./docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf
- ./web:/var/www/html
depends_on:
- db
- redis
web_nginx:
image: nginx:1.17.9-alpine
restart: always
ports:
- 8090:80
volumes:
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
- ./web:/var/www/html
depends_on:
- app_php
Here is Dockerfile
FROM php:7.4-fpm-alpine3.11
# Use the default production configuration
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
RUN apk add --no-cache \
shadow \
freetype \
freetype-dev \
ghostscript \
ghostscript-fonts \
gmp-dev \
graphicsmagick \
libjpeg-turbo \
libjpeg-turbo-dev \
libpng \
libpng-dev \
libwmf \
libxml2-dev \
libzip \
libzip-dev \
icu \
icu-dev \
git \
vim
# most likely used for local dev only
ARG USER_ID=1000
ARG GROUP_ID=1000
RUN usermod -u ${USER_ID} www-data \
&& groupmod -g ${GROUP_ID} www-data
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-configure zip
RUN pecl install redis \
&& docker-php-ext-enable redis
RUN docker-php-ext-install -j$(nproc) gd mysqli soap zip intl
ENV PHP_CONFIG_DIR /usr/local/etc/php
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
&& pecl install xdebug \
&& docker-php-ext-enable xdebug \
&& apk del -f .build-deps \
&& echo "zend_extension=$(find $(php-config --extension-dir) -name xdebug.so)" > $PHP_CONFIG_DIR/conf.d/xdebug.ini \
&& echo 'xdebug.remote_enable=1' >> $PHP_CONFIG_DIR/conf.d/xdebug.ini \
&& echo 'xdebug.remote_port=10000' >> $PHP_CONFIG_DIR/conf.d/xdebug.ini \
&& echo 'xdebug.remote_connect_back=1' >> $PHP_CONFIG_DIR/conf.d/xdebug.ini \
&& echo 'xdebug.remote_autostart=0' >> $PHP_CONFIG_DIR/conf.d/xdebug.ini \
&& echo 'xdebug.idekey="PHPSTORM"' >> $PHP_CONFIG_DIR/conf.d/xdebug.ini \
&& echo 'xdebug.max_nesting_level=1000' >> $PHP_CONFIG_DIR/conf.d/xdebug.ini
WORKDIR /var/www/html
And here are my configs in PHPStorm:
I tried to change XDEBUG_CONFIG: remote_host=192.168.0.92 to XDEBUG_CONFIG: remote_host=host.docker.internal but it does not help. Also I can reach 192.168.0.92:8090 by curl from inside docker container successfully.
Does anyone have an idea how to fix this issue?
I have installed docker on ubuntu and mac os. "docker-composer up" command works as expected on ubuntu and mac.
But on windows 8, I have installed docker toolbox and run "docker-compose up" command. I'm getting error while creating php-container.
Below is the screenshot of error:
Below is the docker-compose.yml file
version: "3.2"
services:
php:
build: './php/'
container_name: php-container
networks:
- backend
volumes:
- ./code/:/var/www/html/
- ./php/config/php.ini:/usr/local/etc/php/conf.d/php.ini
- ./php/config/mcrypt.so:/usr/local/lib/php/extensions/no-debug-non-zts-20151012/mcrypt.so
links:
- redis:redis
nginx:
container_name: nginx-container
image: nginx:latest
depends_on:
- php
- mysql
ports:
- "80:80"
networks:
- frontend
- backend
volumes:
- ./code/:/var/www/html/
- ./site.conf:/etc/nginx/conf.d/default.conf
links:
- php
mysql:
image: mysql:5.6.40
container_name: mysql-container
networks:
- backend
environment:
- MYSQL_ROOT_PASSWORD=password
volumes:
- /var/lib/postgresql/data
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: phpmyadmin-container
networks:
- backend
depends_on:
- mysql
links:
- mysql:mysql
ports:
- 8088:80
environment:
PMA_HOST: mysql
MYSQL_USERNAME: abcxyz
MYSQL_ROOT_PASSWORD: 321654987
networks:
frontend:
backend:
Below is the dockerfile for php
FROM php:7.0.32-fpm
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
&& docker-php-ext-install -j$(nproc) iconv \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd
RUN docker-php-ext-install mysqli
RUN pecl install -o -f redis \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable redis
RUN apt-get -qq update && apt-get -qq -y install \
automake \
cmake \
g++ \
git \
libicu-dev \
libmagickwand-dev \
libpng-dev \
librabbitmq-dev \
libreadline-dev \
pkg-config \
ssh-client \
supervisor \
zlib1g-dev \
&& docker-php-ext-install \
bcmath \
gd \
intl \
opcache \
pdo_mysql \
sockets \
zip \
&& git clone git://github.com/alanxz/rabbitmq-c.git \
&& cd rabbitmq-c \
&& mkdir build && cd build \
&& cmake -DENABLE_SSL_SUPPORT=OFF .. \
&& cmake --build . --target install \
&& pecl install amqp imagick xdebug igbinary \
&& docker-php-ext-enable amqp imagick xdebug igbinary \
&& version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
&& curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version \
&& mkdir -p /tmp/blackfire \
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
&& mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \
&& printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707\n" > $PHP_INI_DIR/conf.d/blackfire.ini \
&& curl -A "Docker" -L https://blackfire.io/api/v1/releases/client/linux_static/amd64 | tar zxp -C /tmp/blackfire \
&& mv /tmp/blackfire/blackfire /usr/bin/blackfire \
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y \
libmcrypt-dev \
&& docker-php-ext-install -j$(nproc) iconv mcrypt \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd
RUN apt-get install -y libxslt-dev
RUN apt-get install -y zlibc
RUN docker-php-ext-install xsl
RUN curl -s https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer
Same error here...
In my case in the docker-compose.yml file
apache:
build: '.\apache\'
container_name: apache-container
depends_on:
- php
- mysql
networks:
- frontend
- backend
ports:
- "80:80"
volumes:
- .\public_html\:/var/www/html/
- .\apache\demo.apache.conf:/usr/local/apache2/conf/demo.apache.conf
- .\apache\custom.conf:/usr/local/apache2/conf/test.conf
In the last line - .\apache\custom.conf:/usr/local/apache2/conf/test.conf i'm copying custom conf to test conf in docker. which is working as expected.
But when I change the test.conf to httpd.conf and run docker-compose up , the same error occur as shown in above screenshot in the question.
Error:
Error screenshot
So, If I check files on apache container, I can see test.conf file also there is httpd.conf file, but when I trying to replace httpd.conf file it is showing error.