Skip to content

Commit

Permalink
fixing docker files php and nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
Muneer-Shafi committed Jan 4, 2025
1 parent ba6b7d0 commit b4bc430
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 31 deletions.
2 changes: 1 addition & 1 deletion docker/Dockerfile-nginx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM nginx
COPY ./build/nginx/default.conf /etc/nginx/conf.d/
COPY ./build/default.conf /etc/nginx/conf.d/

RUN echo "upstream php-upstream { server fpm:9000; }" > /etc/nginx/conf.d/upstream.conf
RUN usermod -u 1000 www-data
32 changes: 2 additions & 30 deletions docker/Dockerfile-php
Original file line number Diff line number Diff line change
Expand Up @@ -33,35 +33,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
intl \
&& rm -rf /var/lib/apt/lists/*

# Install Xdebug

# Install Xdebug via PECL
RUN pecl channel-update pecl.php.net \
&& pecl install xdebug-3.2.1 || { \
echo "PECL failed. Installing Xdebug from source."; \
curl -fsSL https://xdebug.org/files/xdebug-3.2.1.tgz -o /tmp/xdebug.tgz && \
tar -xf /tmp/xdebug.tgz -C /tmp && \
cd /tmp/xdebug-3.2.1 && \
phpize && ./configure && make && make install && \
rm -rf /tmp/xdebug*; \
} \
&& docker-php-ext-enable xdebug

# Xdebug Configuration
RUN { \
echo "xdebug.mode=debug,develop"; \
echo "xdebug.client_port=9003"; \
echo "xdebug.start_with_request=yes"; \
echo "xdebug.log=/tmp/xdebug.log"; \
echo "xdebug.log_level=7"; \
# For Linux, use host network gateway IP
echo "xdebug.client_host=host.gateway.internal"; \
# Or dynamically find host IP
# echo "xdebug.client_host=$(ip route | awk '/default/ { print $3 }')"; \
} >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

COPY ./build/php/opcache.ini /usr/local/etc/php/conf.d/
COPY ./build/php/error_reporting.ini /usr/local/etc/php/conf.d/
COPY ./build/opcache.ini /usr/local/etc/php/conf.d/
COPY ./build/error_reporting.ini /usr/local/etc/php/conf.d/

# Install Symfony CLI
RUN curl -sS https://get.symfony.com/cli/installer | bash \
Expand All @@ -82,6 +57,3 @@ RUN usermod -u 1000 www-data \

# Set working directory
WORKDIR /var/www/demo/

# Run Composer install (uncomment if required during build)
# RUN composer install
Binary file removed docker/build/db/docker_sf.sql.gz
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit b4bc430

Please sign in to comment.