Editing php.ini to enable XDebug for Docker and Drupal

484 Views Asked by At

I am a real beginner with Docker & Portainer. I am trying to setup a local test environment using Docker for my Drupal 7 & 8 Sites. I've used the Stacks editor inside Portainer to define two containers for Drupal. I want to edit the php.ini file to enable XDebug so I can do some debugging for some custom PHP code via VSCode.

I cannot find a way (to find or) edit the php.ini for those Drupal boxes. I am placing the code I used for in the Stacks Editor below.

version: '2'

services:  
 
traefik:
    image: traefik
    container_name: traefik
    ports:
      - 80:80
      - 8080:8080
      - 443:443
    command:
      - --api.insecure=true
      - --api.dashboard=true
      - --entrypoints.web.address=:80
      - --entrypoints.web-secured.address=:443
      - --providers.docker=true
      - --providers.docker.exposedbydefault=false
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock         
mysql:
    image: mysql:5.7
    command: --default-authentication-plugin=mysql_native_password
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: example
    ports:
      - 3306:3306
    volumes:
      - mysql:/var/lib/mysql
stg.company:
    image: drupal:7.36
    container_name: stg.company
    depends_on:
      - mysql
    restart: unless-stopped
    volumes:
      - /Work/stg.company:/var/www/html
    labels:
      - traefik.enable=true
      - traefik.http.routers.company_org_nginx-http.entrypoints=web
      - traefik.http.routers.company_org_nginx-http.rule=Host(`dev.company.org`)
stg.portal.company:
    image: drupal:7.36
    container_name: stg.portal.company
    depends_on:
      - mysql
    restart: unless-stopped
    volumes:
      - /Work/stg.portal.company:/var/www/html
    labels:
      - traefik.enable=true
      - traefik.http.routers.portal_company_org_nginx-http.entrypoints=web
      - traefik.http.routers.portal_company_org_nginx-http.rule=Host(`dev.portal.company.org`)
0

There are 0 best solutions below