Skip to content

Commit 2919b23

Browse files
author
Móveis Simonetti
authored
Merge pull request #10 from lucassabreu/master
improv xdebug setup
2 parents 140fdd5 + 1abc2ea commit 2919b23

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@ FROM php:7.0-apache
33

44
ENV http_proxy ${HTTP_PROXY}
55
ENV https_proxy ${HTTP_PROXY}
6-
ENV XDEBUG_ENABLED=false
76
ENV NR_ENABLED=false
87
ENV NR_APP_NAME=""
98
ENV NR_LICENSE_KEY=""
109
ENV SESSION_HANDLER=false
1110
ENV SESSION_HANDLER_NAME=""
1211
ENV SESSION_HANDLER_PATH=""
12+
ENV XDEBUG_AUTOSTART=false
13+
ENV XDEBUG_CONNECT_BACK=true
14+
ENV XDEBUG_ENABLED=false
15+
ENV XDEBUG_IDEKEY="docker"
1316

1417
RUN apt-get update && apt-get install -y wget vim supervisor zip libfreetype6-dev libjpeg62-turbo-dev \
1518
libmcrypt-dev libpng-dev libssl-dev libaio1 git libcurl4-openssl-dev libxslt-dev \
@@ -66,4 +69,4 @@ WORKDIR "/var/www/html"
6669

6770
EXPOSE 8080 9001
6871

69-
CMD ["/tini", "--", "/usr/bin/apache-run"]
72+
CMD ["/tini", "--", "/usr/bin/apache-run"]

Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
all: build
2+
3+
IMAGE=lojassimonetti/php-apache-oci8-composer
4+
TAG=$(shell git branch | grep \* | cut -d ' ' -f2)
5+
6+
build:
7+
docker build . -t $(IMAGE):$(TAG)
8+
9+
push: build
10+
docker push $(IMAGE):$(TAG)
11+

apache-run.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
if [[ $XDEBUG_ENABLED == true ]]; then
44
echo "zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so" | sudo tee -a /usr/local/etc/php/conf.d/xdebug.ini
55
echo "xdebug.var_display_max_depth=5" | sudo tee -a /usr/local/etc/php/conf.d/xdebug.ini
6+
echo "xdebug.idekey=${XDEBUG_IDEKEY}" | sudo tee -a /usr/local/etc/php/conf.d/xdebug.ini
7+
echo "xdebug.remote_enable=1" | sudo tee -a /usr/local/etc/php/conf.d/xdebug.ini
8+
echo "xdebug.remote_port=9000" | sudo tee -a /usr/local/etc/php/conf.d/xdebug.ini
9+
10+
[[ ${XDEBUG_AUTOSTART} == true ]] && {
11+
echo "xdebug.remote_autostart=on" | sudo tee -a /usr/local/etc/php/conf.d/xdebug.ini
12+
} || echo "xdebug.remote_autostart=off" | sudo tee -a /usr/local/etc/php/conf.d/xdebug.ini
13+
14+
[[ ${XDEBUG_CONNECT_BACK} == true ]] && {
15+
echo "xdebug.remote_connect_back=1" | sudo tee -a /usr/local/etc/php/conf.d/xdebug.ini
16+
} || echo "xdebug.remote_connect_back=0" | sudo tee -a /usr/local/etc/php/conf.d/xdebug.ini
617
fi
718

819
if [[ $NR_ENABLED == true ]]; then
@@ -24,4 +35,4 @@ sudo rm -rf var/cache/* var/logs/* \
2435
&& sudo chown -R www-data:www-data /var/www/html/var/logs && chmod 777 /var/www/html/var/logs \
2536
&& sudo chown -R www-data:www-data /var/www/html/var/sessions && chmod 777 /var/www/html/var/sessions \
2637

27-
apache2-foreground
38+
exec apache2-foreground

0 commit comments

Comments
 (0)