Answer the question
In order to leave comments, you need to log in
How to set up Xdebug in docker?
I am used to working with Xdebug in PhpStorm. But the trouble is, they use docker at work, and I'm not friends with it. General question: how to set up Xdebug in docker.
# .docker/apache
FROM php:7-apache
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng12-dev \
libicu-dev \
libpq-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) opcache gd pdo_pgsql \
&& docker-php-ext-enable opcache
RUN mkdir /var/log/apache/
RUN mkdir /var/www/html/web/
RUN sed -i "s/Listen 80/Listen 8080/" /etc/apache2/ports.conf
COPY apache.conf /etc/apache2/sites-available/site.conf
RUN a2enmod rewrite \
&& a2ensite site
# docker-compose.yml
version: '2'
services:
apache:
build: .docker/apache
expose:
- "8080"
Answer the question
In order to leave comments, you need to log in
A complete description of using xdebug with PhpStorm and an interpreter in a Docker container is described in my article . Maybe someone will come in handy.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question