Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docker] Fix build and xdebug support added #442

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
enable Xdebug with docker build stage and dc override
  • Loading branch information
lwillems authored and lchrusciel committed Nov 10, 2020
commit e896397c7133ed50518dbc20423e9e347cde15a6
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,12 @@ WORKDIR /srv/sylius

COPY --from=sylius_php /srv/sylius/public public/
COPY --from=sylius_nodejs /srv/sylius/public public/

FROM symfony_php as sylius_php_dev

ARG XDEBUG_VERSION=2.9.8
RUN set -eux; \
apk add --no-cache --virtual .build-deps $PHPIZE_DEPS; \
pecl install xdebug-$XDEBUG_VERSION; \
docker-php-ext-enable xdebug; \
apk del .build-deps
19 changes: 19 additions & 0 deletions docker-compose.debug.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: "3.4"

services:
php:
build:
context: .
target: sylius_php_dev
environment:
# See https://docs.docker.com/docker-for-mac/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host
# See https://github.com/docker/for-linux/issues/264
# The `remote_host` below may optionally be replaced with `remote_connect_back` (eg: linux users)
XDEBUG_CONFIG: >-
remote_enable=1
remote_host=host.docker.internal
remote_port=9001
idekey=PHPSTORM
# This should correspond to the server declared in PHPStorm `Preferences | Languages & Frameworks | PHP | Servers`
# Then PHPStorm will use the corresponding path mappings
PHP_IDE_CONFIG: serverName=sylius