Skip to content

Commit

Permalink
Merge pull request #204 from boxuk/remove-need-for-xdebug-dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Jenkins authored Mar 28, 2022
2 parents f2f0f6c + 121b383 commit 7a5e396
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 181 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
pull_request:
paths:
- "docker/**/Dockerfile"
- "docker/app/**/Dockerfile_xdebug"
push:
branches:
- main
Expand All @@ -23,4 +22,4 @@ jobs:
- name: "Lint Dockerfile(s)"
uses: jbergstroem/hadolint-gh-action@v1
with:
dockerfile: "./docker/**/Dockerfile ./docker/app/**/Dockerfile_xdebug"
dockerfile: "./docker/**/Dockerfile"
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,25 @@ services:
volumes:
- '.:/var/www/html:cached'
extra_hosts:
- host.docker.internal:host-gateway
- '${LOOPBACK_HOST_NAME}:192.168.35.10' # IP should match the IP address set for nginx below
depends_on:
- database

app_xdebug:
build:
context: docker/app
dockerfile: php${PHP_VERSION:-7.4}/Dockerfile_xdebug
dockerfile: php${PHP_VERSION:-7.4}/Dockerfile
args:
USER_ID: ${USER_ID:-0}
GROUP_ID: ${GROUP_ID:-0}
INSTALL_XDEBUG: true
env_file:
- ./docker/app/.env
volumes:
- '.:/var/www/html:cached'
extra_hosts:
- host.docker.internal:host-gateway
- '${LOOPBACK_HOST_NAME}:192.168.35.10' # IP should match the IP address set for nginx below
depends_on:
- database
Expand Down
2 changes: 1 addition & 1 deletion docker/app/.env.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PHP_XDEBUG_ENABLED=1
PHP_XDEBUG_REMOTE_PORT=9002
# Xdebug remote host likely 192.168.35.1 if not using docker or on linux
# Xdebug remote host likely 192.168.35.1 if not using docker or possibly on linux
PHP_XDEBUG_REMOTE_HOST=host.docker.internal
PHP_XDEBUG_IDKEY=wordpress
PHP_MEMORY_LIMIT=2G
Expand Down
5 changes: 3 additions & 2 deletions docker/app/php7.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ FROM php:7.4.28-fpm

ARG USER_ID
ARG GROUP_ID
ARG INSTALL_XDEBUG

# Do all apt-get installs on one line so they are installed on the same layer
RUN set -eux; \
apt-get -y update; \
apt-get -y install git less zip unzip zlib1g-dev libicu-dev g++ libpng-dev libzip-dev libmagickwand-dev --no-install-recommends; \
apt-get clean && apt-get autoremove; \
rm -rf /var/lib/apt/lists/*; \
pecl install memcache-4.0.5.2; \
pecl install memcache-8.0 && docker-php-ext-enable memcache; \
pecl install imagick && docker-php-ext-enable imagick; \
docker-php-ext-enable memcache; \
[ "${INSTALL_XDEBUG:-false}" = true ] && pecl install xdebug && docker-php-ext-enable xdebug; \
docker-php-ext-configure intl; \
docker-php-ext-install -j"$(nproc)" mysqli opcache zip intl gd

Expand Down
57 changes: 0 additions & 57 deletions docker/app/php7.4/Dockerfile_xdebug

This file was deleted.

5 changes: 3 additions & 2 deletions docker/app/php8.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ FROM php:8.0.17-fpm

ARG USER_ID
ARG GROUP_ID
ARG INSTALL_XDEBUG

# Do all apt-get installs on one line so they are installed on the same layer
RUN set -eux; \
apt-get -y update; \
apt-get -y install git less zip unzip zlib1g-dev libicu-dev g++ libpng-dev libzip-dev libmagickwand-dev --no-install-recommends; \
apt-get clean && apt-get autoremove; \
rm -rf /var/lib/apt/lists/*; \
pecl install memcache-8.0; \
pecl install memcache-8.0 && docker-php-ext-enable memcache; \
pecl install imagick && docker-php-ext-enable imagick; \
docker-php-ext-enable memcache; \
[ "${INSTALL_XDEBUG:-false}" = true ] && pecl install xdebug && docker-php-ext-enable xdebug; \
docker-php-ext-configure intl; \
docker-php-ext-install -j"$(nproc)" mysqli opcache zip intl gd

Expand Down
57 changes: 0 additions & 57 deletions docker/app/php8.0/Dockerfile_xdebug

This file was deleted.

5 changes: 3 additions & 2 deletions docker/app/php8.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ FROM php:8.1.4-fpm

ARG USER_ID
ARG GROUP_ID
ARG INSTALL_XDEBUG

# Do all apt-get installs on one line so they are installed on the same layer
RUN set -eux; \
apt-get -y update; \
apt-get -y install git less zip unzip zlib1g-dev libicu-dev g++ libpng-dev libzip-dev libmagickwand-dev --no-install-recommends; \
apt-get clean && apt-get autoremove; \
rm -rf /var/lib/apt/lists/*; \
pecl install memcache-8.0; \
pecl install memcache-8.0 && docker-php-ext-enable memcache; \
pecl install imagick && docker-php-ext-enable imagick; \
docker-php-ext-enable memcache; \
[ "${INSTALL_XDEBUG:-false}" = true ] && pecl install xdebug && docker-php-ext-enable xdebug; \
docker-php-ext-configure intl; \
docker-php-ext-install -j"$(nproc)" mysqli opcache zip intl gd

Expand Down
57 changes: 0 additions & 57 deletions docker/app/php8.1/Dockerfile_xdebug

This file was deleted.

0 comments on commit 7a5e396

Please sign in to comment.