S
S
SokolovArtur2016-08-10 17:11:14
xdebug
SokolovArtur, 2016-08-10 17:11:14

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

2 answer(s)
D
Denis Bondar, 2018-10-19
@denisbondar

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.

A
alexgivi, 2016-08-29
@alexgivi

https://gist.github.com/chadrien/c90927ec2d160ffea9c4

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question