Skip to content

Commit 267477b

Browse files
authored
Merge pull request #14 from moveis-simonetti/feat-remote-debug
(feat): permitir escolher porta de debug remoto
2 parents 2919b23 + 7093602 commit 267477b

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ ENV XDEBUG_AUTOSTART=false
1313
ENV XDEBUG_CONNECT_BACK=true
1414
ENV XDEBUG_ENABLED=false
1515
ENV XDEBUG_IDEKEY="docker"
16+
ENV XDEBUG_VERSION="-2.7.0beta1"
17+
ENV XDEBUG_REMOTE_PORT=9000
1618

1719
RUN apt-get update && apt-get install -y wget vim supervisor zip libfreetype6-dev libjpeg62-turbo-dev \
1820
libmcrypt-dev libpng-dev libssl-dev libaio1 git libcurl4-openssl-dev libxslt-dev \
@@ -56,7 +58,7 @@ RUN echo "---> Config sudoers" && \
5658

5759
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer
5860

59-
RUN pecl install xdebug
61+
RUN pecl install "xdebug${XDEBUG_VERSION}"
6062

6163
COPY configs/ports.conf /etc/apache2/ports.conf
6264
COPY apache-run.sh /usr/bin/apache-run

apache-run.sh

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
#!/bin/bash
22

33
if [[ $XDEBUG_ENABLED == true ]]; then
4-
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
5-
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
4+
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
5+
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=${XDEBUG_REMOTE_PORT}" | sudo tee -a /usr/local/etc/php/conf.d/xdebug.ini
99

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
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
1313

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
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
1717
fi
1818

1919
if [[ $NR_ENABLED == true ]]; then
20-
sudo sed -i -e "s/"REPLACE_WITH_REAL_KEY"/$NR_LICENSE_KEY/g" /scripts/newrelic.ini
21-
sudo sed -i -e "s/PHP Application/$NR_APP_NAME/g" /scripts/newrelic.ini
22-
sudo cp /scripts/newrelic.ini /usr/local/etc/php/conf.d/newrelic.ini
20+
sudo sed -i -e "s/"REPLACE_WITH_REAL_KEY"/$NR_LICENSE_KEY/g" /scripts/newrelic.ini
21+
sudo sed -i -e "s/PHP Application/$NR_APP_NAME/g" /scripts/newrelic.ini
22+
sudo cp /scripts/newrelic.ini /usr/local/etc/php/conf.d/newrelic.ini
2323
fi
2424

2525
if [[ $SESSION_HANDLER == true ]]; then
26-
echo "session.save_handler = $SESSION_HANDLER_NAME" | sudo tee -a /usr/local/etc/php/conf.d/session-handler.ini
27-
echo "session.save_path = $SESSION_HANDLER_PATH" | sudo tee -a /usr/local/etc/php/conf.d/session-handler.ini
26+
echo "session.save_handler = $SESSION_HANDLER_NAME" | sudo tee -a /usr/local/etc/php/conf.d/session-handler.ini
27+
echo "session.save_path = $SESSION_HANDLER_PATH" | sudo tee -a /usr/local/etc/php/conf.d/session-handler.ini
2828
fi
2929

3030
sudo rm -rf var/cache/* var/logs/* \
31-
&& sudo mkdir -p /var/www/html/var/cache \
32-
&& sudo mkdir -p /var/www/html/var/logs \
33-
&& sudo mkdir -p /var/www/html/var/sessions \
31+
&& sudo mkdir -p /var/www/html/var/cache \
32+
&& sudo mkdir -p /var/www/html/var/logs \
33+
&& sudo mkdir -p /var/www/html/var/sessions \
3434
&& sudo chown -R www-data:www-data /var/www/html/var/cache && chmod 777 /var/www/html/var/cache \
3535
&& sudo chown -R www-data:www-data /var/www/html/var/logs && chmod 777 /var/www/html/var/logs \
3636
&& sudo chown -R www-data:www-data /var/www/html/var/sessions && chmod 777 /var/www/html/var/sessions \

0 commit comments

Comments
 (0)